diff --git a/README.md b/README.md index 153e5720e..2810d0970 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 7.0.0 + 7.0.1 pom import diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java index 1a4e7e2c0..a338d1356 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlClient.java @@ -182,264 +182,6 @@ public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   autoMlClient.deleteDatasetAsync(name).get();
-   * }
-   * 
- * - * @param name Required. The resource name of the dataset to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync(DatasetName name) { - DeleteDatasetRequest request = - DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteDatasetAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   autoMlClient.deleteDatasetAsync(name.toString()).get();
-   * }
-   * 
- * - * @param name Required. The resource name of the dataset to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync(String name) { - DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); - return deleteDatasetAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   autoMlClient.deleteDatasetAsync(request).get();
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync( - DeleteDatasetRequest request) { - return deleteDatasetOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - deleteDatasetOperationCallable() { - return stub.deleteDatasetOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteDatasetCallable() { - return stub.deleteDatasetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a model. Returns `google.protobuf.Empty` in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deleteModelAsync(name).get();
-   * }
-   * 
- * - * @param name Required. Resource name of the model being deleted. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync(ModelName name) { - DeleteModelRequest request = - DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteModelAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a model. Returns `google.protobuf.Empty` in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deleteModelAsync(name.toString()).get();
-   * }
-   * 
- * - * @param name Required. Resource name of the model being deleted. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync(String name) { - DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); - return deleteModelAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a model. Returns `google.protobuf.Empty` in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   autoMlClient.deleteModelAsync(request).get();
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync( - DeleteModelRequest request) { - return deleteModelOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a model. Returns `google.protobuf.Empty` in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - deleteModelOperationCallable() { - return stub.deleteModelOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a model. Returns `google.protobuf.Empty` in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteModelCallable() { - return stub.deleteModelCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a dataset. @@ -745,125 +487,254 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Dataset element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDatasetsPagedCallable() { + return stub.listDatasetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists datasets in a project. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
+   *     for (Dataset element : response.getDatasetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listDatasetsCallable() { + return stub.listDatasetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Dataset response = autoMlClient.updateDataset(dataset, updateMask);
+   * }
+   * 
+ * + * @param dataset Required. The dataset which replaces the resource on the server. + * @param updateMask Required. The update mask applies to the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) { + UpdateDatasetRequest request = + UpdateDatasetRequest.newBuilder().setDataset(dataset).setUpdateMask(updateMask).build(); + return updateDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Dataset response = autoMlClient.updateDataset(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset updateDataset(UpdateDatasetRequest request) { + return updateDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Dataset response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateDatasetCallable() { + return stub.updateDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name).get();
    * }
    * 
+ * + * @param name Required. The resource name of the dataset to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable - listDatasetsPagedCallable() { - return stub.listDatasetsPagedCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteDatasetAsync(DatasetName name) { + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteDatasetAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
-   *     for (Dataset element : response.getDatasetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name.toString()).get();
    * }
    * 
+ * + * @param name Required. The resource name of the dataset to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listDatasetsCallable() { - return stub.listDatasetsCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteDatasetAsync(String name) { + DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); + return deleteDatasetAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Dataset response = autoMlClient.updateDataset(dataset, updateMask);
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deleteDatasetAsync(request).get();
    * }
    * 
* - * @param dataset Required. The dataset which replaces the resource on the server. - * @param updateMask Required. The update mask applies to the resource. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) { - UpdateDatasetRequest request = - UpdateDatasetRequest.newBuilder().setDataset(dataset).setUpdateMask(updateMask).build(); - return updateDataset(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteDatasetAsync( + DeleteDatasetRequest request) { + return deleteDatasetOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
-   *     .setDataset(dataset)
-   *     .setUpdateMask(updateMask)
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   Dataset response = autoMlClient.updateDataset(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset updateDataset(UpdateDatasetRequest request) { - return updateDatasetCallable().call(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteDatasetOperationCallable() { + return stub.deleteDatasetOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Deletes a dataset and all of its contents. Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
-   *     .setDataset(dataset)
-   *     .setUpdateMask(updateMask)
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
    *   // Do something
-   *   Dataset response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable updateDatasetCallable() { - return stub.updateDatasetCallable(); + public final UnaryCallable deleteDatasetCallable() { + return stub.deleteDatasetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1615,6 +1486,135 @@ public final UnaryCallable listModelsCall return stub.listModelsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name).get();
+   * }
+   * 
+ * + * @param name Required. Resource name of the model being deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync(ModelName name) { + DeleteModelRequest request = + DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Required. Resource name of the model being deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync(String name) { + DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); + return deleteModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deleteModelAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync( + DeleteModelRequest request) { + return deleteModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteModelOperationCallable() { + return stub.deleteModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteModelCallable() { + return stub.deleteModelCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Updates a model. diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java index 19589f659..41dfc8ec9 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/AutoMlSettings.java @@ -72,32 +72,6 @@ @Generated("by gapic-generator") @BetaApi public class AutoMlSettings extends ClientSettings { - /** Returns the object with the settings used for calls to deleteDataset. */ - public UnaryCallSettings deleteDatasetSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteDatasetSettings(); - } - - /** Returns the object with the settings used for calls to deleteDataset. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - deleteDatasetOperationSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteDatasetOperationSettings(); - } - - /** Returns the object with the settings used for calls to deleteModel. */ - public UnaryCallSettings deleteModelSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteModelSettings(); - } - - /** Returns the object with the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - deleteModelOperationSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); - } - /** Returns the object with the settings used for calls to createDataset. */ public UnaryCallSettings createDatasetSettings() { return ((AutoMlStubSettings) getStubSettings()).createDatasetSettings(); @@ -127,6 +101,19 @@ public UnaryCallSettings updateDatasetSettings() return ((AutoMlStubSettings) getStubSettings()).updateDatasetSettings(); } + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteDatasetSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteDatasetOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteDatasetOperationSettings(); + } + /** Returns the object with the settings used for calls to importData. */ public UnaryCallSettings importDataSettings() { return ((AutoMlStubSettings) getStubSettings()).importDataSettings(); @@ -182,6 +169,19 @@ public UnaryCallSettings getModelSettings() { return ((AutoMlStubSettings) getStubSettings()).listModelsSettings(); } + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelSettings(); + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); + } + /** Returns the object with the settings used for calls to updateModel. */ public UnaryCallSettings updateModelSettings() { return ((AutoMlStubSettings) getStubSettings()).updateModelSettings(); @@ -337,32 +337,6 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to deleteDataset. */ - public UnaryCallSettings.Builder deleteDatasetSettings() { - return getStubSettingsBuilder().deleteDatasetSettings(); - } - - /** Returns the builder for the settings used for calls to deleteDataset. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteDatasetOperationSettings() { - return getStubSettingsBuilder().deleteDatasetOperationSettings(); - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - public UnaryCallSettings.Builder deleteModelSettings() { - return getStubSettingsBuilder().deleteModelSettings(); - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteModelOperationSettings() { - return getStubSettingsBuilder().deleteModelOperationSettings(); - } - /** Returns the builder for the settings used for calls to createDataset. */ public UnaryCallSettings.Builder createDatasetSettings() { return getStubSettingsBuilder().createDatasetSettings(); @@ -393,6 +367,19 @@ public UnaryCallSettings.Builder updateDatasetSet return getStubSettingsBuilder().updateDatasetSettings(); } + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return getStubSettingsBuilder().deleteDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteDatasetOperationSettings() { + return getStubSettingsBuilder().deleteDatasetOperationSettings(); + } + /** Returns the builder for the settings used for calls to importData. */ public UnaryCallSettings.Builder importDataSettings() { return getStubSettingsBuilder().importDataSettings(); @@ -449,6 +436,19 @@ public UnaryCallSettings.Builder getModelSettings() { return getStubSettingsBuilder().listModelsSettings(); } + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return getStubSettingsBuilder().deleteModelSettings(); + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return getStubSettingsBuilder().deleteModelOperationSettings(); + } + /** Returns the builder for the settings used for calls to updateModel. */ public UnaryCallSettings.Builder updateModelSettings() { return getStubSettingsBuilder().updateModelSettings(); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java index af3c62c6d..56d405ae4 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStub.java @@ -69,26 +69,6 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteDatasetOperationCallable() { - throw new UnsupportedOperationException("Not implemented: deleteDatasetOperationCallable()"); - } - - public UnaryCallable deleteDatasetCallable() { - throw new UnsupportedOperationException("Not implemented: deleteDatasetCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteModelOperationCallable() { - throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()"); - } - - public UnaryCallable deleteModelCallable() { - throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createDatasetOperationCallable() { @@ -115,6 +95,16 @@ public UnaryCallable updateDatasetCallable() { throw new UnsupportedOperationException("Not implemented: updateDatasetCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteDatasetOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetOperationCallable()"); + } + + public UnaryCallable deleteDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetCallable()"); + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable importDataOperationCallable() { @@ -161,6 +151,16 @@ public UnaryCallable listModelsCallable() throw new UnsupportedOperationException("Not implemented: listModelsCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()"); + } + + public UnaryCallable deleteModelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); + } + public UnaryCallable updateModelCallable() { throw new UnsupportedOperationException("Not implemented: updateModelCallable()"); } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java index 7784eb163..a9cdd3d79 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/AutoMlStubSettings.java @@ -120,12 +120,6 @@ public class AutoMlStubSettings extends StubSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - private final UnaryCallSettings deleteDatasetSettings; - private final OperationCallSettings - deleteDatasetOperationSettings; - private final UnaryCallSettings deleteModelSettings; - private final OperationCallSettings - deleteModelOperationSettings; private final UnaryCallSettings createDatasetSettings; private final OperationCallSettings createDatasetOperationSettings; @@ -134,6 +128,9 @@ public class AutoMlStubSettings extends StubSettings { ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> listDatasetsSettings; private final UnaryCallSettings updateDatasetSettings; + private final UnaryCallSettings deleteDatasetSettings; + private final OperationCallSettings + deleteDatasetOperationSettings; private final UnaryCallSettings importDataSettings; private final OperationCallSettings importDataOperationSettings; @@ -148,6 +145,9 @@ public class AutoMlStubSettings extends StubSettings { private final UnaryCallSettings getModelSettings; private final PagedCallSettings listModelsSettings; + private final UnaryCallSettings deleteModelSettings; + private final OperationCallSettings + deleteModelOperationSettings; private final UnaryCallSettings updateModelSettings; private final UnaryCallSettings deployModelSettings; private final OperationCallSettings @@ -166,30 +166,6 @@ public class AutoMlStubSettings extends StubSettings { ListModelEvaluationsPagedResponse> listModelEvaluationsSettings; - /** Returns the object with the settings used for calls to deleteDataset. */ - public UnaryCallSettings deleteDatasetSettings() { - return deleteDatasetSettings; - } - - /** Returns the object with the settings used for calls to deleteDataset. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - deleteDatasetOperationSettings() { - return deleteDatasetOperationSettings; - } - - /** Returns the object with the settings used for calls to deleteModel. */ - public UnaryCallSettings deleteModelSettings() { - return deleteModelSettings; - } - - /** Returns the object with the settings used for calls to deleteModel. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - deleteModelOperationSettings() { - return deleteModelOperationSettings; - } - /** Returns the object with the settings used for calls to createDataset. */ public UnaryCallSettings createDatasetSettings() { return createDatasetSettings; @@ -218,6 +194,18 @@ public UnaryCallSettings updateDatasetSettings() return updateDatasetSettings; } + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteDatasetOperationSettings() { + return deleteDatasetOperationSettings; + } + /** Returns the object with the settings used for calls to importData. */ public UnaryCallSettings importDataSettings() { return importDataSettings; @@ -270,6 +258,18 @@ public UnaryCallSettings getModelSettings() { return listModelsSettings; } + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + /** Returns the object with the settings used for calls to updateModel. */ public UnaryCallSettings updateModelSettings() { return updateModelSettings; @@ -394,15 +394,13 @@ public Builder toBuilder() { protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - deleteDatasetSettings = settingsBuilder.deleteDatasetSettings().build(); - deleteDatasetOperationSettings = settingsBuilder.deleteDatasetOperationSettings().build(); - deleteModelSettings = settingsBuilder.deleteModelSettings().build(); - deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); createDatasetSettings = settingsBuilder.createDatasetSettings().build(); createDatasetOperationSettings = settingsBuilder.createDatasetOperationSettings().build(); getDatasetSettings = settingsBuilder.getDatasetSettings().build(); listDatasetsSettings = settingsBuilder.listDatasetsSettings().build(); updateDatasetSettings = settingsBuilder.updateDatasetSettings().build(); + deleteDatasetSettings = settingsBuilder.deleteDatasetSettings().build(); + deleteDatasetOperationSettings = settingsBuilder.deleteDatasetOperationSettings().build(); importDataSettings = settingsBuilder.importDataSettings().build(); importDataOperationSettings = settingsBuilder.importDataOperationSettings().build(); exportDataSettings = settingsBuilder.exportDataSettings().build(); @@ -412,6 +410,8 @@ protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { createModelOperationSettings = settingsBuilder.createModelOperationSettings().build(); getModelSettings = settingsBuilder.getModelSettings().build(); listModelsSettings = settingsBuilder.listModelsSettings().build(); + deleteModelSettings = settingsBuilder.deleteModelSettings().build(); + deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); updateModelSettings = settingsBuilder.updateModelSettings().build(); deployModelSettings = settingsBuilder.deployModelSettings().build(); deployModelOperationSettings = settingsBuilder.deployModelOperationSettings().build(); @@ -598,12 +598,6 @@ public ApiFuture getFuturePagedResponse( public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder deleteDatasetSettings; - private final OperationCallSettings.Builder - deleteDatasetOperationSettings; - private final UnaryCallSettings.Builder deleteModelSettings; - private final OperationCallSettings.Builder - deleteModelOperationSettings; private final UnaryCallSettings.Builder createDatasetSettings; private final OperationCallSettings.Builder createDatasetOperationSettings; @@ -612,6 +606,9 @@ public static class Builder extends StubSettings.Builder listDatasetsSettings; private final UnaryCallSettings.Builder updateDatasetSettings; + private final UnaryCallSettings.Builder deleteDatasetSettings; + private final OperationCallSettings.Builder + deleteDatasetOperationSettings; private final UnaryCallSettings.Builder importDataSettings; private final OperationCallSettings.Builder importDataOperationSettings; @@ -627,6 +624,9 @@ public static class Builder extends StubSettings.Builder listModelsSettings; + private final UnaryCallSettings.Builder deleteModelSettings; + private final OperationCallSettings.Builder + deleteModelOperationSettings; private final UnaryCallSettings.Builder updateModelSettings; private final UnaryCallSettings.Builder deployModelSettings; private final OperationCallSettings.Builder @@ -652,11 +652,13 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -670,12 +672,22 @@ public static class Builder extends StubSettings.Builder>of( - deleteDatasetSettings, - deleteModelSettings, createDatasetSettings, getDatasetSettings, listDatasetsSettings, updateDatasetSettings, + deleteDatasetSettings, importDataSettings, exportDataSettings, getAnnotationSpecSettings, createModelSettings, getModelSettings, listModelsSettings, + deleteModelSettings, updateModelSettings, deployModelSettings, undeployModelSettings, @@ -776,105 +788,105 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { - builder - .deleteDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .deleteModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .createDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listDatasetsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .updateDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .importDataSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .exportDataSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getAnnotationSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .createModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listModelsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .updateModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .deployModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .undeployModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .exportModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getModelEvaluationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listModelEvaluationsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .deleteDatasetOperationSettings() + .createDatasetOperationSettings() .setInitialCallSettings( UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + ProtoOperationTransformers.ResponseTransformer.create(Dataset.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -889,11 +901,12 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .deleteModelOperationSettings() + .deleteDatasetOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -911,15 +924,14 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .createDatasetOperationSettings() + .importDataOperationSettings() .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Dataset.class)) + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -934,11 +946,11 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .importDataOperationSettings() + .exportDataOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -956,14 +968,14 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .exportDataOperationSettings() + .createModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + ProtoOperationTransformers.ResponseTransformer.create(Model.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -978,14 +990,14 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .createModelOperationSettings() + .deleteModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Model.class)) + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -1003,8 +1015,8 @@ private static Builder initDefaults(Builder builder) { .deployModelOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1026,8 +1038,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1048,8 +1060,8 @@ private static Builder initDefaults(Builder builder) { .exportModelOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1073,15 +1085,13 @@ private static Builder initDefaults(Builder builder) { protected Builder(AutoMlStubSettings settings) { super(settings); - deleteDatasetSettings = settings.deleteDatasetSettings.toBuilder(); - deleteDatasetOperationSettings = settings.deleteDatasetOperationSettings.toBuilder(); - deleteModelSettings = settings.deleteModelSettings.toBuilder(); - deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); createDatasetSettings = settings.createDatasetSettings.toBuilder(); createDatasetOperationSettings = settings.createDatasetOperationSettings.toBuilder(); getDatasetSettings = settings.getDatasetSettings.toBuilder(); listDatasetsSettings = settings.listDatasetsSettings.toBuilder(); updateDatasetSettings = settings.updateDatasetSettings.toBuilder(); + deleteDatasetSettings = settings.deleteDatasetSettings.toBuilder(); + deleteDatasetOperationSettings = settings.deleteDatasetOperationSettings.toBuilder(); importDataSettings = settings.importDataSettings.toBuilder(); importDataOperationSettings = settings.importDataOperationSettings.toBuilder(); exportDataSettings = settings.exportDataSettings.toBuilder(); @@ -1091,6 +1101,8 @@ protected Builder(AutoMlStubSettings settings) { createModelOperationSettings = settings.createModelOperationSettings.toBuilder(); getModelSettings = settings.getModelSettings.toBuilder(); listModelsSettings = settings.listModelsSettings.toBuilder(); + deleteModelSettings = settings.deleteModelSettings.toBuilder(); + deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); updateModelSettings = settings.updateModelSettings.toBuilder(); deployModelSettings = settings.deployModelSettings.toBuilder(); deployModelOperationSettings = settings.deployModelOperationSettings.toBuilder(); @@ -1103,18 +1115,18 @@ protected Builder(AutoMlStubSettings settings) { unaryMethodSettingsBuilders = ImmutableList.>of( - deleteDatasetSettings, - deleteModelSettings, createDatasetSettings, getDatasetSettings, listDatasetsSettings, updateDatasetSettings, + deleteDatasetSettings, importDataSettings, exportDataSettings, getAnnotationSpecSettings, createModelSettings, getModelSettings, listModelsSettings, + deleteModelSettings, updateModelSettings, deployModelSettings, undeployModelSettings, @@ -1139,32 +1151,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to deleteDataset. */ - public UnaryCallSettings.Builder deleteDatasetSettings() { - return deleteDatasetSettings; - } - - /** Returns the builder for the settings used for calls to deleteDataset. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteDatasetOperationSettings() { - return deleteDatasetOperationSettings; - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - public UnaryCallSettings.Builder deleteModelSettings() { - return deleteModelSettings; - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteModelOperationSettings() { - return deleteModelOperationSettings; - } - /** Returns the builder for the settings used for calls to createDataset. */ public UnaryCallSettings.Builder createDatasetSettings() { return createDatasetSettings; @@ -1195,6 +1181,19 @@ public UnaryCallSettings.Builder updateDatasetSet return updateDatasetSettings; } + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteDatasetOperationSettings() { + return deleteDatasetOperationSettings; + } + /** Returns the builder for the settings used for calls to importData. */ public UnaryCallSettings.Builder importDataSettings() { return importDataSettings; @@ -1251,6 +1250,19 @@ public UnaryCallSettings.Builder getModelSettings() { return listModelsSettings; } + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + /** Returns the builder for the settings used for calls to updateModel. */ public UnaryCallSettings.Builder updateModelSettings() { return updateModelSettings; diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java index 3a897b3da..18c205fe1 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/GrpcAutoMlStub.java @@ -75,22 +75,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcAutoMlStub extends AutoMlStub { - private static final MethodDescriptor - deleteDatasetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteDataset") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteModelMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteModel") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); private static final MethodDescriptor createDatasetMethodDescriptor = MethodDescriptor.newBuilder() @@ -125,6 +109,15 @@ public class GrpcAutoMlStub extends AutoMlStub { ProtoUtils.marshaller(UpdateDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor importDataMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -170,6 +163,13 @@ public class GrpcAutoMlStub extends AutoMlStub { .setRequestMarshaller(ProtoUtils.marshaller(ListModelsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListModelsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1.AutoMl/DeleteModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor updateModelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -223,12 +223,6 @@ public class GrpcAutoMlStub extends AutoMlStub { private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; - private final UnaryCallable deleteDatasetCallable; - private final OperationCallable - deleteDatasetOperationCallable; - private final UnaryCallable deleteModelCallable; - private final OperationCallable - deleteModelOperationCallable; private final UnaryCallable createDatasetCallable; private final OperationCallable createDatasetOperationCallable; @@ -237,6 +231,9 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable listDatasetsPagedCallable; private final UnaryCallable updateDatasetCallable; + private final UnaryCallable deleteDatasetCallable; + private final OperationCallable + deleteDatasetOperationCallable; private final UnaryCallable importDataCallable; private final OperationCallable importDataOperationCallable; @@ -250,6 +247,9 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable getModelCallable; private final UnaryCallable listModelsCallable; private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable deleteModelCallable; + private final OperationCallable + deleteModelOperationCallable; private final UnaryCallable updateModelCallable; private final UnaryCallable deployModelCallable; private final OperationCallable @@ -304,32 +304,6 @@ protected GrpcAutoMlStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings deleteDatasetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteDatasetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteDatasetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteModelTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteModelMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteModelRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); GrpcCallSettings createDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createDatasetMethodDescriptor) @@ -382,6 +356,19 @@ public Map extract(UpdateDatasetRequest request) { } }) .build(); + GrpcCallSettings deleteDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings importDataTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importDataMethodDescriptor) @@ -460,6 +447,19 @@ public Map extract(ListModelsRequest request) { } }) .build(); + GrpcCallSettings deleteModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings updateModelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateModelMethodDescriptor) @@ -541,24 +541,6 @@ public Map extract(ListModelEvaluationsRequest request) { }) .build(); - this.deleteDatasetCallable = - callableFactory.createUnaryCallable( - deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); - this.deleteDatasetOperationCallable = - callableFactory.createOperationCallable( - deleteDatasetTransportSettings, - settings.deleteDatasetOperationSettings(), - clientContext, - this.operationsStub); - this.deleteModelCallable = - callableFactory.createUnaryCallable( - deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); - this.deleteModelOperationCallable = - callableFactory.createOperationCallable( - deleteModelTransportSettings, - settings.deleteModelOperationSettings(), - clientContext, - this.operationsStub); this.createDatasetCallable = callableFactory.createUnaryCallable( createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); @@ -580,6 +562,15 @@ public Map extract(ListModelEvaluationsRequest request) { this.updateDatasetCallable = callableFactory.createUnaryCallable( updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); + this.deleteDatasetCallable = + callableFactory.createUnaryCallable( + deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); + this.deleteDatasetOperationCallable = + callableFactory.createOperationCallable( + deleteDatasetTransportSettings, + settings.deleteDatasetOperationSettings(), + clientContext, + this.operationsStub); this.importDataCallable = callableFactory.createUnaryCallable( importDataTransportSettings, settings.importDataSettings(), clientContext); @@ -621,6 +612,15 @@ public Map extract(ListModelEvaluationsRequest request) { this.listModelsPagedCallable = callableFactory.createPagedCallable( listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.deleteModelCallable = + callableFactory.createUnaryCallable( + deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); + this.deleteModelOperationCallable = + callableFactory.createOperationCallable( + deleteModelTransportSettings, + settings.deleteModelOperationSettings(), + clientContext, + this.operationsStub); this.updateModelCallable = callableFactory.createUnaryCallable( updateModelTransportSettings, settings.updateModelSettings(), clientContext); @@ -675,26 +675,6 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteDatasetOperationCallable() { - return deleteDatasetOperationCallable; - } - - public UnaryCallable deleteDatasetCallable() { - return deleteDatasetCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteModelOperationCallable() { - return deleteModelOperationCallable; - } - - public UnaryCallable deleteModelCallable() { - return deleteModelCallable; - } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createDatasetOperationCallable() { @@ -721,6 +701,16 @@ public UnaryCallable updateDatasetCallable() { return updateDatasetCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteDatasetOperationCallable() { + return deleteDatasetOperationCallable; + } + + public UnaryCallable deleteDatasetCallable() { + return deleteDatasetCallable; + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable importDataOperationCallable() { @@ -767,6 +757,16 @@ public UnaryCallable listModelsCallable() return listModelsCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + return deleteModelOperationCallable; + } + + public UnaryCallable deleteModelCallable() { + return deleteModelCallable; + } + public UnaryCallable updateModelCallable() { return updateModelCallable; } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java index f7886b9ae..314f0877a 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1/stub/PredictionServiceStubSettings.java @@ -200,11 +200,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -213,17 +210,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("default", settings); + definitions.put("no_retry_2_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -259,20 +255,20 @@ private static Builder initDefaults(Builder builder) { builder .predictSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .batchPredictSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .batchPredictOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(BatchPredictResult.class)) diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java index e0f3bbd73..8c2d66a54 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlClient.java @@ -184,440 +184,391 @@ public final OperationsClient getOperationsClient() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. + * Creates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   autoMlClient.deleteDatasetAsync(name).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = autoMlClient.createDataset(parent, dataset);
    * }
    * 
* - * @param name Required. The resource name of the dataset to delete. + * @param parent Required. The resource name of the project to create the dataset for. + * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync(DatasetName name) { - DeleteDatasetRequest request = - DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteDatasetAsync(request); + public final Dataset createDataset(LocationName parent, Dataset dataset) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDataset(dataset) + .build(); + return createDataset(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. + * Creates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   autoMlClient.deleteDatasetAsync(name.toString()).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = autoMlClient.createDataset(parent.toString(), dataset);
    * }
    * 
* - * @param name Required. The resource name of the dataset to delete. + * @param parent Required. The resource name of the project to create the dataset for. + * @param dataset Required. The dataset to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync(String name) { - DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); - return deleteDatasetAsync(request); + public final Dataset createDataset(String parent, Dataset dataset) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build(); + return createDataset(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. + * Creates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDataset(dataset)
    *     .build();
-   *   autoMlClient.deleteDatasetAsync(request).get();
+   *   Dataset response = autoMlClient.createDataset(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteDatasetAsync( - DeleteDatasetRequest request) { - return deleteDatasetOperationCallable().futureCall(request); + public final Dataset createDataset(CreateDatasetRequest request) { + return createDatasetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. + * Creates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setDataset(dataset)
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
+   *   ApiFuture<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   Dataset response = future.get();
    * }
    * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - deleteDatasetOperationCallable() { - return stub.deleteDatasetOperationCallable(); + public final UnaryCallable createDatasetCallable() { + return stub.createDatasetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a dataset and all of its contents. Returns empty response in the - * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` - * in the [metadata][google.longrunning.Operation.metadata] field. + * Gets a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   Dataset response = autoMlClient.getDataset(name);
    * }
    * 
+ * + * @param name Required. The resource name of the dataset to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable deleteDatasetCallable() { - return stub.deleteDatasetCallable(); + public final Dataset getDataset(DatasetName name) { + GetDatasetRequest request = + GetDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDataset(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. - * - *

For Tables: * A - * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be - * explicitly set. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Gets a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   InputConfig inputConfig = InputConfig.newBuilder().build();
-   *   autoMlClient.importDataAsync(name, inputConfig).get();
+   *   Dataset response = autoMlClient.getDataset(name.toString());
    * }
    * 
* - * @param name Required. Dataset name. Dataset must already exist. All imported annotations and - * examples will be added. - * @param inputConfig Required. The desired input location and its domain specific semantics, if - * any. + * @param name Required. The resource name of the dataset to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture importDataAsync( - DatasetName name, InputConfig inputConfig) { - ImportDataRequest request = - ImportDataRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setInputConfig(inputConfig) - .build(); - return importDataAsync(request); + public final Dataset getDataset(String name) { + GetDatasetRequest request = GetDatasetRequest.newBuilder().setName(name).build(); + return getDataset(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. - * - *

For Tables: * A - * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be - * explicitly set. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Gets a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   InputConfig inputConfig = InputConfig.newBuilder().build();
-   *   autoMlClient.importDataAsync(name.toString(), inputConfig).get();
+   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Dataset response = autoMlClient.getDataset(request);
    * }
    * 
* - * @param name Required. Dataset name. Dataset must already exist. All imported annotations and - * examples will be added. - * @param inputConfig Required. The desired input location and its domain specific semantics, if - * any. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture importDataAsync( - String name, InputConfig inputConfig) { - ImportDataRequest request = - ImportDataRequest.newBuilder().setName(name).setInputConfig(inputConfig).build(); - return importDataAsync(request); + public final Dataset getDataset(GetDatasetRequest request) { + return getDatasetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. - * - *

For Tables: * A - * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be - * explicitly set. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Gets a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   InputConfig inputConfig = InputConfig.newBuilder().build();
-   *   ImportDataRequest request = ImportDataRequest.newBuilder()
+   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setInputConfig(inputConfig)
    *     .build();
-   *   autoMlClient.importDataAsync(request).get();
+   *   ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
+   *   // Do something
+   *   Dataset response = future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture importDataAsync( - ImportDataRequest request) { - return importDataOperationCallable().futureCall(request); + public final UnaryCallable getDatasetCallable() { + return stub.getDatasetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. - * - *

For Tables: * A - * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be - * explicitly set. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Lists datasets in a project. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   InputConfig inputConfig = InputConfig.newBuilder().build();
-   *   ImportDataRequest request = ImportDataRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setInputConfig(inputConfig)
-   *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.importDataOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param parent Required. The resource name of the project from which to list datasets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - importDataOperationCallable() { - return stub.importDataOperationCallable(); + public final ListDatasetsPagedResponse listDatasets(LocationName parent) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDatasets(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. - * - *

For Tables: * A - * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be - * explicitly set. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Lists datasets in a project. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   InputConfig inputConfig = InputConfig.newBuilder().build();
-   *   ImportDataRequest request = ImportDataRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setInputConfig(inputConfig)
-   *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Dataset element : autoMlClient.listDatasets(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param parent Required. The resource name of the project from which to list datasets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable importDataCallable() { - return stub.importDataCallable(); + public final ListDatasetsPagedResponse listDatasets(String parent) { + ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build(); + return listDatasets(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports dataset's data to the provided output location. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Lists datasets in a project. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   autoMlClient.exportDataAsync(name, outputConfig).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Dataset element : autoMlClient.listDatasets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the dataset. - * @param outputConfig Required. The desired output location. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportDataAsync( - DatasetName name, OutputConfig outputConfig) { - ExportDataRequest request = - ExportDataRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setOutputConfig(outputConfig) - .build(); - return exportDataAsync(request); + public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) { + return listDatasetsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports dataset's data to the provided output location. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Lists datasets in a project. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   autoMlClient.exportDataAsync(name.toString(), outputConfig).get();
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
- * - * @param name Required. The resource name of the dataset. - * @param outputConfig Required. The desired output location. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportDataAsync( - String name, OutputConfig outputConfig) { - ExportDataRequest request = - ExportDataRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); - return exportDataAsync(request); + public final UnaryCallable + listDatasetsPagedCallable() { + return stub.listDatasetsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports dataset's data to the provided output location. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Lists datasets in a project. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportDataRequest request = ExportDataRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   autoMlClient.exportDataAsync(request).get();
+   *   while (true) {
+   *     ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
+   *     for (Dataset element : response.getDatasetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listDatasetsCallable() { + return stub.listDatasetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a dataset. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = autoMlClient.updateDataset(dataset);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param dataset Required. The dataset which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportDataAsync( - ExportDataRequest request) { - return exportDataOperationCallable().futureCall(request); + public final Dataset updateDataset(Dataset dataset) { + UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder().setDataset(dataset).build(); + return updateDataset(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports dataset's data to the provided output location. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Updates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportDataRequest request = ExportDataRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportDataOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   Dataset response = autoMlClient.updateDataset(request);
    * }
    * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - exportDataOperationCallable() { - return stub.exportDataOperationCallable(); + public final Dataset updateDataset(UpdateDatasetRequest request) { + return updateDatasetCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports dataset's data to the provided output location. Returns an empty response in the - * [response][google.longrunning.Operation.response] field when it completes. + * Updates a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
-   *   ExportDataRequest request = ExportDataRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
+   *     .setDataset(dataset)
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
+   *   ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   Dataset response = future.get();
    * }
    * 
*/ - public final UnaryCallable exportDataCallable() { - return stub.exportDataCallable(); + public final UnaryCallable updateDatasetCallable() { + return stub.updateDatasetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a model. Returns `google.protobuf.Empty` in the + * Deletes a dataset and all of its contents. Returns empty response in the * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` * in the [metadata][google.longrunning.Operation.metadata] field. * @@ -625,25 +576,25 @@ public final UnaryCallable exportDataCallable() { * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deleteModelAsync(name).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name).get();
    * }
    * 
* - * @param name Required. Resource name of the model being deleted. + * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync(ModelName name) { - DeleteModelRequest request = - DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deleteModelAsync(request); + public final OperationFuture deleteDatasetAsync(DatasetName name) { + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteDatasetAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a model. Returns `google.protobuf.Empty` in the + * Deletes a dataset and all of its contents. Returns empty response in the * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` * in the [metadata][google.longrunning.Operation.metadata] field. * @@ -651,24 +602,24 @@ public final OperationFuture deleteModelAsync(ModelNam * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deleteModelAsync(name.toString()).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   autoMlClient.deleteDatasetAsync(name.toString()).get();
    * }
    * 
* - * @param name Required. Resource name of the model being deleted. + * @param name Required. The resource name of the dataset to delete. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync(String name) { - DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); - return deleteModelAsync(request); + public final OperationFuture deleteDatasetAsync(String name) { + DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); + return deleteDatasetAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a model. Returns `google.protobuf.Empty` in the + * Deletes a dataset and all of its contents. Returns empty response in the * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` * in the [metadata][google.longrunning.Operation.metadata] field. * @@ -676,11 +627,11 @@ public final OperationFuture deleteModelAsync(String n * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   autoMlClient.deleteModelAsync(request).get();
+   *   autoMlClient.deleteDatasetAsync(request).get();
    * }
    * 
* @@ -689,14 +640,14 @@ public final OperationFuture deleteModelAsync(String n */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deleteModelAsync( - DeleteModelRequest request) { - return deleteModelOperationCallable().futureCall(request); + public final OperationFuture deleteDatasetAsync( + DeleteDatasetRequest request) { + return deleteDatasetOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a model. Returns `google.protobuf.Empty` in the + * Deletes a dataset and all of its contents. Returns empty response in the * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` * in the [metadata][google.longrunning.Operation.metadata] field. * @@ -704,25 +655,25 @@ public final OperationFuture deleteModelAsync( * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - deleteModelOperationCallable() { - return stub.deleteModelOperationCallable(); + public final OperationCallable + deleteDatasetOperationCallable() { + return stub.deleteDatasetOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a model. Returns `google.protobuf.Empty` in the + * Deletes a dataset and all of its contents. Returns empty response in the * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` * in the [metadata][google.longrunning.Operation.metadata] field. * @@ -730,110 +681,111 @@ public final OperationFuture deleteModelAsync( * *

    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable deleteModelCallable() { - return stub.deleteModelCallable(); + public final UnaryCallable deleteDatasetCallable() { + return stub.deleteDatasetCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A - * model is considered export-able if and only if it has an export format defined for it in - * - *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + *

For Tables: * A + * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be + * explicitly set. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
-   *   autoMlClient.exportModelAsync(name, outputConfig).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   autoMlClient.importDataAsync(name, inputConfig).get();
    * }
    * 
* - * @param name Required. The resource name of the model to export. - * @param outputConfig Required. The desired output location and configuration. + * @param name Required. Dataset name. Dataset must already exist. All imported annotations and + * examples will be added. + * @param inputConfig Required. The desired input location and its domain specific semantics, if + * any. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportModelAsync( - ModelName name, ModelExportOutputConfig outputConfig) { - ExportModelRequest request = - ExportModelRequest.newBuilder() + public final OperationFuture importDataAsync( + DatasetName name, InputConfig inputConfig) { + ImportDataRequest request = + ImportDataRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setOutputConfig(outputConfig) + .setInputConfig(inputConfig) .build(); - return exportModelAsync(request); + return importDataAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A - * model is considered export-able if and only if it has an export format defined for it in - * - *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + *

For Tables: * A + * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be + * explicitly set. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
-   *   autoMlClient.exportModelAsync(name.toString(), outputConfig).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   autoMlClient.importDataAsync(name.toString(), inputConfig).get();
    * }
    * 
* - * @param name Required. The resource name of the model to export. - * @param outputConfig Required. The desired output location and configuration. + * @param name Required. Dataset name. Dataset must already exist. All imported annotations and + * examples will be added. + * @param inputConfig Required. The desired input location and its domain specific semantics, if + * any. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportModelAsync( - String name, ModelExportOutputConfig outputConfig) { - ExportModelRequest request = - ExportModelRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); - return exportModelAsync(request); + public final OperationFuture importDataAsync( + String name, InputConfig inputConfig) { + ImportDataRequest request = + ImportDataRequest.newBuilder().setName(name).setInputConfig(inputConfig).build(); + return importDataAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A - * model is considered export-able if and only if it has an export format defined for it in - * - *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + *

For Tables: * A + * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be + * explicitly set. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
-   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *     .setInputConfig(inputConfig)
    *     .build();
-   *   autoMlClient.exportModelAsync(request).get();
+   *   autoMlClient.importDataAsync(request).get();
    * }
    * 
* @@ -842,180 +794,146 @@ public final OperationFuture exportModelAsync( */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportModelAsync( - ExportModelRequest request) { - return exportModelOperationCallable().futureCall(request); + public final OperationFuture importDataAsync( + ImportDataRequest request) { + return importDataOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A - * model is considered export-able if and only if it has an export format defined for it in - * - *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + *

For Tables: * A + * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be + * explicitly set. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
-   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *     .setInputConfig(inputConfig)
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.importDataOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - exportModelOperationCallable() { - return stub.exportModelOperationCallable(); + public final OperationCallable + importDataOperationCallable() { + return stub.importDataOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A - * model is considered export-able if and only if it has an export format defined for it in - * - *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * Imports data into a dataset. For Tables this method can only be called on an empty Dataset. * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + *

For Tables: * A + * [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be + * explicitly set. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
-   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataRequest request = ImportDataRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setOutputConfig(outputConfig)
+   *     .setInputConfig(inputConfig)
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable exportModelCallable() { - return stub.exportModelCallable(); + public final UnaryCallable importDataCallable() { + return stub.importDataCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the - * dataset the model was created from), together with their ground truth annotations and the - * annotations created (predicted) by the model. The examples, ground truth and predictions are - * exported in the state they were at the moment the model was evaluated. - * - *

This export is available only for 30 days since the model evaluation is created. - * - *

Currently only available for Tables. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
-   *   autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   autoMlClient.exportDataAsync(name, outputConfig).get();
    * }
    * 
* - * @param name Required. The resource name of the model whose evaluated examples are to be - * exported. - * @param outputConfig Required. The desired output location and configuration. + * @param name Required. The resource name of the dataset. + * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportEvaluatedExamplesAsync( - ModelName name, ExportEvaluatedExamplesOutputConfig outputConfig) { - ExportEvaluatedExamplesRequest request = - ExportEvaluatedExamplesRequest.newBuilder() + public final OperationFuture exportDataAsync( + DatasetName name, OutputConfig outputConfig) { + ExportDataRequest request = + ExportDataRequest.newBuilder() .setName(name == null ? null : name.toString()) .setOutputConfig(outputConfig) .build(); - return exportEvaluatedExamplesAsync(request); + return exportDataAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the - * dataset the model was created from), together with their ground truth annotations and the - * annotations created (predicted) by the model. The examples, ground truth and predictions are - * exported in the state they were at the moment the model was evaluated. - * - *

This export is available only for 30 days since the model evaluation is created. - * - *

Currently only available for Tables. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
-   *   autoMlClient.exportEvaluatedExamplesAsync(name.toString(), outputConfig).get();
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   autoMlClient.exportDataAsync(name.toString(), outputConfig).get();
    * }
    * 
* - * @param name Required. The resource name of the model whose evaluated examples are to be - * exported. - * @param outputConfig Required. The desired output location and configuration. + * @param name Required. The resource name of the dataset. + * @param outputConfig Required. The desired output location. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportEvaluatedExamplesAsync( - String name, ExportEvaluatedExamplesOutputConfig outputConfig) { - ExportEvaluatedExamplesRequest request = - ExportEvaluatedExamplesRequest.newBuilder() - .setName(name) - .setOutputConfig(outputConfig) - .build(); - return exportEvaluatedExamplesAsync(request); + public final OperationFuture exportDataAsync( + String name, OutputConfig outputConfig) { + ExportDataRequest request = + ExportDataRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); + return exportDataAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the - * dataset the model was created from), together with their ground truth annotations and the - * annotations created (predicted) by the model. The examples, ground truth and predictions are - * exported in the state they were at the moment the model was evaluated. - * - *

This export is available only for 30 days since the model evaluation is created. - * - *

Currently only available for Tables. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
-   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
    *     .setName(name.toString())
    *     .setOutputConfig(outputConfig)
    *     .build();
-   *   autoMlClient.exportEvaluatedExamplesAsync(request).get();
+   *   autoMlClient.exportDataAsync(request).get();
    * }
    * 
* @@ -1024,1343 +942,1304 @@ public final OperationFuture exportEvaluatedExamplesAs */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture exportEvaluatedExamplesAsync( - ExportEvaluatedExamplesRequest request) { - return exportEvaluatedExamplesOperationCallable().futureCall(request); + public final OperationFuture exportDataAsync( + ExportDataRequest request) { + return exportDataOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the - * dataset the model was created from), together with their ground truth annotations and the - * annotations created (predicted) by the model. The examples, ground truth and predictions are - * exported in the state they were at the moment the model was evaluated. - * - *

This export is available only for 30 days since the model evaluation is created. - * - *

Currently only available for Tables. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
-   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
    *     .setName(name.toString())
    *     .setOutputConfig(outputConfig)
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportDataOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - exportEvaluatedExamplesOperationCallable() { - return stub.exportEvaluatedExamplesOperationCallable(); + public final OperationCallable + exportDataOperationCallable() { + return stub.exportDataOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the - * dataset the model was created from), together with their ground truth annotations and the - * annotations created (predicted) by the model. The examples, ground truth and predictions are - * exported in the state they were at the moment the model was evaluated. - * - *

This export is available only for 30 days since the model evaluation is created. - * - *

Currently only available for Tables. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Exports dataset's data to the provided output location. Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
-   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataRequest request = ExportDataRequest.newBuilder()
    *     .setName(name.toString())
    *     .setOutputConfig(outputConfig)
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.exportEvaluatedExamplesCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable - exportEvaluatedExamplesCallable() { - return stub.exportEvaluatedExamplesCallable(); - } + public final UnaryCallable exportDataCallable() { + return stub.exportDataCallable(); + } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists model evaluations. + * Gets an annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
    * }
    * 
* - * @param parent Required. Resource name of the model to list the model evaluations for. If - * modelId is set as "-", this will list model evaluations from across all models of the - * parent location. + * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent) { - ListModelEvaluationsRequest request = - ListModelEvaluationsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { + GetAnnotationSpecRequest request = + GetAnnotationSpecRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return listModelEvaluations(request); + return getAnnotationSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists model evaluations. + * Gets an annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name.toString());
    * }
    * 
* - * @param parent Required. Resource name of the model to list the model evaluations for. If - * modelId is set as "-", this will list model evaluations from across all models of the - * parent location. + * @param name Required. The resource name of the annotation spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelEvaluationsPagedResponse listModelEvaluations(String parent) { - ListModelEvaluationsRequest request = - ListModelEvaluationsRequest.newBuilder().setParent(parent).build(); - return listModelEvaluations(request); + public final AnnotationSpec getAnnotationSpec(String name) { + GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder().setName(name).build(); + return getAnnotationSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists model evaluations. + * Gets an annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelEvaluationsPagedResponse listModelEvaluations( - ListModelEvaluationsRequest request) { - return listModelEvaluationsPagedCallable().call(request); + public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) { + return getAnnotationSpecCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists model evaluations. + * Gets an annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
+   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
+   *   ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request);
    *   // Do something
-   *   for (ModelEvaluation element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable - listModelEvaluationsPagedCallable() { - return stub.listModelEvaluationsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists model evaluations. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListModelEvaluationsResponse response = autoMlClient.listModelEvaluationsCallable().call(request);
-   *     for (ModelEvaluation element : response.getModelEvaluationList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   AnnotationSpec response = future.get();
    * }
    * 
*/ - public final UnaryCallable - listModelEvaluationsCallable() { - return stub.listModelEvaluationsCallable(); + public final UnaryCallable getAnnotationSpecCallable() { + return stub.getAnnotationSpecCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a dataset. + * Gets a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   Dataset response = autoMlClient.createDataset(parent, dataset);
+   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   TableSpec response = autoMlClient.getTableSpec(name);
    * }
    * 
* - * @param parent Required. The resource name of the project to create the dataset for. - * @param dataset Required. The dataset to create. + * @param name Required. The resource name of the table spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset createDataset(LocationName parent, Dataset dataset) { - CreateDatasetRequest request = - CreateDatasetRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setDataset(dataset) - .build(); - return createDataset(request); + public final TableSpec getTableSpec(TableSpecName name) { + GetTableSpecRequest request = + GetTableSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTableSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a dataset. + * Gets a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   Dataset response = autoMlClient.createDataset(parent.toString(), dataset);
+   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   TableSpec response = autoMlClient.getTableSpec(name.toString());
    * }
    * 
* - * @param parent Required. The resource name of the project to create the dataset for. - * @param dataset Required. The dataset to create. + * @param name Required. The resource name of the table spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset createDataset(String parent, Dataset dataset) { - CreateDatasetRequest request = - CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build(); - return createDataset(request); + public final TableSpec getTableSpec(String name) { + GetTableSpecRequest request = GetTableSpecRequest.newBuilder().setName(name).build(); + return getTableSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a dataset. + * Gets a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setDataset(dataset)
+   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   Dataset response = autoMlClient.createDataset(request);
+   *   TableSpec response = autoMlClient.getTableSpec(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset createDataset(CreateDatasetRequest request) { - return createDatasetCallable().call(request); + public final TableSpec getTableSpec(GetTableSpecRequest request) { + return getTableSpecCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a dataset. + * Gets a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setDataset(dataset)
+   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
+   *   ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request);
    *   // Do something
-   *   Dataset response = future.get();
+   *   TableSpec response = future.get();
    * }
    * 
*/ - public final UnaryCallable createDatasetCallable() { - return stub.createDatasetCallable(); + public final UnaryCallable getTableSpecCallable() { + return stub.getTableSpecCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a dataset. + * Lists table specs in a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   Dataset response = autoMlClient.getDataset(name);
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the dataset to retrieve. + * @param parent Required. The resource name of the dataset to list table specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset getDataset(DatasetName name) { - GetDatasetRequest request = - GetDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getDataset(request); + public final ListTableSpecsPagedResponse listTableSpecs(DatasetName parent) { + ListTableSpecsRequest request = + ListTableSpecsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTableSpecs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a dataset. + * Lists table specs in a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   Dataset response = autoMlClient.getDataset(name.toString());
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   for (TableSpec element : autoMlClient.listTableSpecs(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the dataset to retrieve. + * @param parent Required. The resource name of the dataset to list table specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset getDataset(String name) { - GetDatasetRequest request = GetDatasetRequest.newBuilder().setName(name).build(); - return getDataset(request); + public final ListTableSpecsPagedResponse listTableSpecs(String parent) { + ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder().setParent(parent).build(); + return listTableSpecs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a dataset. + * Lists table specs in a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   Dataset response = autoMlClient.getDataset(request);
+   *   for (TableSpec element : autoMlClient.listTableSpecs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset getDataset(GetDatasetRequest request) { - return getDatasetCallable().call(request); + public final ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest request) { + return listTableSpecsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a dataset. + * Lists table specs in a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   GetDatasetRequest request = GetDatasetRequest.newBuilder()
-   *     .setName(name.toString())
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
+   *   ApiFuture<ListTableSpecsPagedResponse> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request);
    *   // Do something
-   *   Dataset response = future.get();
+   *   for (TableSpec element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
*/ - public final UnaryCallable getDatasetCallable() { - return stub.getDatasetCallable(); + public final UnaryCallable + listTableSpecsPagedCallable() { + return stub.listTableSpecsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Lists table specs in a dataset. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) {
-   *     // doThingsWith(element);
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListTableSpecsResponse response = autoMlClient.listTableSpecsCallable().call(request);
+   *     for (TableSpec element : response.getTableSpecsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
    *   }
    * }
    * 
- * - * @param parent Required. The resource name of the project from which to list datasets. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListDatasetsPagedResponse listDatasets(LocationName parent) { - ListDatasetsRequest request = - ListDatasetsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listDatasets(request); + public final UnaryCallable + listTableSpecsCallable() { + return stub.listTableSpecsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Updates a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Dataset element : autoMlClient.listDatasets(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   TableSpec tableSpec = TableSpec.newBuilder().build();
+   *   TableSpec response = autoMlClient.updateTableSpec(tableSpec);
    * }
    * 
* - * @param parent Required. The resource name of the project from which to list datasets. + * @param tableSpec Required. The table spec which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListDatasetsPagedResponse listDatasets(String parent) { - ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build(); - return listDatasets(request); + public final TableSpec updateTableSpec(TableSpec tableSpec) { + UpdateTableSpecRequest request = + UpdateTableSpecRequest.newBuilder().setTableSpec(tableSpec).build(); + return updateTableSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Updates a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   TableSpec tableSpec = TableSpec.newBuilder().build();
+   *   UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
+   *     .setTableSpec(tableSpec)
    *     .build();
-   *   for (Dataset element : autoMlClient.listDatasets(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   TableSpec response = autoMlClient.updateTableSpec(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) { - return listDatasetsPagedCallable().call(request); + public final TableSpec updateTableSpec(UpdateTableSpecRequest request) { + return updateTableSpecCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Updates a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   TableSpec tableSpec = TableSpec.newBuilder().build();
+   *   UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
+   *     .setTableSpec(tableSpec)
    *     .build();
-   *   ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
+   *   ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request);
    *   // Do something
-   *   for (Dataset element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   TableSpec response = future.get();
    * }
    * 
*/ - public final UnaryCallable - listDatasetsPagedCallable() { - return stub.listDatasetsPagedCallable(); + public final UnaryCallable updateTableSpecCallable() { + return stub.updateTableSpecCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists datasets in a project. + * Gets a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request);
-   *     for (Dataset element : response.getDatasetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
+   *   ColumnSpec response = autoMlClient.getColumnSpec(name);
    * }
    * 
+ * + * @param name Required. The resource name of the column spec to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable listDatasetsCallable() { - return stub.listDatasetsCallable(); + public final ColumnSpec getColumnSpec(ColumnSpecName name) { + GetColumnSpecRequest request = + GetColumnSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getColumnSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Gets a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   Dataset response = autoMlClient.updateDataset(dataset);
+   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
+   *   ColumnSpec response = autoMlClient.getColumnSpec(name.toString());
    * }
    * 
* - * @param dataset Required. The dataset which replaces the resource on the server. + * @param name Required. The resource name of the column spec to retrieve. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset updateDataset(Dataset dataset) { - UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder().setDataset(dataset).build(); - return updateDataset(request); + public final ColumnSpec getColumnSpec(String name) { + GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder().setName(name).build(); + return getColumnSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Gets a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
-   *     .setDataset(dataset)
+   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
+   *   GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   Dataset response = autoMlClient.updateDataset(request);
+   *   ColumnSpec response = autoMlClient.getColumnSpec(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Dataset updateDataset(UpdateDatasetRequest request) { - return updateDatasetCallable().call(request); + public final ColumnSpec getColumnSpec(GetColumnSpecRequest request) { + return getColumnSpecCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a dataset. + * Gets a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   Dataset dataset = Dataset.newBuilder().build();
-   *   UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
-   *     .setDataset(dataset)
+   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
+   *   GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
+   *   ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request);
    *   // Do something
-   *   Dataset response = future.get();
+   *   ColumnSpec response = future.get();
    * }
    * 
*/ - public final UnaryCallable updateDatasetCallable() { - return stub.updateDatasetCallable(); + public final UnaryCallable getColumnSpecCallable() { + return stub.getColumnSpecCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets an annotation spec. + * Lists column specs in a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
-   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
+   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the annotation spec to retrieve. + * @param parent Required. The resource name of the table spec to list column specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { - GetAnnotationSpecRequest request = - GetAnnotationSpecRequest.newBuilder() - .setName(name == null ? null : name.toString()) + public final ListColumnSpecsPagedResponse listColumnSpecs(TableSpecName parent) { + ListColumnSpecsRequest request = + ListColumnSpecsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .build(); - return getAnnotationSpec(request); + return listColumnSpecs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets an annotation spec. + * Lists column specs in a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
-   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(name.toString());
+   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the annotation spec to retrieve. + * @param parent Required. The resource name of the table spec to list column specs from. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final AnnotationSpec getAnnotationSpec(String name) { - GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder().setName(name).build(); - return getAnnotationSpec(request); + public final ListColumnSpecsPagedResponse listColumnSpecs(String parent) { + ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder().setParent(parent).build(); + return listColumnSpecs(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets an annotation spec. + * Lists column specs in a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
-   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
-   *     .setName(name.toString())
+   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   AnnotationSpec response = autoMlClient.getAnnotationSpec(request);
+   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) { - return getAnnotationSpecCallable().call(request); + public final ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest request) { + return listColumnSpecsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets an annotation spec. + * Lists column specs in a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
-   *   GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
-   *     .setName(name.toString())
+   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request);
+   *   ApiFuture<ListColumnSpecsPagedResponse> future = autoMlClient.listColumnSpecsPagedCallable().futureCall(request);
    *   // Do something
-   *   AnnotationSpec response = future.get();
+   *   for (ColumnSpec element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
*/ - public final UnaryCallable getAnnotationSpecCallable() { - return stub.getAnnotationSpecCallable(); + public final UnaryCallable + listColumnSpecsPagedCallable() { + return stub.listColumnSpecsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a table spec. + * Lists column specs in a table spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   TableSpec response = autoMlClient.getTableSpec(name);
+   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
+   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListColumnSpecsResponse response = autoMlClient.listColumnSpecsCallable().call(request);
+   *     for (ColumnSpec element : response.getColumnSpecsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
- * - * @param name Required. The resource name of the table spec to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TableSpec getTableSpec(TableSpecName name) { - GetTableSpecRequest request = - GetTableSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getTableSpec(request); - } - + public final UnaryCallable + listColumnSpecsCallable() { + return stub.listColumnSpecsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a table spec. + * Updates a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   TableSpec response = autoMlClient.getTableSpec(name.toString());
+   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
+   *   ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec);
    * }
    * 
* - * @param name Required. The resource name of the table spec to retrieve. + * @param columnSpec Required. The column spec which replaces the resource on the server. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TableSpec getTableSpec(String name) { - GetTableSpecRequest request = GetTableSpecRequest.newBuilder().setName(name).build(); - return getTableSpec(request); + public final ColumnSpec updateColumnSpec(ColumnSpec columnSpec) { + UpdateColumnSpecRequest request = + UpdateColumnSpecRequest.newBuilder().setColumnSpec(columnSpec).build(); + return updateColumnSpec(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a table spec. + * Updates a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
+   *   UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
+   *     .setColumnSpec(columnSpec)
    *     .build();
-   *   TableSpec response = autoMlClient.getTableSpec(request);
+   *   ColumnSpec response = autoMlClient.updateColumnSpec(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TableSpec getTableSpec(GetTableSpecRequest request) { - return getTableSpecCallable().call(request); + public final ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request) { + return updateColumnSpecCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a table spec. + * Updates a column spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
+   *   UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
+   *     .setColumnSpec(columnSpec)
    *     .build();
-   *   ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request);
+   *   ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request);
    *   // Do something
-   *   TableSpec response = future.get();
+   *   ColumnSpec response = future.get();
    * }
    * 
*/ - public final UnaryCallable getTableSpecCallable() { - return stub.getTableSpecCallable(); + public final UnaryCallable updateColumnSpecCallable() { + return stub.updateColumnSpecCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists table specs in a dataset. + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   Model response = autoMlClient.createModelAsync(parent, model).get();
    * }
    * 
* - * @param parent Required. The resource name of the dataset to list table specs from. + * @param parent Required. Resource name of the parent project where the model is being created. + * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListTableSpecsPagedResponse listTableSpecs(DatasetName parent) { - ListTableSpecsRequest request = - ListTableSpecsRequest.newBuilder() + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createModelAsync( + LocationName parent, Model model) { + CreateModelRequest request = + CreateModelRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) + .setModel(model) .build(); - return listTableSpecs(request); + return createModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists table specs in a dataset. + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   for (TableSpec element : autoMlClient.listTableSpecs(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   Model response = autoMlClient.createModelAsync(parent.toString(), model).get();
    * }
    * 
* - * @param parent Required. The resource name of the dataset to list table specs from. + * @param parent Required. Resource name of the parent project where the model is being created. + * @param model Required. The model to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListTableSpecsPagedResponse listTableSpecs(String parent) { - ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder().setParent(parent).build(); - return listTableSpecs(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createModelAsync( + String parent, Model model) { + CreateModelRequest request = + CreateModelRequest.newBuilder().setParent(parent).setModel(model).build(); + return createModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists table specs in a dataset. + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
    *     .setParent(parent.toString())
+   *     .setModel(model)
    *     .build();
-   *   for (TableSpec element : autoMlClient.listTableSpecs(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   Model response = autoMlClient.createModelAsync(request).get();
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest request) { - return listTableSpecsPagedCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createModelAsync( + CreateModelRequest request) { + return createModelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists table specs in a dataset. + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
    *     .setParent(parent.toString())
+   *     .setModel(model)
    *     .build();
-   *   ApiFuture<ListTableSpecsPagedResponse> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request);
+   *   OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request);
    *   // Do something
-   *   for (TableSpec element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   Model response = future.get();
    * }
    * 
*/ - public final UnaryCallable - listTableSpecsPagedCallable() { - return stub.listTableSpecsPagedCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createModelOperationCallable() { + return stub.createModelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists table specs in a dataset. + * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field + * when it completes. When you create a model, several model evaluations are created for it: a + * global evaluation, and one evaluation for each annotation spec. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
-   *   ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Model model = Model.newBuilder().build();
+   *   CreateModelRequest request = CreateModelRequest.newBuilder()
    *     .setParent(parent.toString())
+   *     .setModel(model)
    *     .build();
-   *   while (true) {
-   *     ListTableSpecsResponse response = autoMlClient.listTableSpecsCallable().call(request);
-   *     for (TableSpec element : response.getTableSpecsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
    * }
    * 
*/ - public final UnaryCallable - listTableSpecsCallable() { - return stub.listTableSpecsCallable(); + public final UnaryCallable createModelCallable() { + return stub.createModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a table spec. + * Gets a model. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpec tableSpec = TableSpec.newBuilder().build();
-   *   TableSpec response = autoMlClient.updateTableSpec(tableSpec);
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Model response = autoMlClient.getModel(name);
    * }
    * 
* - * @param tableSpec Required. The table spec which replaces the resource on the server. + * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TableSpec updateTableSpec(TableSpec tableSpec) { - UpdateTableSpecRequest request = - UpdateTableSpecRequest.newBuilder().setTableSpec(tableSpec).build(); - return updateTableSpec(request); + public final Model getModel(ModelName name) { + GetModelRequest request = + GetModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getModel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a table spec. + * Gets a model. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpec tableSpec = TableSpec.newBuilder().build();
-   *   UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
-   *     .setTableSpec(tableSpec)
-   *     .build();
-   *   TableSpec response = autoMlClient.updateTableSpec(request);
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   Model response = autoMlClient.getModel(name.toString());
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name Required. Resource name of the model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TableSpec updateTableSpec(UpdateTableSpecRequest request) { - return updateTableSpecCallable().call(request); + public final Model getModel(String name) { + GetModelRequest request = GetModelRequest.newBuilder().setName(name).build(); + return getModel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a table spec. + * Gets a model. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpec tableSpec = TableSpec.newBuilder().build();
-   *   UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
-   *     .setTableSpec(tableSpec)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request);
-   *   // Do something
-   *   TableSpec response = future.get();
+   *   Model response = autoMlClient.getModel(request);
    * }
    * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable updateTableSpecCallable() { - return stub.updateTableSpecCallable(); + public final Model getModel(GetModelRequest request) { + return getModelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a column spec. + * Gets a model. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
-   *   ColumnSpec response = autoMlClient.getColumnSpec(name);
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request);
+   *   // Do something
+   *   Model response = future.get();
    * }
    * 
- * - * @param name Required. The resource name of the column spec to retrieve. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ColumnSpec getColumnSpec(ColumnSpecName name) { - GetColumnSpecRequest request = - GetColumnSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getColumnSpec(request); + public final UnaryCallable getModelCallable() { + return stub.getModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a column spec. + * Lists models. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
-   *   ColumnSpec response = autoMlClient.getColumnSpec(name.toString());
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Model element : autoMlClient.listModels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. The resource name of the column spec to retrieve. + * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ColumnSpec getColumnSpec(String name) { - GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder().setName(name).build(); - return getColumnSpec(request); + public final ListModelsPagedResponse listModels(LocationName parent) { + ListModelsRequest request = + ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listModels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a column spec. + * Lists models. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
-   *   GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ColumnSpec response = autoMlClient.getColumnSpec(request);
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Model element : autoMlClient.listModels(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param parent Required. Resource name of the project, from which to list the models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ColumnSpec getColumnSpec(GetColumnSpecRequest request) { - return getColumnSpecCallable().call(request); + public final ListModelsPagedResponse listModels(String parent) { + ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build(); + return listModels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a column spec. + * Lists models. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
-   *   GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder()
-   *     .setName(name.toString())
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request);
-   *   // Do something
-   *   ColumnSpec response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable getColumnSpecCallable() { - return stub.getColumnSpecCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists column specs in a table spec. - * - *

Sample code: - * - *


-   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).iterateAll()) {
+   *   for (Model element : autoMlClient.listModels(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param parent Required. The resource name of the table spec to list column specs from. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListColumnSpecsPagedResponse listColumnSpecs(TableSpecName parent) { - ListColumnSpecsRequest request = - ListColumnSpecsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listColumnSpecs(request); + public final ListModelsPagedResponse listModels(ListModelsRequest request) { + return listModelsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists column specs in a table spec. + * Lists models. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(parent.toString()).iterateAll()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListModelsPagedResponse> future = autoMlClient.listModelsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Model element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
- * - * @param parent Required. The resource name of the table spec to list column specs from. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListColumnSpecsPagedResponse listColumnSpecs(String parent) { - ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder().setParent(parent).build(); - return listColumnSpecs(request); + public final UnaryCallable listModelsPagedCallable() { + return stub.listModelsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists column specs in a table spec. + * Lists models. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListModelsRequest request = ListModelsRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
-   *   for (ColumnSpec element : autoMlClient.listColumnSpecs(request).iterateAll()) {
-   *     // doThingsWith(element);
+   *   while (true) {
+   *     ListModelsResponse response = autoMlClient.listModelsCallable().call(request);
+   *     for (Model element : response.getModelList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
    *   }
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest request) { - return listColumnSpecsPagedCallable().call(request); + public final UnaryCallable listModelsCallable() { + return stub.listModelsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists column specs in a table spec. + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListColumnSpecsPagedResponse> future = autoMlClient.listColumnSpecsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (ColumnSpec element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name).get();
    * }
    * 
+ * + * @param name Required. Resource name of the model being deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable - listColumnSpecsPagedCallable() { - return stub.listColumnSpecsPagedCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync(ModelName name) { + DeleteModelRequest request = + DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists column specs in a table spec. + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
-   *   ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListColumnSpecsResponse response = autoMlClient.listColumnSpecsCallable().call(request);
-   *     for (ColumnSpec element : response.getColumnSpecsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deleteModelAsync(name.toString()).get();
    * }
    * 
+ * + * @param name Required. Resource name of the model being deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable - listColumnSpecsCallable() { - return stub.listColumnSpecsCallable(); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync(String name) { + DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); + return deleteModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a column spec. + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
-   *   ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec);
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.deleteModelAsync(request).get();
    * }
    * 
* - * @param columnSpec Required. The column spec which replaces the resource on the server. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ColumnSpec updateColumnSpec(ColumnSpec columnSpec) { - UpdateColumnSpecRequest request = - UpdateColumnSpecRequest.newBuilder().setColumnSpec(columnSpec).build(); - return updateColumnSpec(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteModelAsync( + DeleteModelRequest request) { + return deleteModelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a column spec. + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
-   *   UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
-   *     .setColumnSpec(columnSpec)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ColumnSpec response = autoMlClient.updateColumnSpec(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request) { - return updateColumnSpecCallable().call(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteModelOperationCallable() { + return stub.deleteModelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a column spec. + * Deletes a model. Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, and `delete_details` + * in the [metadata][google.longrunning.Operation.metadata] field. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
-   *   UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
-   *     .setColumnSpec(columnSpec)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeleteModelRequest request = DeleteModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request);
    *   // Do something
-   *   ColumnSpec response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable updateColumnSpecCallable() { - return stub.updateColumnSpecCallable(); + public final UnaryCallable deleteModelCallable() { + return stub.deleteModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field - * when it completes. When you create a model, several model evaluations are created for it: a - * global evaluation, and one evaluation for each annotation spec. + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection , Tables, and Image + * Segmentation; all other domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Model model = Model.newBuilder().build();
-   *   Model response = autoMlClient.createModelAsync(parent, model).get();
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deployModelAsync(name).get();
    * }
    * 
* - * @param parent Required. Resource name of the parent project where the model is being created. - * @param model Required. The model to create. + * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture createModelAsync( - LocationName parent, Model model) { - CreateModelRequest request = - CreateModelRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setModel(model) - .build(); - return createModelAsync(request); + public final OperationFuture deployModelAsync(ModelName name) { + DeployModelRequest request = + DeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deployModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field - * when it completes. When you create a model, several model evaluations are created for it: a - * global evaluation, and one evaluation for each annotation spec. + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection , Tables, and Image + * Segmentation; all other domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Model model = Model.newBuilder().build();
-   *   Model response = autoMlClient.createModelAsync(parent.toString(), model).get();
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.deployModelAsync(name.toString()).get();
    * }
    * 
* - * @param parent Required. Resource name of the parent project where the model is being created. - * @param model Required. The model to create. + * @param name Required. Resource name of the model to deploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture createModelAsync( - String parent, Model model) { - CreateModelRequest request = - CreateModelRequest.newBuilder().setParent(parent).setModel(model).build(); - return createModelAsync(request); + public final OperationFuture deployModelAsync(String name) { + DeployModelRequest request = DeployModelRequest.newBuilder().setName(name).build(); + return deployModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field - * when it completes. When you create a model, several model evaluations are created for it: a - * global evaluation, and one evaluation for each annotation spec. + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection , Tables, and Image + * Segmentation; all other domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Model model = Model.newBuilder().build();
-   *   CreateModelRequest request = CreateModelRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setModel(model)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   Model response = autoMlClient.createModelAsync(request).get();
+   *   autoMlClient.deployModelAsync(request).get();
    * }
    * 
* @@ -2369,290 +2248,401 @@ public final OperationFuture createModelAsync( */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture createModelAsync( - CreateModelRequest request) { - return createModelOperationCallable().futureCall(request); + public final OperationFuture deployModelAsync( + DeployModelRequest request) { + return deployModelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field - * when it completes. When you create a model, several model evaluations are created for it: a - * global evaluation, and one evaluation for each annotation spec. + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection , Tables, and Image + * Segmentation; all other domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Model model = Model.newBuilder().build();
-   *   CreateModelRequest request = CreateModelRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setModel(model)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().futureCall(request);
    *   // Do something
-   *   Model response = future.get();
+   *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - createModelOperationCallable() { - return stub.createModelOperationCallable(); + public final OperationCallable + deployModelOperationCallable() { + return stub.deployModelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field - * when it completes. When you create a model, several model evaluations are created for it: a - * global evaluation, and one evaluation for each annotation spec. + * Deploys a model. If a model is already deployed, deploying it with the same parameters has no + * effect. Deploying with different parametrs (as e.g. changing + * + *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + *

Only applicable for Text Classification, Image Object Detection , Tables, and Image + * Segmentation; all other domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Model model = Model.newBuilder().build();
-   *   CreateModelRequest request = CreateModelRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setModel(model)
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
    *   // Do something
-   *   Operation response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable createModelCallable() { - return stub.createModelCallable(); + public final UnaryCallable deployModelCallable() { + return stub.deployModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model. + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection and Tables; all other + * domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. + * + *

Sample code: + * + *


+   * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   autoMlClient.undeployModelAsync(name).get();
+   * }
+   * 
+ * + * @param name Required. Resource name of the model to undeploy. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync(ModelName name) { + UndeployModelRequest request = + UndeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeployModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection and Tables; all other + * domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   Model response = autoMlClient.getModel(name);
+   *   autoMlClient.undeployModelAsync(name.toString()).get();
    * }
    * 
* - * @param name Required. Resource name of the model. + * @param name Required. Resource name of the model to undeploy. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Model getModel(ModelName name) { - GetModelRequest request = - GetModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getModel(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync(String name) { + UndeployModelRequest request = UndeployModelRequest.newBuilder().setName(name).build(); + return undeployModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model. + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection and Tables; all other + * domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   Model response = autoMlClient.getModel(name.toString());
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   autoMlClient.undeployModelAsync(request).get();
    * }
    * 
* - * @param name Required. Resource name of the model. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Model getModel(String name) { - GetModelRequest request = GetModelRequest.newBuilder().setName(name).build(); - return getModel(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture undeployModelAsync( + UndeployModelRequest request) { + return undeployModelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model. + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection and Tables; all other + * domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   Model response = autoMlClient.getModel(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Model getModel(GetModelRequest request) { - return getModelCallable().call(request); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + undeployModelOperationCallable() { + return stub.undeployModelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model. + * Undeploys a model. If the model is not deployed this method has no effect. + * + *

Only applicable for Text Classification, Image Object Detection and Tables; all other + * domains manage deployment automatically. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   GetModelRequest request = GetModelRequest.newBuilder()
+   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
    *   // Do something
-   *   Model response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable getModelCallable() { - return stub.getModelCallable(); + public final UnaryCallable undeployModelCallable() { + return stub.undeployModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists models. + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * + *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Model element : autoMlClient.listModels(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   autoMlClient.exportModelAsync(name, outputConfig).get();
    * }
    * 
* - * @param parent Required. Resource name of the project, from which to list the models. + * @param name Required. The resource name of the model to export. + * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelsPagedResponse listModels(LocationName parent) { - ListModelsRequest request = - ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listModels(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture exportModelAsync( + ModelName name, ModelExportOutputConfig outputConfig) { + ExportModelRequest request = + ExportModelRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setOutputConfig(outputConfig) + .build(); + return exportModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists models. + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * + *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Model element : autoMlClient.listModels(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   autoMlClient.exportModelAsync(name.toString(), outputConfig).get();
    * }
    * 
* - * @param parent Required. Resource name of the project, from which to list the models. + * @param name Required. The resource name of the model to export. + * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelsPagedResponse listModels(String parent) { - ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build(); - return listModels(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture exportModelAsync( + String name, ModelExportOutputConfig outputConfig) { + ExportModelRequest request = + ExportModelRequest.newBuilder().setName(name).setOutputConfig(outputConfig).build(); + return exportModelAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists models. + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * + *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListModelsRequest request = ListModelsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   for (Model element : autoMlClient.listModels(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   autoMlClient.exportModelAsync(request).get();
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListModelsPagedResponse listModels(ListModelsRequest request) { - return listModelsPagedCallable().call(request); + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture exportModelAsync( + ExportModelRequest request) { + return exportModelOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists models. + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * + *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListModelsRequest request = ListModelsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   ApiFuture<ListModelsPagedResponse> future = autoMlClient.listModelsPagedCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().futureCall(request);
    *   // Do something
-   *   for (Model element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable listModelsPagedCallable() { - return stub.listModelsPagedCallable(); + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + exportModelOperationCallable() { + return stub.exportModelOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists models. + * Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A + * model is considered export-able if and only if it has an export format defined for it in + * + *

[ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + * + *

Returns an empty response in the [response][google.longrunning.Operation.response] field + * when it completes. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListModelsRequest request = ListModelsRequest.newBuilder()
-   *     .setParent(parent.toString())
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
+   *   ExportModelRequest request = ExportModelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   while (true) {
-   *     ListModelsResponse response = autoMlClient.listModelsCallable().call(request);
-   *     for (Model element : response.getModelList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable listModelsCallable() { - return stub.listModelsCallable(); + public final UnaryCallable exportModelCallable() { + return stub.exportModelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deploys a model. If a model is already deployed, deploying it with the same parameters has no - * effect. Deploying with different parametrs (as e.g. changing + * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the + * dataset the model was created from), together with their ground truth annotations and the + * annotations created (predicted) by the model. The examples, ground truth and predictions are + * exported in the state they were at the moment the model was evaluated. * - *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - * will reset the deployment state without pausing the model's availability. + *

This export is available only for 30 days since the model evaluation is created. * - *

Only applicable for Text Classification, Image Object Detection , Tables, and Image - * Segmentation; all other domains manage deployment automatically. + *

Currently only available for Tables. * *

Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. @@ -2662,31 +2652,38 @@ public final UnaryCallable listModelsCall *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deployModelAsync(name).get();
+   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
+   *   autoMlClient.exportEvaluatedExamplesAsync(name, outputConfig).get();
    * }
    * 
* - * @param name Required. Resource name of the model to deploy. + * @param name Required. The resource name of the model whose evaluated examples are to be + * exported. + * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deployModelAsync(ModelName name) { - DeployModelRequest request = - DeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return deployModelAsync(request); + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture exportEvaluatedExamplesAsync( + ModelName name, ExportEvaluatedExamplesOutputConfig outputConfig) { + ExportEvaluatedExamplesRequest request = + ExportEvaluatedExamplesRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setOutputConfig(outputConfig) + .build(); + return exportEvaluatedExamplesAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deploys a model. If a model is already deployed, deploying it with the same parameters has no - * effect. Deploying with different parametrs (as e.g. changing + * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the + * dataset the model was created from), together with their ground truth annotations and the + * annotations created (predicted) by the model. The examples, ground truth and predictions are + * exported in the state they were at the moment the model was evaluated. * - *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - * will reset the deployment state without pausing the model's availability. + *

This export is available only for 30 days since the model evaluation is created. * - *

Only applicable for Text Classification, Image Object Detection , Tables, and Image - * Segmentation; all other domains manage deployment automatically. + *

Currently only available for Tables. * *

Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. @@ -2696,30 +2693,38 @@ public final OperationFuture deployModelAsync(ModelNam *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.deployModelAsync(name.toString()).get();
+   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
+   *   autoMlClient.exportEvaluatedExamplesAsync(name.toString(), outputConfig).get();
    * }
    * 
* - * @param name Required. Resource name of the model to deploy. + * @param name Required. The resource name of the model whose evaluated examples are to be + * exported. + * @param outputConfig Required. The desired output location and configuration. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deployModelAsync(String name) { - DeployModelRequest request = DeployModelRequest.newBuilder().setName(name).build(); - return deployModelAsync(request); + public final OperationFuture exportEvaluatedExamplesAsync( + String name, ExportEvaluatedExamplesOutputConfig outputConfig) { + ExportEvaluatedExamplesRequest request = + ExportEvaluatedExamplesRequest.newBuilder() + .setName(name) + .setOutputConfig(outputConfig) + .build(); + return exportEvaluatedExamplesAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deploys a model. If a model is already deployed, deploying it with the same parameters has no - * effect. Deploying with different parametrs (as e.g. changing + * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the + * dataset the model was created from), together with their ground truth annotations and the + * annotations created (predicted) by the model. The examples, ground truth and predictions are + * exported in the state they were at the moment the model was evaluated. * - *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - * will reset the deployment state without pausing the model's availability. + *

This export is available only for 30 days since the model evaluation is created. * - *

Only applicable for Text Classification, Image Object Detection , Tables, and Image - * Segmentation; all other domains manage deployment automatically. + *

Currently only available for Tables. * *

Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. @@ -2729,10 +2734,12 @@ public final OperationFuture deployModelAsync(String n *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
+   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   autoMlClient.deployModelAsync(request).get();
+   *   autoMlClient.exportEvaluatedExamplesAsync(request).get();
    * }
    * 
* @@ -2741,21 +2748,21 @@ public final OperationFuture deployModelAsync(String n */ @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture deployModelAsync( - DeployModelRequest request) { - return deployModelOperationCallable().futureCall(request); + public final OperationFuture exportEvaluatedExamplesAsync( + ExportEvaluatedExamplesRequest request) { + return exportEvaluatedExamplesOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deploys a model. If a model is already deployed, deploying it with the same parameters has no - * effect. Deploying with different parametrs (as e.g. changing + * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the + * dataset the model was created from), together with their ground truth annotations and the + * annotations created (predicted) by the model. The examples, ground truth and predictions are + * exported in the state they were at the moment the model was evaluated. * - *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - * will reset the deployment state without pausing the model's availability. + *

This export is available only for 30 days since the model evaluation is created. * - *

Only applicable for Text Classification, Image Object Detection , Tables, and Image - * Segmentation; all other domains manage deployment automatically. + *

Currently only available for Tables. * *

Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. @@ -2765,31 +2772,33 @@ public final OperationFuture deployModelAsync( *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
+   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().futureCall(request);
+   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportEvaluatedExamplesOperationCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - deployModelOperationCallable() { - return stub.deployModelOperationCallable(); + public final OperationCallable + exportEvaluatedExamplesOperationCallable() { + return stub.exportEvaluatedExamplesOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deploys a model. If a model is already deployed, deploying it with the same parameters has no - * effect. Deploying with different parametrs (as e.g. changing + * Exports examples on which the model was evaluated (i.e. which were in the TEST set of the + * dataset the model was created from), together with their ground truth annotations and the + * annotations created (predicted) by the model. The examples, ground truth and predictions are + * exported in the state they were at the moment the model was evaluated. * - *

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - * will reset the deployment state without pausing the model's availability. + *

This export is available only for 30 days since the model evaluation is created. * - *

Only applicable for Text Classification, Image Object Detection , Tables, and Image - * Segmentation; all other domains manage deployment automatically. + *

Currently only available for Tables. * *

Returns an empty response in the [response][google.longrunning.Operation.response] field * when it completes. @@ -2799,258 +2808,249 @@ public final OperationFuture deployModelAsync( *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
    *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   DeployModelRequest request = DeployModelRequest.newBuilder()
+   *   ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
+   *   ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setOutputConfig(outputConfig)
    *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
+   *   ApiFuture<Operation> future = autoMlClient.exportEvaluatedExamplesCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
    * 
*/ - public final UnaryCallable deployModelCallable() { - return stub.deployModelCallable(); + public final UnaryCallable + exportEvaluatedExamplesCallable() { + return stub.exportEvaluatedExamplesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - *

Only applicable for Text Classification, Image Object Detection and Tables; all other - * domains manage deployment automatically. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Gets a model evaluation. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.undeployModelAsync(name).get();
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name);
    * }
    * 
* - * @param name Required. Resource name of the model to undeploy. + * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture undeployModelAsync(ModelName name) { - UndeployModelRequest request = - UndeployModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return undeployModelAsync(request); + public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { + GetModelEvaluationRequest request = + GetModelEvaluationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getModelEvaluation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - *

Only applicable for Text Classification, Image Object Detection and Tables; all other - * domains manage deployment automatically. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Gets a model evaluation. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   autoMlClient.undeployModelAsync(name.toString()).get();
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name.toString());
    * }
    * 
* - * @param name Required. Resource name of the model to undeploy. + * @param name Required. Resource name for the model evaluation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture undeployModelAsync(String name) { - UndeployModelRequest request = UndeployModelRequest.newBuilder().setName(name).build(); - return undeployModelAsync(request); + public final ModelEvaluation getModelEvaluation(String name) { + GetModelEvaluationRequest request = + GetModelEvaluationRequest.newBuilder().setName(name).build(); + return getModelEvaluation(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - *

Only applicable for Text Classification, Image Object Detection and Tables; all other - * domains manage deployment automatically. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Gets a model evaluation. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   autoMlClient.undeployModelAsync(request).get();
+   *   ModelEvaluation response = autoMlClient.getModelEvaluation(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public final OperationFuture undeployModelAsync( - UndeployModelRequest request) { - return undeployModelOperationCallable().futureCall(request); + public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request) { + return getModelEvaluationCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - *

Only applicable for Text Classification, Image Object Detection and Tables; all other - * domains manage deployment automatically. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Gets a model evaluation. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
+   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
+   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().futureCall(request);
+   *   ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   ModelEvaluation response = future.get();
    * }
    * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public final OperationCallable - undeployModelOperationCallable() { - return stub.undeployModelOperationCallable(); + public final UnaryCallable + getModelEvaluationCallable() { + return stub.getModelEvaluationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - *

Only applicable for Text Classification, Image Object Detection and Tables; all other - * domains manage deployment automatically. - * - *

Returns an empty response in the [response][google.longrunning.Operation.response] field - * when it completes. + * Lists model evaluations. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
-   *   UndeployModelRequest request = UndeployModelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param parent Required. Resource name of the model to list the model evaluations for. If + * modelId is set as "-", this will list model evaluations from across all models of the + * parent location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable undeployModelCallable() { - return stub.undeployModelCallable(); + public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listModelEvaluations(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model evaluation. + * Lists model evaluations. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
-   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name);
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. Resource name for the model evaluation. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) { - GetModelEvaluationRequest request = - GetModelEvaluationRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getModelEvaluation(request); + * @param parent Required. Resource name of the model to list the model evaluations for. If + * modelId is set as "-", this will list model evaluations from across all models of the + * parent location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelEvaluationsPagedResponse listModelEvaluations(String parent) { + ListModelEvaluationsRequest request = + ListModelEvaluationsRequest.newBuilder().setParent(parent).build(); + return listModelEvaluations(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model evaluation. + * Lists model evaluations. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
-   *   ModelEvaluation response = autoMlClient.getModelEvaluation(name.toString());
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ModelEvaluation element : autoMlClient.listModelEvaluations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param name Required. Resource name for the model evaluation. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ModelEvaluation getModelEvaluation(String name) { - GetModelEvaluationRequest request = - GetModelEvaluationRequest.newBuilder().setName(name).build(); - return getModelEvaluation(request); + public final ListModelEvaluationsPagedResponse listModelEvaluations( + ListModelEvaluationsRequest request) { + return listModelEvaluationsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model evaluation. + * Lists model evaluations. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
-   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ModelEvaluation response = autoMlClient.getModelEvaluation(request);
+   *   ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ModelEvaluation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request) { - return getModelEvaluationCallable().call(request); + public final UnaryCallable + listModelEvaluationsPagedCallable() { + return stub.listModelEvaluationsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a model evaluation. + * Lists model evaluations. * *

Sample code: * *


    * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
-   *   ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
-   *   GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
-   *     .setName(name.toString())
+   *   ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+   *   ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
+   *     .setParent(parent.toString())
    *     .build();
-   *   ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request);
-   *   // Do something
-   *   ModelEvaluation response = future.get();
+   *   while (true) {
+   *     ListModelEvaluationsResponse response = autoMlClient.listModelEvaluationsCallable().call(request);
+   *     for (ModelEvaluation element : response.getModelEvaluationList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
*/ - public final UnaryCallable - getModelEvaluationCallable() { - return stub.getModelEvaluationCallable(); + public final UnaryCallable + listModelEvaluationsCallable() { + return stub.listModelEvaluationsCallable(); } @Override @@ -3083,95 +3083,6 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted return stub.awaitTermination(duration, unit); } - public static class ListModelEvaluationsPagedResponse - extends AbstractPagedListResponse< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ModelEvaluation, - ListModelEvaluationsPage, - ListModelEvaluationsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext - context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) { - return new ListModelEvaluationsPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); - } - - private ListModelEvaluationsPagedResponse(ListModelEvaluationsPage page) { - super(page, ListModelEvaluationsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListModelEvaluationsPage - extends AbstractPage< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ModelEvaluation, - ListModelEvaluationsPage> { - - private ListModelEvaluationsPage( - PageContext - context, - ListModelEvaluationsResponse response) { - super(context, response); - } - - private static ListModelEvaluationsPage createEmptyPage() { - return new ListModelEvaluationsPage(null, null); - } - - @Override - protected ListModelEvaluationsPage createPage( - PageContext - context, - ListModelEvaluationsResponse response) { - return new ListModelEvaluationsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext - context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListModelEvaluationsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ModelEvaluation, - ListModelEvaluationsPage, - ListModelEvaluationsFixedSizeCollection> { - - private ListModelEvaluationsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListModelEvaluationsFixedSizeCollection createEmptyCollection() { - return new ListModelEvaluationsFixedSizeCollection(null, 0); - } - - @Override - protected ListModelEvaluationsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListModelEvaluationsFixedSizeCollection(pages, collectionSize); - } - } - public static class ListDatasetsPagedResponse extends AbstractPagedListResponse< ListDatasetsRequest, @@ -3494,4 +3405,93 @@ protected ListModelsFixedSizeCollection createCollection( return new ListModelsFixedSizeCollection(pages, collectionSize); } } + + public static class ListModelEvaluationsPagedResponse + extends AbstractPagedListResponse< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage, + ListModelEvaluationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) { + return new ListModelEvaluationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListModelEvaluationsPagedResponse(ListModelEvaluationsPage page) { + super(page, ListModelEvaluationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListModelEvaluationsPage + extends AbstractPage< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage> { + + private ListModelEvaluationsPage( + PageContext + context, + ListModelEvaluationsResponse response) { + super(context, response); + } + + private static ListModelEvaluationsPage createEmptyPage() { + return new ListModelEvaluationsPage(null, null); + } + + @Override + protected ListModelEvaluationsPage createPage( + PageContext + context, + ListModelEvaluationsResponse response) { + return new ListModelEvaluationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListModelEvaluationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ModelEvaluation, + ListModelEvaluationsPage, + ListModelEvaluationsFixedSizeCollection> { + + private ListModelEvaluationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListModelEvaluationsFixedSizeCollection createEmptyCollection() { + return new ListModelEvaluationsFixedSizeCollection(null, 0); + } + + @Override + protected ListModelEvaluationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListModelEvaluationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java index 12ed7303f..6946d395b 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/AutoMlSettings.java @@ -74,6 +74,27 @@ @Generated("by gapic-generator") @BetaApi public class AutoMlSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).createDatasetSettings(); + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).getDatasetSettings(); + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return ((AutoMlStubSettings) getStubSettings()).listDatasetsSettings(); + } + + /** Returns the object with the settings used for calls to updateDataset. */ + public UnaryCallSettings updateDatasetSettings() { + return ((AutoMlStubSettings) getStubSettings()).updateDatasetSettings(); + } + /** Returns the object with the settings used for calls to deleteDataset. */ public UnaryCallSettings deleteDatasetSettings() { return ((AutoMlStubSettings) getStubSettings()).deleteDatasetSettings(); @@ -113,76 +134,6 @@ public UnaryCallSettings exportDataSettings() { return ((AutoMlStubSettings) getStubSettings()).exportDataOperationSettings(); } - /** Returns the object with the settings used for calls to deleteModel. */ - public UnaryCallSettings deleteModelSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteModelSettings(); - } - - /** Returns the object with the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - deleteModelOperationSettings() { - return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); - } - - /** Returns the object with the settings used for calls to exportModel. */ - public UnaryCallSettings exportModelSettings() { - return ((AutoMlStubSettings) getStubSettings()).exportModelSettings(); - } - - /** Returns the object with the settings used for calls to exportModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - exportModelOperationSettings() { - return ((AutoMlStubSettings) getStubSettings()).exportModelOperationSettings(); - } - - /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ - public UnaryCallSettings - exportEvaluatedExamplesSettings() { - return ((AutoMlStubSettings) getStubSettings()).exportEvaluatedExamplesSettings(); - } - - /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings - exportEvaluatedExamplesOperationSettings() { - return ((AutoMlStubSettings) getStubSettings()).exportEvaluatedExamplesOperationSettings(); - } - - /** Returns the object with the settings used for calls to listModelEvaluations. */ - public PagedCallSettings< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings() { - return ((AutoMlStubSettings) getStubSettings()).listModelEvaluationsSettings(); - } - - /** Returns the object with the settings used for calls to createDataset. */ - public UnaryCallSettings createDatasetSettings() { - return ((AutoMlStubSettings) getStubSettings()).createDatasetSettings(); - } - - /** Returns the object with the settings used for calls to getDataset. */ - public UnaryCallSettings getDatasetSettings() { - return ((AutoMlStubSettings) getStubSettings()).getDatasetSettings(); - } - - /** Returns the object with the settings used for calls to listDatasets. */ - public PagedCallSettings - listDatasetsSettings() { - return ((AutoMlStubSettings) getStubSettings()).listDatasetsSettings(); - } - - /** Returns the object with the settings used for calls to updateDataset. */ - public UnaryCallSettings updateDatasetSettings() { - return ((AutoMlStubSettings) getStubSettings()).updateDatasetSettings(); - } - /** Returns the object with the settings used for calls to getAnnotationSpec. */ public UnaryCallSettings getAnnotationSpecSettings() { return ((AutoMlStubSettings) getStubSettings()).getAnnotationSpecSettings(); @@ -246,6 +197,19 @@ public UnaryCallSettings getModelSettings() { return ((AutoMlStubSettings) getStubSettings()).listModelsSettings(); } + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelSettings(); + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).deleteModelOperationSettings(); + } + /** Returns the object with the settings used for calls to deployModel. */ public UnaryCallSettings deployModelSettings() { return ((AutoMlStubSettings) getStubSettings()).deployModelSettings(); @@ -272,12 +236,48 @@ public UnaryCallSettings undeployModelSettings( return ((AutoMlStubSettings) getStubSettings()).undeployModelOperationSettings(); } + /** Returns the object with the settings used for calls to exportModel. */ + public UnaryCallSettings exportModelSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportModelSettings(); + } + + /** Returns the object with the settings used for calls to exportModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportModelOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ + public UnaryCallSettings + exportEvaluatedExamplesSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportEvaluatedExamplesSettings(); + } + + /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportEvaluatedExamplesOperationSettings() { + return ((AutoMlStubSettings) getStubSettings()).exportEvaluatedExamplesOperationSettings(); + } + /** Returns the object with the settings used for calls to getModelEvaluation. */ public UnaryCallSettings getModelEvaluationSettings() { return ((AutoMlStubSettings) getStubSettings()).getModelEvaluationSettings(); } + /** Returns the object with the settings used for calls to listModelEvaluations. */ + public PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return ((AutoMlStubSettings) getStubSettings()).listModelEvaluationsSettings(); + } + public static final AutoMlSettings create(AutoMlStubSettings stub) throws IOException { return new AutoMlSettings.Builder(stub.toBuilder()).build(); } @@ -374,6 +374,28 @@ public Builder applyToAllUnaryMethods( return this; } + /** Returns the builder for the settings used for calls to createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return getStubSettingsBuilder().createDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getStubSettingsBuilder().getDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return getStubSettingsBuilder().listDatasetsSettings(); + } + + /** Returns the builder for the settings used for calls to updateDataset. */ + public UnaryCallSettings.Builder updateDatasetSettings() { + return getStubSettingsBuilder().updateDatasetSettings(); + } + /** Returns the builder for the settings used for calls to deleteDataset. */ public UnaryCallSettings.Builder deleteDatasetSettings() { return getStubSettingsBuilder().deleteDatasetSettings(); @@ -413,77 +435,6 @@ public UnaryCallSettings.Builder exportDataSetting return getStubSettingsBuilder().exportDataOperationSettings(); } - /** Returns the builder for the settings used for calls to deleteModel. */ - public UnaryCallSettings.Builder deleteModelSettings() { - return getStubSettingsBuilder().deleteModelSettings(); - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteModelOperationSettings() { - return getStubSettingsBuilder().deleteModelOperationSettings(); - } - - /** Returns the builder for the settings used for calls to exportModel. */ - public UnaryCallSettings.Builder exportModelSettings() { - return getStubSettingsBuilder().exportModelSettings(); - } - - /** Returns the builder for the settings used for calls to exportModel. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - exportModelOperationSettings() { - return getStubSettingsBuilder().exportModelOperationSettings(); - } - - /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ - public UnaryCallSettings.Builder - exportEvaluatedExamplesSettings() { - return getStubSettingsBuilder().exportEvaluatedExamplesSettings(); - } - - /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - public OperationCallSettings.Builder - exportEvaluatedExamplesOperationSettings() { - return getStubSettingsBuilder().exportEvaluatedExamplesOperationSettings(); - } - - /** Returns the builder for the settings used for calls to listModelEvaluations. */ - public PagedCallSettings.Builder< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings() { - return getStubSettingsBuilder().listModelEvaluationsSettings(); - } - - /** Returns the builder for the settings used for calls to createDataset. */ - public UnaryCallSettings.Builder createDatasetSettings() { - return getStubSettingsBuilder().createDatasetSettings(); - } - - /** Returns the builder for the settings used for calls to getDataset. */ - public UnaryCallSettings.Builder getDatasetSettings() { - return getStubSettingsBuilder().getDatasetSettings(); - } - - /** Returns the builder for the settings used for calls to listDatasets. */ - public PagedCallSettings.Builder< - ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> - listDatasetsSettings() { - return getStubSettingsBuilder().listDatasetsSettings(); - } - - /** Returns the builder for the settings used for calls to updateDataset. */ - public UnaryCallSettings.Builder updateDatasetSettings() { - return getStubSettingsBuilder().updateDatasetSettings(); - } - /** Returns the builder for the settings used for calls to getAnnotationSpec. */ public UnaryCallSettings.Builder getAnnotationSpecSettings() { @@ -549,6 +500,19 @@ public UnaryCallSettings.Builder getModelSettings() { return getStubSettingsBuilder().listModelsSettings(); } + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return getStubSettingsBuilder().deleteModelSettings(); + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return getStubSettingsBuilder().deleteModelOperationSettings(); + } + /** Returns the builder for the settings used for calls to deployModel. */ public UnaryCallSettings.Builder deployModelSettings() { return getStubSettingsBuilder().deployModelSettings(); @@ -575,12 +539,48 @@ public UnaryCallSettings.Builder undeployModelS return getStubSettingsBuilder().undeployModelOperationSettings(); } + /** Returns the builder for the settings used for calls to exportModel. */ + public UnaryCallSettings.Builder exportModelSettings() { + return getStubSettingsBuilder().exportModelSettings(); + } + + /** Returns the builder for the settings used for calls to exportModel. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportModelOperationSettings() { + return getStubSettingsBuilder().exportModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ + public UnaryCallSettings.Builder + exportEvaluatedExamplesSettings() { + return getStubSettingsBuilder().exportEvaluatedExamplesSettings(); + } + + /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportEvaluatedExamplesOperationSettings() { + return getStubSettingsBuilder().exportEvaluatedExamplesOperationSettings(); + } + /** Returns the builder for the settings used for calls to getModelEvaluation. */ public UnaryCallSettings.Builder getModelEvaluationSettings() { return getStubSettingsBuilder().getModelEvaluationSettings(); } + /** Returns the builder for the settings used for calls to listModelEvaluations. */ + public PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return getStubSettingsBuilder().listModelEvaluationsSettings(); + } + @Override public AutoMlSettings build() throws IOException { return new AutoMlSettings(this); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java index 20f0040ea..54a4172eb 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java @@ -81,6 +81,26 @@ public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } + public UnaryCallable createDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: createDatasetCallable()"); + } + + public UnaryCallable getDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: getDatasetCallable()"); + } + + public UnaryCallable listDatasetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsPagedCallable()"); + } + + public UnaryCallable listDatasetsCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsCallable()"); + } + + public UnaryCallable updateDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: updateDatasetCallable()"); + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable deleteDatasetOperationCallable() { @@ -111,68 +131,6 @@ public UnaryCallable exportDataCallable() { throw new UnsupportedOperationException("Not implemented: exportDataCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteModelOperationCallable() { - throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()"); - } - - public UnaryCallable deleteModelCallable() { - throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - exportModelOperationCallable() { - throw new UnsupportedOperationException("Not implemented: exportModelOperationCallable()"); - } - - public UnaryCallable exportModelCallable() { - throw new UnsupportedOperationException("Not implemented: exportModelCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - exportEvaluatedExamplesOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: exportEvaluatedExamplesOperationCallable()"); - } - - public UnaryCallable - exportEvaluatedExamplesCallable() { - throw new UnsupportedOperationException("Not implemented: exportEvaluatedExamplesCallable()"); - } - - public UnaryCallable - listModelEvaluationsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listModelEvaluationsPagedCallable()"); - } - - public UnaryCallable - listModelEvaluationsCallable() { - throw new UnsupportedOperationException("Not implemented: listModelEvaluationsCallable()"); - } - - public UnaryCallable createDatasetCallable() { - throw new UnsupportedOperationException("Not implemented: createDatasetCallable()"); - } - - public UnaryCallable getDatasetCallable() { - throw new UnsupportedOperationException("Not implemented: getDatasetCallable()"); - } - - public UnaryCallable listDatasetsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listDatasetsPagedCallable()"); - } - - public UnaryCallable listDatasetsCallable() { - throw new UnsupportedOperationException("Not implemented: listDatasetsCallable()"); - } - - public UnaryCallable updateDatasetCallable() { - throw new UnsupportedOperationException("Not implemented: updateDatasetCallable()"); - } - public UnaryCallable getAnnotationSpecCallable() { throw new UnsupportedOperationException("Not implemented: getAnnotationSpecCallable()"); } @@ -233,6 +191,16 @@ public UnaryCallable listModelsCallable() throw new UnsupportedOperationException("Not implemented: listModelsCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelOperationCallable()"); + } + + public UnaryCallable deleteModelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable deployModelOperationCallable() { @@ -253,10 +221,42 @@ public UnaryCallable undeployModelCallable() { throw new UnsupportedOperationException("Not implemented: undeployModelCallable()"); } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportModelOperationCallable()"); + } + + public UnaryCallable exportModelCallable() { + throw new UnsupportedOperationException("Not implemented: exportModelCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportEvaluatedExamplesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: exportEvaluatedExamplesOperationCallable()"); + } + + public UnaryCallable + exportEvaluatedExamplesCallable() { + throw new UnsupportedOperationException("Not implemented: exportEvaluatedExamplesCallable()"); + } + public UnaryCallable getModelEvaluationCallable() { throw new UnsupportedOperationException("Not implemented: getModelEvaluationCallable()"); } + public UnaryCallable + listModelEvaluationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listModelEvaluationsPagedCallable()"); + } + + public UnaryCallable + listModelEvaluationsCallable() { + throw new UnsupportedOperationException("Not implemented: listModelEvaluationsCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java index f61dc8a65..b4e742fb0 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStubSettings.java @@ -132,6 +132,12 @@ public class AutoMlStubSettings extends StubSettings { private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + private final UnaryCallSettings createDatasetSettings; + private final UnaryCallSettings getDatasetSettings; + private final PagedCallSettings< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings updateDatasetSettings; private final UnaryCallSettings deleteDatasetSettings; private final OperationCallSettings deleteDatasetOperationSettings; @@ -141,27 +147,6 @@ public class AutoMlStubSettings extends StubSettings { private final UnaryCallSettings exportDataSettings; private final OperationCallSettings exportDataOperationSettings; - private final UnaryCallSettings deleteModelSettings; - private final OperationCallSettings - deleteModelOperationSettings; - private final UnaryCallSettings exportModelSettings; - private final OperationCallSettings - exportModelOperationSettings; - private final UnaryCallSettings - exportEvaluatedExamplesSettings; - private final OperationCallSettings - exportEvaluatedExamplesOperationSettings; - private final PagedCallSettings< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings; - private final UnaryCallSettings createDatasetSettings; - private final UnaryCallSettings getDatasetSettings; - private final PagedCallSettings< - ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> - listDatasetsSettings; - private final UnaryCallSettings updateDatasetSettings; private final UnaryCallSettings getAnnotationSpecSettings; private final UnaryCallSettings getTableSpecSettings; @@ -180,14 +165,50 @@ public class AutoMlStubSettings extends StubSettings { private final UnaryCallSettings getModelSettings; private final PagedCallSettings listModelsSettings; + private final UnaryCallSettings deleteModelSettings; + private final OperationCallSettings + deleteModelOperationSettings; private final UnaryCallSettings deployModelSettings; private final OperationCallSettings deployModelOperationSettings; private final UnaryCallSettings undeployModelSettings; private final OperationCallSettings undeployModelOperationSettings; + private final UnaryCallSettings exportModelSettings; + private final OperationCallSettings + exportModelOperationSettings; + private final UnaryCallSettings + exportEvaluatedExamplesSettings; + private final OperationCallSettings + exportEvaluatedExamplesOperationSettings; private final UnaryCallSettings getModelEvaluationSettings; + private final PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings; + + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the object with the settings used for calls to updateDataset. */ + public UnaryCallSettings updateDatasetSettings() { + return updateDatasetSettings; + } /** Returns the object with the settings used for calls to deleteDataset. */ public UnaryCallSettings deleteDatasetSettings() { @@ -225,73 +246,6 @@ public UnaryCallSettings exportDataSettings() { return exportDataOperationSettings; } - /** Returns the object with the settings used for calls to deleteModel. */ - public UnaryCallSettings deleteModelSettings() { - return deleteModelSettings; - } - - /** Returns the object with the settings used for calls to deleteModel. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - deleteModelOperationSettings() { - return deleteModelOperationSettings; - } - - /** Returns the object with the settings used for calls to exportModel. */ - public UnaryCallSettings exportModelSettings() { - return exportModelSettings; - } - - /** Returns the object with the settings used for calls to exportModel. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - exportModelOperationSettings() { - return exportModelOperationSettings; - } - - /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ - public UnaryCallSettings - exportEvaluatedExamplesSettings() { - return exportEvaluatedExamplesSettings; - } - - /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings - exportEvaluatedExamplesOperationSettings() { - return exportEvaluatedExamplesOperationSettings; - } - - /** Returns the object with the settings used for calls to listModelEvaluations. */ - public PagedCallSettings< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings() { - return listModelEvaluationsSettings; - } - - /** Returns the object with the settings used for calls to createDataset. */ - public UnaryCallSettings createDatasetSettings() { - return createDatasetSettings; - } - - /** Returns the object with the settings used for calls to getDataset. */ - public UnaryCallSettings getDatasetSettings() { - return getDatasetSettings; - } - - /** Returns the object with the settings used for calls to listDatasets. */ - public PagedCallSettings - listDatasetsSettings() { - return listDatasetsSettings; - } - - /** Returns the object with the settings used for calls to updateDataset. */ - public UnaryCallSettings updateDatasetSettings() { - return updateDatasetSettings; - } - /** Returns the object with the settings used for calls to getAnnotationSpec. */ public UnaryCallSettings getAnnotationSpecSettings() { return getAnnotationSpecSettings; @@ -354,6 +308,18 @@ public UnaryCallSettings getModelSettings() { return listModelsSettings; } + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the object with the settings used for calls to deleteModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + /** Returns the object with the settings used for calls to deployModel. */ public UnaryCallSettings deployModelSettings() { return deployModelSettings; @@ -378,12 +344,46 @@ public UnaryCallSettings undeployModelSettings( return undeployModelOperationSettings; } + /** Returns the object with the settings used for calls to exportModel. */ + public UnaryCallSettings exportModelSettings() { + return exportModelSettings; + } + + /** Returns the object with the settings used for calls to exportModel. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportModelOperationSettings() { + return exportModelOperationSettings; + } + + /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ + public UnaryCallSettings + exportEvaluatedExamplesSettings() { + return exportEvaluatedExamplesSettings; + } + + /** Returns the object with the settings used for calls to exportEvaluatedExamples. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportEvaluatedExamplesOperationSettings() { + return exportEvaluatedExamplesOperationSettings; + } + /** Returns the object with the settings used for calls to getModelEvaluation. */ public UnaryCallSettings getModelEvaluationSettings() { return getModelEvaluationSettings; } + /** Returns the object with the settings used for calls to listModelEvaluations. */ + public PagedCallSettings< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return listModelEvaluationsSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public AutoMlStub createStub() throws IOException { if (getTransportChannelProvider() @@ -452,24 +452,16 @@ public Builder toBuilder() { protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); + createDatasetSettings = settingsBuilder.createDatasetSettings().build(); + getDatasetSettings = settingsBuilder.getDatasetSettings().build(); + listDatasetsSettings = settingsBuilder.listDatasetsSettings().build(); + updateDatasetSettings = settingsBuilder.updateDatasetSettings().build(); deleteDatasetSettings = settingsBuilder.deleteDatasetSettings().build(); deleteDatasetOperationSettings = settingsBuilder.deleteDatasetOperationSettings().build(); importDataSettings = settingsBuilder.importDataSettings().build(); importDataOperationSettings = settingsBuilder.importDataOperationSettings().build(); exportDataSettings = settingsBuilder.exportDataSettings().build(); exportDataOperationSettings = settingsBuilder.exportDataOperationSettings().build(); - deleteModelSettings = settingsBuilder.deleteModelSettings().build(); - deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); - exportModelSettings = settingsBuilder.exportModelSettings().build(); - exportModelOperationSettings = settingsBuilder.exportModelOperationSettings().build(); - exportEvaluatedExamplesSettings = settingsBuilder.exportEvaluatedExamplesSettings().build(); - exportEvaluatedExamplesOperationSettings = - settingsBuilder.exportEvaluatedExamplesOperationSettings().build(); - listModelEvaluationsSettings = settingsBuilder.listModelEvaluationsSettings().build(); - createDatasetSettings = settingsBuilder.createDatasetSettings().build(); - getDatasetSettings = settingsBuilder.getDatasetSettings().build(); - listDatasetsSettings = settingsBuilder.listDatasetsSettings().build(); - updateDatasetSettings = settingsBuilder.updateDatasetSettings().build(); getAnnotationSpecSettings = settingsBuilder.getAnnotationSpecSettings().build(); getTableSpecSettings = settingsBuilder.getTableSpecSettings().build(); listTableSpecsSettings = settingsBuilder.listTableSpecsSettings().build(); @@ -481,54 +473,21 @@ protected AutoMlStubSettings(Builder settingsBuilder) throws IOException { createModelOperationSettings = settingsBuilder.createModelOperationSettings().build(); getModelSettings = settingsBuilder.getModelSettings().build(); listModelsSettings = settingsBuilder.listModelsSettings().build(); + deleteModelSettings = settingsBuilder.deleteModelSettings().build(); + deleteModelOperationSettings = settingsBuilder.deleteModelOperationSettings().build(); deployModelSettings = settingsBuilder.deployModelSettings().build(); deployModelOperationSettings = settingsBuilder.deployModelOperationSettings().build(); undeployModelSettings = settingsBuilder.undeployModelSettings().build(); undeployModelOperationSettings = settingsBuilder.undeployModelOperationSettings().build(); + exportModelSettings = settingsBuilder.exportModelSettings().build(); + exportModelOperationSettings = settingsBuilder.exportModelOperationSettings().build(); + exportEvaluatedExamplesSettings = settingsBuilder.exportEvaluatedExamplesSettings().build(); + exportEvaluatedExamplesOperationSettings = + settingsBuilder.exportEvaluatedExamplesOperationSettings().build(); getModelEvaluationSettings = settingsBuilder.getModelEvaluationSettings().build(); + listModelEvaluationsSettings = settingsBuilder.listModelEvaluationsSettings().build(); } - private static final PagedListDescriptor< - ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> - LIST_MODEL_EVALUATIONS_PAGE_STR_DESC = - new PagedListDescriptor< - ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListModelEvaluationsRequest injectToken( - ListModelEvaluationsRequest payload, String token) { - return ListModelEvaluationsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListModelEvaluationsRequest injectPageSize( - ListModelEvaluationsRequest payload, int pageSize) { - return ListModelEvaluationsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListModelEvaluationsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListModelEvaluationsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListModelEvaluationsResponse payload) { - return payload.getModelEvaluationList() != null - ? payload.getModelEvaluationList() - : ImmutableList.of(); - } - }; - private static final PagedListDescriptor LIST_DATASETS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -677,27 +636,44 @@ public Iterable extractResources(ListModelsResponse payload) { } }; - private static final PagedListResponseFactory< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - LIST_MODEL_EVALUATIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse>() { + private static final PagedListDescriptor< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> + LIST_MODEL_EVALUATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation>() { @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListModelEvaluationsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> - pageContext = - PageContext.create( - callable, LIST_MODEL_EVALUATIONS_PAGE_STR_DESC, request, context); - return ListModelEvaluationsPagedResponse.createAsync(pageContext, futureResponse); + public String emptyToken() { + return ""; + } + + @Override + public ListModelEvaluationsRequest injectToken( + ListModelEvaluationsRequest payload, String token) { + return ListModelEvaluationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListModelEvaluationsRequest injectPageSize( + ListModelEvaluationsRequest payload, int pageSize) { + return ListModelEvaluationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListModelEvaluationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListModelEvaluationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListModelEvaluationsResponse payload) { + return payload.getModelEvaluationList() != null + ? payload.getModelEvaluationList() + : ImmutableList.of(); } }; @@ -769,10 +745,40 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + LIST_MODEL_EVALUATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListModelEvaluationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListModelEvaluationsRequest, ListModelEvaluationsResponse, ModelEvaluation> + pageContext = + PageContext.create( + callable, LIST_MODEL_EVALUATIONS_PAGE_STR_DESC, request, context); + return ListModelEvaluationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Builder for AutoMlStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createDatasetSettings; + private final UnaryCallSettings.Builder getDatasetSettings; + private final PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings.Builder updateDatasetSettings; private final UnaryCallSettings.Builder deleteDatasetSettings; private final OperationCallSettings.Builder deleteDatasetOperationSettings; @@ -782,28 +788,6 @@ public static class Builder extends StubSettings.Builder exportDataSettings; private final OperationCallSettings.Builder exportDataOperationSettings; - private final UnaryCallSettings.Builder deleteModelSettings; - private final OperationCallSettings.Builder - deleteModelOperationSettings; - private final UnaryCallSettings.Builder exportModelSettings; - private final OperationCallSettings.Builder - exportModelOperationSettings; - private final UnaryCallSettings.Builder - exportEvaluatedExamplesSettings; - private final OperationCallSettings.Builder< - ExportEvaluatedExamplesRequest, Empty, OperationMetadata> - exportEvaluatedExamplesOperationSettings; - private final PagedCallSettings.Builder< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings; - private final UnaryCallSettings.Builder createDatasetSettings; - private final UnaryCallSettings.Builder getDatasetSettings; - private final PagedCallSettings.Builder< - ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> - listDatasetsSettings; - private final UnaryCallSettings.Builder updateDatasetSettings; private final UnaryCallSettings.Builder getAnnotationSpecSettings; private final UnaryCallSettings.Builder getTableSpecSettings; @@ -825,14 +809,30 @@ public static class Builder extends StubSettings.Builder listModelsSettings; + private final UnaryCallSettings.Builder deleteModelSettings; + private final OperationCallSettings.Builder + deleteModelOperationSettings; private final UnaryCallSettings.Builder deployModelSettings; private final OperationCallSettings.Builder deployModelOperationSettings; private final UnaryCallSettings.Builder undeployModelSettings; private final OperationCallSettings.Builder undeployModelOperationSettings; + private final UnaryCallSettings.Builder exportModelSettings; + private final OperationCallSettings.Builder + exportModelOperationSettings; + private final UnaryCallSettings.Builder + exportEvaluatedExamplesSettings; + private final OperationCallSettings.Builder< + ExportEvaluatedExamplesRequest, Empty, OperationMetadata> + exportEvaluatedExamplesOperationSettings; private final UnaryCallSettings.Builder getModelEvaluationSettings; + private final PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -841,11 +841,13 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -859,12 +861,22 @@ public static class Builder extends StubSettings.Builder>of( - deleteDatasetSettings, - importDataSettings, - exportDataSettings, - deleteModelSettings, - exportModelSettings, - exportEvaluatedExamplesSettings, - listModelEvaluationsSettings, + listModelEvaluationsSettings = + PagedCallSettings.newBuilder(LIST_MODEL_EVALUATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( createDatasetSettings, getDatasetSettings, listDatasetsSettings, updateDatasetSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, getAnnotationSpecSettings, getTableSpecSettings, listTableSpecsSettings, @@ -965,9 +973,13 @@ protected Builder(ClientContext clientContext) { createModelSettings, getModelSettings, listModelsSettings, + deleteModelSettings, deployModelSettings, undeployModelSettings, - getModelEvaluationSettings); + exportModelSettings, + exportEvaluatedExamplesSettings, + getModelEvaluationSettings, + listModelEvaluationsSettings); initDefaults(this); } @@ -984,131 +996,131 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder - .deleteDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .importDataSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .exportDataSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .deleteModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - - builder - .exportModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .createDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder - .exportEvaluatedExamplesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .getDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .listModelEvaluationsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .listDatasetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .createDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .updateDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder - .getDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .deleteDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder - .listDatasetsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .importDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder - .updateDatasetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .exportDataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .getAnnotationSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .getTableSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listTableSpecsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .updateTableSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .getColumnSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listColumnSpecsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .updateColumnSpecSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .createModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .getModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .listModelsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .deployModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .undeployModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .exportModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); + + builder + .exportEvaluatedExamplesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .getModelEvaluationSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listModelEvaluationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .deleteDatasetOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1129,8 +1141,8 @@ private static Builder initDefaults(Builder builder) { .importDataOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1151,8 +1163,8 @@ private static Builder initDefaults(Builder builder) { .exportDataOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1170,14 +1182,14 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .deleteModelOperationSettings() + .createModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + ProtoOperationTransformers.ResponseTransformer.create(Model.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -1192,11 +1204,11 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .exportModelOperationSettings() + .deleteModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1214,12 +1226,11 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .exportEvaluatedExamplesOperationSettings() + .deployModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1237,14 +1248,15 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .createModelOperationSettings() + .undeployModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Model.class)) + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( @@ -1259,11 +1271,11 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .deployModelOperationSettings() + .exportModelOperationSettings() .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1281,12 +1293,12 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder - .undeployModelOperationSettings() + .exportEvaluatedExamplesOperationSettings() .setInitialCallSettings( UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -1310,24 +1322,16 @@ private static Builder initDefaults(Builder builder) { protected Builder(AutoMlStubSettings settings) { super(settings); + createDatasetSettings = settings.createDatasetSettings.toBuilder(); + getDatasetSettings = settings.getDatasetSettings.toBuilder(); + listDatasetsSettings = settings.listDatasetsSettings.toBuilder(); + updateDatasetSettings = settings.updateDatasetSettings.toBuilder(); deleteDatasetSettings = settings.deleteDatasetSettings.toBuilder(); deleteDatasetOperationSettings = settings.deleteDatasetOperationSettings.toBuilder(); importDataSettings = settings.importDataSettings.toBuilder(); importDataOperationSettings = settings.importDataOperationSettings.toBuilder(); exportDataSettings = settings.exportDataSettings.toBuilder(); exportDataOperationSettings = settings.exportDataOperationSettings.toBuilder(); - deleteModelSettings = settings.deleteModelSettings.toBuilder(); - deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); - exportModelSettings = settings.exportModelSettings.toBuilder(); - exportModelOperationSettings = settings.exportModelOperationSettings.toBuilder(); - exportEvaluatedExamplesSettings = settings.exportEvaluatedExamplesSettings.toBuilder(); - exportEvaluatedExamplesOperationSettings = - settings.exportEvaluatedExamplesOperationSettings.toBuilder(); - listModelEvaluationsSettings = settings.listModelEvaluationsSettings.toBuilder(); - createDatasetSettings = settings.createDatasetSettings.toBuilder(); - getDatasetSettings = settings.getDatasetSettings.toBuilder(); - listDatasetsSettings = settings.listDatasetsSettings.toBuilder(); - updateDatasetSettings = settings.updateDatasetSettings.toBuilder(); getAnnotationSpecSettings = settings.getAnnotationSpecSettings.toBuilder(); getTableSpecSettings = settings.getTableSpecSettings.toBuilder(); listTableSpecsSettings = settings.listTableSpecsSettings.toBuilder(); @@ -1339,25 +1343,29 @@ protected Builder(AutoMlStubSettings settings) { createModelOperationSettings = settings.createModelOperationSettings.toBuilder(); getModelSettings = settings.getModelSettings.toBuilder(); listModelsSettings = settings.listModelsSettings.toBuilder(); + deleteModelSettings = settings.deleteModelSettings.toBuilder(); + deleteModelOperationSettings = settings.deleteModelOperationSettings.toBuilder(); deployModelSettings = settings.deployModelSettings.toBuilder(); deployModelOperationSettings = settings.deployModelOperationSettings.toBuilder(); undeployModelSettings = settings.undeployModelSettings.toBuilder(); undeployModelOperationSettings = settings.undeployModelOperationSettings.toBuilder(); + exportModelSettings = settings.exportModelSettings.toBuilder(); + exportModelOperationSettings = settings.exportModelOperationSettings.toBuilder(); + exportEvaluatedExamplesSettings = settings.exportEvaluatedExamplesSettings.toBuilder(); + exportEvaluatedExamplesOperationSettings = + settings.exportEvaluatedExamplesOperationSettings.toBuilder(); getModelEvaluationSettings = settings.getModelEvaluationSettings.toBuilder(); + listModelEvaluationsSettings = settings.listModelEvaluationsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - deleteDatasetSettings, - importDataSettings, - exportDataSettings, - deleteModelSettings, - exportModelSettings, - exportEvaluatedExamplesSettings, - listModelEvaluationsSettings, createDatasetSettings, getDatasetSettings, listDatasetsSettings, updateDatasetSettings, + deleteDatasetSettings, + importDataSettings, + exportDataSettings, getAnnotationSpecSettings, getTableSpecSettings, listTableSpecsSettings, @@ -1368,9 +1376,13 @@ protected Builder(AutoMlStubSettings settings) { createModelSettings, getModelSettings, listModelsSettings, + deleteModelSettings, deployModelSettings, undeployModelSettings, - getModelEvaluationSettings); + exportModelSettings, + exportEvaluatedExamplesSettings, + getModelEvaluationSettings, + listModelEvaluationsSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -1389,6 +1401,28 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } + /** Returns the builder for the settings used for calls to createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the builder for the settings used for calls to updateDataset. */ + public UnaryCallSettings.Builder updateDatasetSettings() { + return updateDatasetSettings; + } + /** Returns the builder for the settings used for calls to deleteDataset. */ public UnaryCallSettings.Builder deleteDatasetSettings() { return deleteDatasetSettings; @@ -1428,77 +1462,6 @@ public UnaryCallSettings.Builder exportDataSetting return exportDataOperationSettings; } - /** Returns the builder for the settings used for calls to deleteModel. */ - public UnaryCallSettings.Builder deleteModelSettings() { - return deleteModelSettings; - } - - /** Returns the builder for the settings used for calls to deleteModel. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deleteModelOperationSettings() { - return deleteModelOperationSettings; - } - - /** Returns the builder for the settings used for calls to exportModel. */ - public UnaryCallSettings.Builder exportModelSettings() { - return exportModelSettings; - } - - /** Returns the builder for the settings used for calls to exportModel. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - exportModelOperationSettings() { - return exportModelOperationSettings; - } - - /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ - public UnaryCallSettings.Builder - exportEvaluatedExamplesSettings() { - return exportEvaluatedExamplesSettings; - } - - /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - exportEvaluatedExamplesOperationSettings() { - return exportEvaluatedExamplesOperationSettings; - } - - /** Returns the builder for the settings used for calls to listModelEvaluations. */ - public PagedCallSettings.Builder< - ListModelEvaluationsRequest, - ListModelEvaluationsResponse, - ListModelEvaluationsPagedResponse> - listModelEvaluationsSettings() { - return listModelEvaluationsSettings; - } - - /** Returns the builder for the settings used for calls to createDataset. */ - public UnaryCallSettings.Builder createDatasetSettings() { - return createDatasetSettings; - } - - /** Returns the builder for the settings used for calls to getDataset. */ - public UnaryCallSettings.Builder getDatasetSettings() { - return getDatasetSettings; - } - - /** Returns the builder for the settings used for calls to listDatasets. */ - public PagedCallSettings.Builder< - ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> - listDatasetsSettings() { - return listDatasetsSettings; - } - - /** Returns the builder for the settings used for calls to updateDataset. */ - public UnaryCallSettings.Builder updateDatasetSettings() { - return updateDatasetSettings; - } - /** Returns the builder for the settings used for calls to getAnnotationSpec. */ public UnaryCallSettings.Builder getAnnotationSpecSettings() { @@ -1564,6 +1527,19 @@ public UnaryCallSettings.Builder getModelSettings() { return listModelsSettings; } + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteModelOperationSettings() { + return deleteModelOperationSettings; + } + /** Returns the builder for the settings used for calls to deployModel. */ public UnaryCallSettings.Builder deployModelSettings() { return deployModelSettings; @@ -1590,12 +1566,48 @@ public UnaryCallSettings.Builder undeployModelS return undeployModelOperationSettings; } + /** Returns the builder for the settings used for calls to exportModel. */ + public UnaryCallSettings.Builder exportModelSettings() { + return exportModelSettings; + } + + /** Returns the builder for the settings used for calls to exportModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportModelOperationSettings() { + return exportModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ + public UnaryCallSettings.Builder + exportEvaluatedExamplesSettings() { + return exportEvaluatedExamplesSettings; + } + + /** Returns the builder for the settings used for calls to exportEvaluatedExamples. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + exportEvaluatedExamplesOperationSettings() { + return exportEvaluatedExamplesOperationSettings; + } + /** Returns the builder for the settings used for calls to getModelEvaluation. */ public UnaryCallSettings.Builder getModelEvaluationSettings() { return getModelEvaluationSettings; } + /** Returns the builder for the settings used for calls to listModelEvaluations. */ + public PagedCallSettings.Builder< + ListModelEvaluationsRequest, + ListModelEvaluationsResponse, + ListModelEvaluationsPagedResponse> + listModelEvaluationsSettings() { + return listModelEvaluationsSettings; + } + @Override public AutoMlStubSettings build() throws IOException { return new AutoMlStubSettings(this); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java index 088fbbd7c..4eda567f3 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/GrpcAutoMlStub.java @@ -87,62 +87,6 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcAutoMlStub extends AutoMlStub { - private static final MethodDescriptor - deleteDatasetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteDataset") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor importDataMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ImportData") - .setRequestMarshaller(ProtoUtils.marshaller(ImportDataRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor exportDataMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportData") - .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor deleteModelMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteModel") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor exportModelMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportModel") - .setRequestMarshaller(ProtoUtils.marshaller(ExportModelRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor - exportEvaluatedExamplesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportEvaluatedExamples") - .setRequestMarshaller( - ProtoUtils.marshaller(ExportEvaluatedExamplesRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - private static final MethodDescriptor - listModelEvaluationsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListModelEvaluations") - .setRequestMarshaller( - ProtoUtils.marshaller(ListModelEvaluationsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListModelEvaluationsResponse.getDefaultInstance())) - .build(); private static final MethodDescriptor createDatasetMethodDescriptor = MethodDescriptor.newBuilder() @@ -177,6 +121,29 @@ public class GrpcAutoMlStub extends AutoMlStub { ProtoUtils.marshaller(UpdateDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor importDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ImportData") + .setRequestMarshaller(ProtoUtils.marshaller(ImportDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor exportDataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportData") + .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor getAnnotationSpecMethodDescriptor = MethodDescriptor.newBuilder() @@ -263,6 +230,13 @@ public class GrpcAutoMlStub extends AutoMlStub { .setRequestMarshaller(ProtoUtils.marshaller(ListModelsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListModelsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor deployModelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -279,6 +253,22 @@ public class GrpcAutoMlStub extends AutoMlStub { ProtoUtils.marshaller(UndeployModelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor exportModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportModel") + .setRequestMarshaller(ProtoUtils.marshaller(ExportModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + exportEvaluatedExamplesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportEvaluatedExamples") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportEvaluatedExamplesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); private static final MethodDescriptor getModelEvaluationMethodDescriptor = MethodDescriptor.newBuilder() @@ -288,10 +278,26 @@ public class GrpcAutoMlStub extends AutoMlStub { ProtoUtils.marshaller(GetModelEvaluationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ModelEvaluation.getDefaultInstance())) .build(); + private static final MethodDescriptor + listModelEvaluationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListModelEvaluations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListModelEvaluationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListModelEvaluationsResponse.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; + private final UnaryCallable createDatasetCallable; + private final UnaryCallable getDatasetCallable; + private final UnaryCallable listDatasetsCallable; + private final UnaryCallable + listDatasetsPagedCallable; + private final UnaryCallable updateDatasetCallable; private final UnaryCallable deleteDatasetCallable; private final OperationCallable deleteDatasetOperationCallable; @@ -301,26 +307,6 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable exportDataCallable; private final OperationCallable exportDataOperationCallable; - private final UnaryCallable deleteModelCallable; - private final OperationCallable - deleteModelOperationCallable; - private final UnaryCallable exportModelCallable; - private final OperationCallable - exportModelOperationCallable; - private final UnaryCallable - exportEvaluatedExamplesCallable; - private final OperationCallable - exportEvaluatedExamplesOperationCallable; - private final UnaryCallable - listModelEvaluationsCallable; - private final UnaryCallable - listModelEvaluationsPagedCallable; - private final UnaryCallable createDatasetCallable; - private final UnaryCallable getDatasetCallable; - private final UnaryCallable listDatasetsCallable; - private final UnaryCallable - listDatasetsPagedCallable; - private final UnaryCallable updateDatasetCallable; private final UnaryCallable getAnnotationSpecCallable; private final UnaryCallable getTableSpecCallable; private final UnaryCallable listTableSpecsCallable; @@ -339,14 +325,28 @@ public class GrpcAutoMlStub extends AutoMlStub { private final UnaryCallable getModelCallable; private final UnaryCallable listModelsCallable; private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable deleteModelCallable; + private final OperationCallable + deleteModelOperationCallable; private final UnaryCallable deployModelCallable; private final OperationCallable deployModelOperationCallable; private final UnaryCallable undeployModelCallable; private final OperationCallable undeployModelOperationCallable; + private final UnaryCallable exportModelCallable; + private final OperationCallable + exportModelOperationCallable; + private final UnaryCallable + exportEvaluatedExamplesCallable; + private final OperationCallable + exportEvaluatedExamplesOperationCallable; private final UnaryCallable getModelEvaluationCallable; + private final UnaryCallable + listModelEvaluationsCallable; + private final UnaryCallable + listModelEvaluationsPagedCallable; private final GrpcStubCallableFactory callableFactory; @@ -385,6 +385,58 @@ protected GrpcAutoMlStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + GrpcCallSettings createDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listDatasetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDatasetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListDatasetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDatasetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDatasetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("dataset.name", String.valueOf(request.getDataset().getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings deleteDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteDatasetMethodDescriptor) @@ -424,155 +476,49 @@ public Map extract(ExportDataRequest request) { } }) .build(); - GrpcCallSettings deleteModelTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteModelMethodDescriptor) + GrpcCallSettings getAnnotationSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAnnotationSpecMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(DeleteModelRequest request) { + public Map extract(GetAnnotationSpecRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } }) .build(); - GrpcCallSettings exportModelTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(exportModelMethodDescriptor) + GrpcCallSettings getTableSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTableSpecMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(ExportModelRequest request) { + public Map extract(GetTableSpecRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } }) .build(); - GrpcCallSettings - exportEvaluatedExamplesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(exportEvaluatedExamplesMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ExportEvaluatedExamplesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings - listModelEvaluationsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listModelEvaluationsMethodDescriptor) + GrpcCallSettings + listTableSpecsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTableSpecsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(ListModelEvaluationsRequest request) { + public Map extract(ListTableSpecsRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } }) .build(); - GrpcCallSettings createDatasetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createDatasetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateDatasetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getDatasetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getDatasetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetDatasetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings listDatasetsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listDatasetsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListDatasetsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings updateDatasetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateDatasetMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateDatasetRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("dataset.name", String.valueOf(request.getDataset().getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getAnnotationSpecTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getAnnotationSpecMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetAnnotationSpecRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings getTableSpecTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getTableSpecMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetTableSpecRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); - GrpcCallSettings - listTableSpecsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listTableSpecsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListTableSpecsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings updateTableSpecTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateTableSpecMethodDescriptor) + GrpcCallSettings updateTableSpecTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateTableSpecMethodDescriptor) .setParamsExtractor( new RequestParamsExtractor() { @Override @@ -663,6 +609,19 @@ public Map extract(ListModelsRequest request) { } }) .build(); + GrpcCallSettings deleteModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings deployModelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deployModelMethodDescriptor) @@ -689,6 +648,33 @@ public Map extract(UndeployModelRequest request) { } }) .build(); + GrpcCallSettings exportModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportModelMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportModelRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + exportEvaluatedExamplesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportEvaluatedExamplesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportEvaluatedExamplesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings getModelEvaluationTransportSettings = GrpcCallSettings.newBuilder() @@ -703,7 +689,36 @@ public Map extract(GetModelEvaluationRequest request) { } }) .build(); + GrpcCallSettings + listModelEvaluationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelEvaluationsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListModelEvaluationsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + this.createDatasetCallable = + callableFactory.createUnaryCallable( + createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); + this.getDatasetCallable = + callableFactory.createUnaryCallable( + getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); + this.listDatasetsCallable = + callableFactory.createUnaryCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.listDatasetsPagedCallable = + callableFactory.createPagedCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.updateDatasetCallable = + callableFactory.createUnaryCallable( + updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); this.deleteDatasetCallable = callableFactory.createUnaryCallable( deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); @@ -731,60 +746,6 @@ public Map extract(GetModelEvaluationRequest request) { settings.exportDataOperationSettings(), clientContext, this.operationsStub); - this.deleteModelCallable = - callableFactory.createUnaryCallable( - deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); - this.deleteModelOperationCallable = - callableFactory.createOperationCallable( - deleteModelTransportSettings, - settings.deleteModelOperationSettings(), - clientContext, - this.operationsStub); - this.exportModelCallable = - callableFactory.createUnaryCallable( - exportModelTransportSettings, settings.exportModelSettings(), clientContext); - this.exportModelOperationCallable = - callableFactory.createOperationCallable( - exportModelTransportSettings, - settings.exportModelOperationSettings(), - clientContext, - this.operationsStub); - this.exportEvaluatedExamplesCallable = - callableFactory.createUnaryCallable( - exportEvaluatedExamplesTransportSettings, - settings.exportEvaluatedExamplesSettings(), - clientContext); - this.exportEvaluatedExamplesOperationCallable = - callableFactory.createOperationCallable( - exportEvaluatedExamplesTransportSettings, - settings.exportEvaluatedExamplesOperationSettings(), - clientContext, - this.operationsStub); - this.listModelEvaluationsCallable = - callableFactory.createUnaryCallable( - listModelEvaluationsTransportSettings, - settings.listModelEvaluationsSettings(), - clientContext); - this.listModelEvaluationsPagedCallable = - callableFactory.createPagedCallable( - listModelEvaluationsTransportSettings, - settings.listModelEvaluationsSettings(), - clientContext); - this.createDatasetCallable = - callableFactory.createUnaryCallable( - createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); - this.getDatasetCallable = - callableFactory.createUnaryCallable( - getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); - this.listDatasetsCallable = - callableFactory.createUnaryCallable( - listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); - this.listDatasetsPagedCallable = - callableFactory.createPagedCallable( - listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); - this.updateDatasetCallable = - callableFactory.createUnaryCallable( - updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); this.getAnnotationSpecCallable = callableFactory.createUnaryCallable( getAnnotationSpecTransportSettings, @@ -832,6 +793,15 @@ public Map extract(GetModelEvaluationRequest request) { this.listModelsPagedCallable = callableFactory.createPagedCallable( listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.deleteModelCallable = + callableFactory.createUnaryCallable( + deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); + this.deleteModelOperationCallable = + callableFactory.createOperationCallable( + deleteModelTransportSettings, + settings.deleteModelOperationSettings(), + clientContext, + this.operationsStub); this.deployModelCallable = callableFactory.createUnaryCallable( deployModelTransportSettings, settings.deployModelSettings(), clientContext); @@ -850,11 +820,41 @@ public Map extract(GetModelEvaluationRequest request) { settings.undeployModelOperationSettings(), clientContext, this.operationsStub); + this.exportModelCallable = + callableFactory.createUnaryCallable( + exportModelTransportSettings, settings.exportModelSettings(), clientContext); + this.exportModelOperationCallable = + callableFactory.createOperationCallable( + exportModelTransportSettings, + settings.exportModelOperationSettings(), + clientContext, + this.operationsStub); + this.exportEvaluatedExamplesCallable = + callableFactory.createUnaryCallable( + exportEvaluatedExamplesTransportSettings, + settings.exportEvaluatedExamplesSettings(), + clientContext); + this.exportEvaluatedExamplesOperationCallable = + callableFactory.createOperationCallable( + exportEvaluatedExamplesTransportSettings, + settings.exportEvaluatedExamplesOperationSettings(), + clientContext, + this.operationsStub); this.getModelEvaluationCallable = callableFactory.createUnaryCallable( getModelEvaluationTransportSettings, settings.getModelEvaluationSettings(), clientContext); + this.listModelEvaluationsCallable = + callableFactory.createUnaryCallable( + listModelEvaluationsTransportSettings, + settings.listModelEvaluationsSettings(), + clientContext); + this.listModelEvaluationsPagedCallable = + callableFactory.createPagedCallable( + listModelEvaluationsTransportSettings, + settings.listModelEvaluationsSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -864,6 +864,26 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + public UnaryCallable createDatasetCallable() { + return createDatasetCallable; + } + + public UnaryCallable getDatasetCallable() { + return getDatasetCallable; + } + + public UnaryCallable listDatasetsPagedCallable() { + return listDatasetsPagedCallable; + } + + public UnaryCallable listDatasetsCallable() { + return listDatasetsCallable; + } + + public UnaryCallable updateDatasetCallable() { + return updateDatasetCallable; + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable deleteDatasetOperationCallable() { @@ -894,67 +914,6 @@ public UnaryCallable exportDataCallable() { return exportDataCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - deleteModelOperationCallable() { - return deleteModelOperationCallable; - } - - public UnaryCallable deleteModelCallable() { - return deleteModelCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - exportModelOperationCallable() { - return exportModelOperationCallable; - } - - public UnaryCallable exportModelCallable() { - return exportModelCallable; - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable - exportEvaluatedExamplesOperationCallable() { - return exportEvaluatedExamplesOperationCallable; - } - - public UnaryCallable - exportEvaluatedExamplesCallable() { - return exportEvaluatedExamplesCallable; - } - - public UnaryCallable - listModelEvaluationsPagedCallable() { - return listModelEvaluationsPagedCallable; - } - - public UnaryCallable - listModelEvaluationsCallable() { - return listModelEvaluationsCallable; - } - - public UnaryCallable createDatasetCallable() { - return createDatasetCallable; - } - - public UnaryCallable getDatasetCallable() { - return getDatasetCallable; - } - - public UnaryCallable listDatasetsPagedCallable() { - return listDatasetsPagedCallable; - } - - public UnaryCallable listDatasetsCallable() { - return listDatasetsCallable; - } - - public UnaryCallable updateDatasetCallable() { - return updateDatasetCallable; - } - public UnaryCallable getAnnotationSpecCallable() { return getAnnotationSpecCallable; } @@ -1015,6 +974,16 @@ public UnaryCallable listModelsCallable() return listModelsCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteModelOperationCallable() { + return deleteModelOperationCallable; + } + + public UnaryCallable deleteModelCallable() { + return deleteModelCallable; + } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable deployModelOperationCallable() { @@ -1035,10 +1004,41 @@ public UnaryCallable undeployModelCallable() { return undeployModelCallable; } + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportModelOperationCallable() { + return exportModelOperationCallable; + } + + public UnaryCallable exportModelCallable() { + return exportModelCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportEvaluatedExamplesOperationCallable() { + return exportEvaluatedExamplesOperationCallable; + } + + public UnaryCallable + exportEvaluatedExamplesCallable() { + return exportEvaluatedExamplesCallable; + } + public UnaryCallable getModelEvaluationCallable() { return getModelEvaluationCallable; } + public UnaryCallable + listModelEvaluationsPagedCallable() { + return listModelEvaluationsPagedCallable; + } + + public UnaryCallable + listModelEvaluationsCallable() { + return listModelEvaluationsCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java index c8086bd8e..a9f339fba 100644 --- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java +++ b/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/PredictionServiceStubSettings.java @@ -199,12 +199,9 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "idempotent", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -213,17 +210,16 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("default", settings); + definitions.put("no_retry_1_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -259,20 +255,20 @@ private static Builder initDefaults(Builder builder) { builder .predictSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .batchPredictSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .batchPredictOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(BatchPredictResult.class)) diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java index 3dd7cee44..903f5e22c 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1/AutoMlClientTest.java @@ -88,98 +88,6 @@ public void tearDown() throws Exception { client.close(); } - @Test - @SuppressWarnings("all") - public void deleteDatasetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deleteDatasetTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - - Empty actualResponse = client.deleteDatasetAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteDatasetRequest actualRequest = (DeleteDatasetRequest) actualRequests.get(0); - - Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteDatasetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - - client.deleteDatasetAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void deleteModelTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deleteModelTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - - Empty actualResponse = client.deleteModelAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteModelRequest actualRequest = (DeleteModelRequest) actualRequests.get(0); - - Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteModelExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - - client.deleteModelAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - @Test @SuppressWarnings("all") public void createDatasetTest() throws Exception { @@ -392,6 +300,52 @@ public void updateDatasetExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deleteDatasetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatasetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + Empty actualResponse = client.deleteDatasetAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetRequest actualRequest = (DeleteDatasetRequest) actualRequests.get(0); + + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + + client.deleteDatasetAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void importDataTest() throws Exception { @@ -691,6 +645,52 @@ public void listModelsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deleteModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Empty actualResponse = client.deleteModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteModelRequest actualRequest = (DeleteModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.deleteModelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void updateModelTest() { diff --git a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java index fd5231b8d..4ec1a3a47 100644 --- a/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java +++ b/google-cloud-automl/src/test/java/com/google/cloud/automl/v1beta1/AutoMlClientTest.java @@ -91,74 +91,34 @@ public void tearDown() throws Exception { @Test @SuppressWarnings("all") - public void deleteDatasetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deleteDatasetTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - + public void createDatasetTest() { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - - Empty actualResponse = client.deleteDatasetAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteDatasetRequest actualRequest = (DeleteDatasetRequest) actualRequests.get(0); - - Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteDatasetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - - client.deleteDatasetAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void importDataTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("importDataTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + int exampleCount = 1517063674; + String etag = "etag3123477"; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name.toString()) + .setDisplayName(displayName) + .setDescription(description) + .setExampleCount(exampleCount) + .setEtag(etag) .build(); - mockAutoMl.addResponse(resultOperation); + mockAutoMl.addResponse(expectedResponse); - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - InputConfig inputConfig = InputConfig.newBuilder().build(); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dataset dataset = Dataset.newBuilder().build(); - Empty actualResponse = client.importDataAsync(name, inputConfig).get(); + Dataset actualResponse = client.createDataset(parent, dataset); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ImportDataRequest actualRequest = (ImportDataRequest) actualRequests.get(0); + CreateDatasetRequest actualRequest = (CreateDatasetRequest) actualRequests.get(0); - Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); - Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(dataset, actualRequest.getDataset()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -167,47 +127,49 @@ public void importDataTest() throws Exception { @Test @SuppressWarnings("all") - public void importDataExceptionTest() throws Exception { + public void createDatasetExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - InputConfig inputConfig = InputConfig.newBuilder().build(); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Dataset dataset = Dataset.newBuilder().build(); - client.importDataAsync(name, inputConfig).get(); + client.createDataset(parent, dataset); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void exportDataTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("exportDataTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) + public void getDatasetTest() { + DatasetName name2 = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + int exampleCount = 1517063674; + String etag = "etag3123477"; + Dataset expectedResponse = + Dataset.newBuilder() + .setName(name2.toString()) + .setDisplayName(displayName) + .setDescription(description) + .setExampleCount(exampleCount) + .setEtag(etag) .build(); - mockAutoMl.addResponse(resultOperation); + mockAutoMl.addResponse(expectedResponse); DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - OutputConfig outputConfig = OutputConfig.newBuilder().build(); - Empty actualResponse = client.exportDataAsync(name, outputConfig).get(); + Dataset actualResponse = client.getDataset(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ExportDataRequest actualRequest = (ExportDataRequest) actualRequests.get(0); + GetDatasetRequest actualRequest = (GetDatasetRequest) actualRequests.get(0); Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -216,196 +178,46 @@ public void exportDataTest() throws Exception { @Test @SuppressWarnings("all") - public void exportDataExceptionTest() throws Exception { + public void getDatasetExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - OutputConfig outputConfig = OutputConfig.newBuilder().build(); - - client.exportDataAsync(name, outputConfig).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void deleteModelTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deleteModelTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - - Empty actualResponse = client.deleteModelAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteModelRequest actualRequest = (DeleteModelRequest) actualRequests.get(0); - - Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteModelExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - - client.deleteModelAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void exportModelTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("exportModelTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); - Empty actualResponse = client.exportModelAsync(name, outputConfig).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ExportModelRequest actualRequest = (ExportModelRequest) actualRequests.get(0); - - Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void exportModelExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); - - client.exportModelAsync(name, outputConfig).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - @SuppressWarnings("all") - public void exportEvaluatedExamplesTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("exportEvaluatedExamplesTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockAutoMl.addResponse(resultOperation); - - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - ExportEvaluatedExamplesOutputConfig outputConfig = - ExportEvaluatedExamplesOutputConfig.newBuilder().build(); - - Empty actualResponse = client.exportEvaluatedExamplesAsync(name, outputConfig).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAutoMl.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ExportEvaluatedExamplesRequest actualRequest = - (ExportEvaluatedExamplesRequest) actualRequests.get(0); - - Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); - Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void exportEvaluatedExamplesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockAutoMl.addException(exception); - - try { - ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); - ExportEvaluatedExamplesOutputConfig outputConfig = - ExportEvaluatedExamplesOutputConfig.newBuilder().build(); - - client.exportEvaluatedExamplesAsync(name, outputConfig).get(); + client.getDataset(name); Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } catch (InvalidArgumentException e) { + // Expected exception } } @Test @SuppressWarnings("all") - public void listModelEvaluationsTest() { + public void listDatasetsTest() { String nextPageToken = ""; - ModelEvaluation modelEvaluationElement = ModelEvaluation.newBuilder().build(); - List modelEvaluation = Arrays.asList(modelEvaluationElement); - ListModelEvaluationsResponse expectedResponse = - ListModelEvaluationsResponse.newBuilder() + Dataset datasetsElement = Dataset.newBuilder().build(); + List datasets = Arrays.asList(datasetsElement); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() .setNextPageToken(nextPageToken) - .addAllModelEvaluation(modelEvaluation) + .addAllDatasets(datasets) .build(); mockAutoMl.addResponse(expectedResponse); - ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - ListModelEvaluationsPagedResponse pagedListResponse = client.listModelEvaluations(parent); + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getModelEvaluationList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListModelEvaluationsRequest actualRequest = (ListModelEvaluationsRequest) actualRequests.get(0); + ListDatasetsRequest actualRequest = (ListDatasetsRequest) actualRequests.get(0); - Assert.assertEquals(parent, ModelName.parse(actualRequest.getParent())); + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -414,14 +226,14 @@ public void listModelEvaluationsTest() { @Test @SuppressWarnings("all") - public void listModelEvaluationsExceptionTest() throws Exception { + public void listDatasetsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { - ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listModelEvaluations(parent); + client.listDatasets(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -430,7 +242,7 @@ public void listModelEvaluationsExceptionTest() throws Exception { @Test @SuppressWarnings("all") - public void createDatasetTest() { + public void updateDatasetTest() { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); String displayName = "displayName1615086568"; String description = "description-1724546052"; @@ -446,17 +258,15 @@ public void createDatasetTest() { .build(); mockAutoMl.addResponse(expectedResponse); - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Dataset dataset = Dataset.newBuilder().build(); - Dataset actualResponse = client.createDataset(parent, dataset); + Dataset actualResponse = client.updateDataset(dataset); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateDatasetRequest actualRequest = (CreateDatasetRequest) actualRequests.get(0); + UpdateDatasetRequest actualRequest = (UpdateDatasetRequest) actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); Assert.assertEquals(dataset, actualRequest.getDataset()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -466,15 +276,14 @@ public void createDatasetTest() { @Test @SuppressWarnings("all") - public void createDatasetExceptionTest() throws Exception { + public void updateDatasetExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Dataset dataset = Dataset.newBuilder().build(); - client.createDataset(parent, dataset); + client.updateDataset(dataset); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -483,30 +292,24 @@ public void createDatasetExceptionTest() throws Exception { @Test @SuppressWarnings("all") - public void getDatasetTest() { - DatasetName name2 = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; - int exampleCount = 1517063674; - String etag = "etag3123477"; - Dataset expectedResponse = - Dataset.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) - .setExampleCount(exampleCount) - .setEtag(etag) + public void deleteDatasetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatasetTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockAutoMl.addResponse(expectedResponse); + mockAutoMl.addResponse(resultOperation); DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - Dataset actualResponse = client.getDataset(name); + Empty actualResponse = client.deleteDatasetAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetDatasetRequest actualRequest = (GetDatasetRequest) actualRequests.get(0); + DeleteDatasetRequest actualRequest = (DeleteDatasetRequest) actualRequests.get(0); Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); Assert.assertTrue( @@ -517,46 +320,46 @@ public void getDatasetTest() { @Test @SuppressWarnings("all") - public void getDatasetExceptionTest() throws Exception { + public void deleteDatasetExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - client.getDataset(name); + client.deleteDatasetAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void listDatasetsTest() { - String nextPageToken = ""; - Dataset datasetsElement = Dataset.newBuilder().build(); - List datasets = Arrays.asList(datasetsElement); - ListDatasetsResponse expectedResponse = - ListDatasetsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllDatasets(datasets) + public void importDataTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockAutoMl.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + mockAutoMl.addResponse(resultOperation); - ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + InputConfig inputConfig = InputConfig.newBuilder().build(); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + Empty actualResponse = client.importDataAsync(name, inputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListDatasetsRequest actualRequest = (ListDatasetsRequest) actualRequests.get(0); + ImportDataRequest actualRequest = (ImportDataRequest) actualRequests.get(0); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertEquals(inputConfig, actualRequest.getInputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -565,48 +368,47 @@ public void listDatasetsTest() { @Test @SuppressWarnings("all") - public void listDatasetsExceptionTest() throws Exception { + public void importDataExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + InputConfig inputConfig = InputConfig.newBuilder().build(); - client.listDatasets(parent); + client.importDataAsync(name, inputConfig).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test @SuppressWarnings("all") - public void updateDatasetTest() { - DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; - int exampleCount = 1517063674; - String etag = "etag3123477"; - Dataset expectedResponse = - Dataset.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) - .setExampleCount(exampleCount) - .setEtag(etag) + public void exportDataTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportDataTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) .build(); - mockAutoMl.addResponse(expectedResponse); + mockAutoMl.addResponse(resultOperation); - Dataset dataset = Dataset.newBuilder().build(); + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); - Dataset actualResponse = client.updateDataset(dataset); + Empty actualResponse = client.exportDataAsync(name, outputConfig).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAutoMl.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateDatasetRequest actualRequest = (UpdateDatasetRequest) actualRequests.get(0); + ExportDataRequest actualRequest = (ExportDataRequest) actualRequests.get(0); - Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertEquals(name, DatasetName.parse(actualRequest.getName())); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -615,17 +417,20 @@ public void updateDatasetTest() { @Test @SuppressWarnings("all") - public void updateDatasetExceptionTest() throws Exception { + public void exportDataExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAutoMl.addException(exception); try { - Dataset dataset = Dataset.newBuilder().build(); + DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + OutputConfig outputConfig = OutputConfig.newBuilder().build(); - client.updateDataset(dataset); + client.exportDataAsync(name, outputConfig).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @@ -1124,6 +929,52 @@ public void listModelsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deleteModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + Empty actualResponse = client.deleteModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteModelRequest actualRequest = (DeleteModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.deleteModelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void deployModelTest() throws Exception { @@ -1216,6 +1067,107 @@ public void undeployModelExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void exportModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + + Empty actualResponse = client.exportModelAsync(name, outputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportModelRequest actualRequest = (ExportModelRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void exportModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); + + client.exportModelAsync(name, outputConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void exportEvaluatedExamplesTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportEvaluatedExamplesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAutoMl.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ExportEvaluatedExamplesOutputConfig outputConfig = + ExportEvaluatedExamplesOutputConfig.newBuilder().build(); + + Empty actualResponse = client.exportEvaluatedExamplesAsync(name, outputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportEvaluatedExamplesRequest actualRequest = + (ExportEvaluatedExamplesRequest) actualRequests.get(0); + + Assert.assertEquals(name, ModelName.parse(actualRequest.getName())); + Assert.assertEquals(outputConfig, actualRequest.getOutputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void exportEvaluatedExamplesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + ExportEvaluatedExamplesOutputConfig outputConfig = + ExportEvaluatedExamplesOutputConfig.newBuilder().build(); + + client.exportEvaluatedExamplesAsync(name, outputConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test @SuppressWarnings("all") public void getModelEvaluationTest() { @@ -1266,4 +1218,52 @@ public void getModelEvaluationExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void listModelEvaluationsTest() { + String nextPageToken = ""; + ModelEvaluation modelEvaluationElement = ModelEvaluation.newBuilder().build(); + List modelEvaluation = Arrays.asList(modelEvaluationElement); + ListModelEvaluationsResponse expectedResponse = + ListModelEvaluationsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllModelEvaluation(modelEvaluation) + .build(); + mockAutoMl.addResponse(expectedResponse); + + ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + ListModelEvaluationsPagedResponse pagedListResponse = client.listModelEvaluations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelEvaluationList().get(0), resources.get(0)); + + List actualRequests = mockAutoMl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListModelEvaluationsRequest actualRequest = (ListModelEvaluationsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ModelName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listModelEvaluationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAutoMl.addException(exception); + + try { + ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); + + client.listModelEvaluations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } } diff --git a/synth.metadata b/synth.metadata index 5ecffe285..02e1299bb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,23 +11,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-automl.git", - "sha": "4e29c3653a3e2b847f8a2d440baa3ccbd226a7a9" + "sha": "77e214d839be1381472fe45c97106bf400ebfbba" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c4e37010d74071851ff24121f522e802231ac86e", - "internalRef": "313460921" + "sha": "5b85137bf6fb01dcf8a949a6a04eee6ed0c22bec", + "internalRef": "317760971" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c4e37010d74071851ff24121f522e802231ac86e", - "internalRef": "313460921" + "sha": "5b85137bf6fb01dcf8a949a6a04eee6ed0c22bec", + "internalRef": "317760971" } }, {