The resource names are assigned by the server. The server never reuses names that it has - * created after the resources with those names are deleted. - * - *
An ID of a resource is the last element of the item's resource name. For - * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item - * is `{dataset_id}`. - * - *
Currently the only supported `location_id` is "us-central1". - * - *
On any input that is documented to expect a string parameter in snake_case or kebab-case, - * either of those cases is accepted. - * - *
This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *
- *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = autoMlClient.createDataset(parent, dataset);
- * }
- *
- *
- *
- * Note: close() needs to be called on the autoMlClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *
The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *
See the individual methods for example code. - * - *
Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *
This class can be customized by passing in a custom instance of AutoMlSettings to create(). - * For example: - * - *
To customize credentials: - * - *
- *
- * AutoMlSettings autoMlSettings =
- * AutoMlSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * AutoMlClient autoMlClient =
- * AutoMlClient.create(autoMlSettings);
- *
- *
- *
- * To customize the endpoint:
- *
- *
- *
- * AutoMlSettings autoMlSettings =
- * AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AutoMlClient autoMlClient =
- * AutoMlClient.create(autoMlSettings);
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class AutoMlClient implements BackgroundResource {
- private final AutoMlSettings settings;
- private final AutoMlStub stub;
- private final OperationsClient operationsClient;
-
- /** Constructs an instance of AutoMlClient with default settings. */
- public static final AutoMlClient create() throws IOException {
- return create(AutoMlSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of AutoMlClient, using the given settings. The channels are created
- * based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final AutoMlClient create(AutoMlSettings settings) throws IOException {
- return new AutoMlClient(settings);
- }
-
- /**
- * Constructs an instance of AutoMlClient, using the given stub for making calls. This is for
- * advanced usage - prefer to use AutoMlSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final AutoMlClient create(AutoMlStub stub) {
- return new AutoMlClient(stub);
- }
-
- /**
- * Constructs an instance of AutoMlClient, using the given settings. This is protected so that it
- * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
- */
- protected AutoMlClient(AutoMlSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((AutoMlStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected AutoMlClient(AutoMlStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final AutoMlSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public AutoMlStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- 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 OperationFutureSample 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 OperationFutureSample 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 OperationFutureSample 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 OperationCallableSample 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 UnaryCallableFor 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()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * autoMlClient.importDataAsync(name, inputConfig).get();
- * }
- *
- *
- * @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 OperationFutureFor 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()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * autoMlClient.importDataAsync(name.toString(), inputConfig).get();
- * }
- *
- *
- * @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 OperationFutureFor 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()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportDataRequest request = ImportDataRequest.newBuilder()
- * .setName(name.toString())
- * .setInputConfig(inputConfig)
- * .build();
- * autoMlClient.importDataAsync(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 OperationFutureFor 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()) {
- * 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();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallableFor 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()) {
- * 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();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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 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 OperationFutureSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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 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 OperationFutureSample 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)
- * .build();
- * autoMlClient.exportDataAsync(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 OperationFutureSample 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)
- * .build();
- * 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 OperationCallableSample 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)
- * .build();
- * ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallableSample 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 OperationFutureSample 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 OperationFutureSample 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 OperationFutureSample 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 OperationCallableSample 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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
- * autoMlClient.exportModelAsync(name, outputConfig).get();
- * }
- *
- *
- * @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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
- * autoMlClient.exportModelAsync(name.toString(), outputConfig).get();
- * }
- *
- *
- * @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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * 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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallableThis 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. - * - *
Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
- * autoMlClient.exportEvaluatedExamplesAsync(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.
- * @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 OperationFutureThis 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. - * - *
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();
- * }
- *
- *
- * @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 OperationFutureThis 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. - * - *
Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
- * ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * autoMlClient.exportEvaluatedExamplesAsync(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 OperationFutureThis 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. - * - *
Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
- * ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * 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 OperationCallableThis 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. - * - *
Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportEvaluatedExamplesOutputConfig outputConfig = ExportEvaluatedExamplesOutputConfig.newBuilder().build();
- * ExportEvaluatedExamplesRequest request = ExportEvaluatedExamplesRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * ApiFuture<Operation> future = autoMlClient.exportEvaluatedExamplesCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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 ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent) {
- ListModelEvaluationsRequest request =
- ListModelEvaluationsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- return listModelEvaluations(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists model evaluations.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent.toString()).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 ListModelEvaluationsPagedResponse listModelEvaluations(String parent) {
- ListModelEvaluationsRequest request =
- ListModelEvaluationsRequest.newBuilder().setParent(parent).build();
- return listModelEvaluations(request);
- }
-
- // 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();
- * for (ModelEvaluation element : autoMlClient.listModelEvaluations(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 ListModelEvaluationsPagedResponse listModelEvaluations(
- ListModelEvaluationsRequest request) {
- return listModelEvaluationsPagedCallable().call(request);
- }
-
- // 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();
- * ApiFuture<ListModelEvaluationsPagedResponse> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request);
- * // Do something
- * for (ModelEvaluation element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallableSample 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;
- * }
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = autoMlClient.createDataset(parent, dataset);
- * }
- *
- *
- * @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
- */
- 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
- /**
- * Creates a dataset.
- *
- * 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);
- * }
- *
- *
- * @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
- */
- 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
- /**
- * Creates a dataset.
- *
- * 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)
- * .build();
- * 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
- */
- public final Dataset createDataset(CreateDatasetRequest request) {
- return createDatasetCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a dataset.
- *
- * 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)
- * .build();
- * ApiFuture<Dataset> future = autoMlClient.createDatasetCallable().futureCall(request);
- * // Do something
- * Dataset response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * 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 Dataset getDataset(DatasetName name) {
- GetDatasetRequest request =
- GetDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getDataset(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * Dataset response = autoMlClient.getDataset(name.toString());
- * }
- *
- *
- * @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 Dataset getDataset(String name) {
- GetDatasetRequest request = GetDatasetRequest.newBuilder().setName(name).build();
- return getDataset(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * GetDatasetRequest request = GetDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Dataset response = autoMlClient.getDataset(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 getDataset(GetDatasetRequest request) {
- return getDatasetCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * GetDatasetRequest request = GetDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request);
- * // Do something
- * Dataset response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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
- */
- 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
- /**
- * Lists datasets in a project.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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 ListDatasetsPagedResponse listDatasets(String parent) {
- ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build();
- return listDatasets(request);
- }
-
- // 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();
- * for (Dataset element : autoMlClient.listDatasets(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 ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) {
- return listDatasetsPagedCallable().call(request);
- }
-
- // 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();
- * ApiFuture<ListDatasetsPagedResponse> future = autoMlClient.listDatasetsPagedCallable().futureCall(request);
- * // Do something
- * for (Dataset element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallableSample 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 UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = autoMlClient.updateDataset(dataset);
- * }
- *
- *
- * @param dataset Required. The dataset which replaces the resource on the server.
- * @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);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * Dataset dataset = Dataset.newBuilder().build();
- * UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
- * .setDataset(dataset)
- * .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();
- * UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
- * .setDataset(dataset)
- * .build();
- * ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request);
- * // Do something
- * Dataset response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * AnnotationSpec response = autoMlClient.getAnnotationSpec(name);
- * }
- *
- *
- * @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 AnnotationSpec getAnnotationSpec(AnnotationSpecName name) {
- GetAnnotationSpecRequest request =
- GetAnnotationSpecRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- return getAnnotationSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets an annotation spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * AnnotationSpec response = autoMlClient.getAnnotationSpec(name.toString());
- * }
- *
- *
- * @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 AnnotationSpec getAnnotationSpec(String name) {
- GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder().setName(name).build();
- return getAnnotationSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets an annotation spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * 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 AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) {
- return getAnnotationSpecCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets an annotation spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request);
- * // Do something
- * AnnotationSpec response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
- * TableSpec response = autoMlClient.getTableSpec(name);
- * }
- *
- *
- * @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);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a table spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
- * TableSpec response = autoMlClient.getTableSpec(name.toString());
- * }
- *
- *
- * @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(String name) {
- GetTableSpecRequest request = GetTableSpecRequest.newBuilder().setName(name).build();
- return getTableSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a table spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
- * GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * 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 TableSpec getTableSpec(GetTableSpecRequest request) {
- return getTableSpecCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a table spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpecName name = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
- * GetTableSpecRequest request = GetTableSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<TableSpec> future = autoMlClient.getTableSpecCallable().futureCall(request);
- * // Do something
- * TableSpec response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * for (TableSpec element : autoMlClient.listTableSpecs(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @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 ListTableSpecsPagedResponse listTableSpecs(DatasetName parent) {
- ListTableSpecsRequest request =
- ListTableSpecsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- return listTableSpecs(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists table specs in a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * for (TableSpec element : autoMlClient.listTableSpecs(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @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 ListTableSpecsPagedResponse listTableSpecs(String parent) {
- ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder().setParent(parent).build();
- return listTableSpecs(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists table specs in a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * 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 ListTableSpecsPagedResponse listTableSpecs(ListTableSpecsRequest request) {
- return listTableSpecsPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists table specs in a dataset.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ListTableSpecsRequest request = ListTableSpecsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListTableSpecsPagedResponse> future = autoMlClient.listTableSpecsPagedCallable().futureCall(request);
- * // Do something
- * for (TableSpec element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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;
- * }
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpec tableSpec = TableSpec.newBuilder().build();
- * TableSpec response = autoMlClient.updateTableSpec(tableSpec);
- * }
- *
- *
- * @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 TableSpec updateTableSpec(TableSpec tableSpec) {
- UpdateTableSpecRequest request =
- UpdateTableSpecRequest.newBuilder().setTableSpec(tableSpec).build();
- return updateTableSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a table spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpec tableSpec = TableSpec.newBuilder().build();
- * UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
- * .setTableSpec(tableSpec)
- * .build();
- * 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 TableSpec updateTableSpec(UpdateTableSpecRequest request) {
- return updateTableSpecCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a table spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpec tableSpec = TableSpec.newBuilder().build();
- * UpdateTableSpecRequest request = UpdateTableSpecRequest.newBuilder()
- * .setTableSpec(tableSpec)
- * .build();
- * ApiFuture<TableSpec> future = autoMlClient.updateTableSpecCallable().futureCall(request);
- * // Do something
- * TableSpec response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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 ColumnSpec getColumnSpec(ColumnSpecName name) {
- GetColumnSpecRequest request =
- GetColumnSpecRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getColumnSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a column spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ColumnSpecName name = ColumnSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]");
- * ColumnSpec response = autoMlClient.getColumnSpec(name.toString());
- * }
- *
- *
- * @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(String name) {
- GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder().setName(name).build();
- return getColumnSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a column spec.
- *
- * 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);
- * }
- *
- *
- * @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 getColumnSpec(GetColumnSpecRequest request) {
- return getColumnSpecCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a column spec.
- *
- * 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();
- * ApiFuture<ColumnSpec> future = autoMlClient.getColumnSpecCallable().futureCall(request);
- * // Do something
- * ColumnSpec response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * TableSpecName parent = TableSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]");
- * for (ColumnSpec element : autoMlClient.listColumnSpecs(parent).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(TableSpecName parent) {
- ListColumnSpecsRequest request =
- ListColumnSpecsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- return listColumnSpecs(request);
- }
-
- // 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.toString()).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);
- }
-
- // 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]");
- * ListColumnSpecsRequest request = ListColumnSpecsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * 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 ListColumnSpecsPagedResponse listColumnSpecs(ListColumnSpecsRequest request) {
- return listColumnSpecsPagedCallable().call(request);
- }
-
- // 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]");
- * 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);
- * }
- * }
- *
- */
- public final UnaryCallableSample 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;
- * }
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
- * ColumnSpec response = autoMlClient.updateColumnSpec(columnSpec);
- * }
- *
- *
- * @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 ColumnSpec updateColumnSpec(ColumnSpec columnSpec) {
- UpdateColumnSpecRequest request =
- UpdateColumnSpecRequest.newBuilder().setColumnSpec(columnSpec).build();
- return updateColumnSpec(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a column spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
- * UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
- * .setColumnSpec(columnSpec)
- * .build();
- * 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 ColumnSpec updateColumnSpec(UpdateColumnSpecRequest request) {
- return updateColumnSpecCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a column spec.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ColumnSpec columnSpec = ColumnSpec.newBuilder().build();
- * UpdateColumnSpecRequest request = UpdateColumnSpecRequest.newBuilder()
- * .setColumnSpec(columnSpec)
- * .build();
- * ApiFuture<ColumnSpec> future = autoMlClient.updateColumnSpecCallable().futureCall(request);
- * // Do something
- * ColumnSpec response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * Model response = autoMlClient.createModelAsync(parent, model).get();
- * }
- *
- *
- * @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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample 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();
- * }
- *
- *
- * @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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample 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)
- * .build();
- * 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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample 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)
- * .build();
- * OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request);
- * // Do something
- * Model response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallableSample 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)
- * .build();
- * ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * Model response = autoMlClient.getModel(name);
- * }
- *
- *
- * @param name Required. Resource name of the model.
- * @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);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * Model response = autoMlClient.getModel(name.toString());
- * }
- *
- *
- * @param name Required. Resource name of the model.
- * @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);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * GetModelRequest request = GetModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * 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 Model getModel(GetModelRequest request) {
- return getModelCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Model element : autoMlClient.listModels(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @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 ListModelsPagedResponse listModels(LocationName parent) {
- ListModelsRequest request =
- ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
- return listModels(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists models.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Model element : autoMlClient.listModels(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @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 ListModelsPagedResponse listModels(String parent) {
- ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build();
- return listModels(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists models.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListModelsRequest request = ListModelsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Model element : autoMlClient.listModels(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 ListModelsPagedResponse listModels(ListModelsRequest request) {
- return listModelsPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists models.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * 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);
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListModelsRequest request = ListModelsRequest.newBuilder()
- * .setParent(parent.toString())
- * .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;
- * }
- * }
- * }
- *
- */
- public final UnaryCallable[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * autoMlClient.deployModelAsync(name).get();
- * }
- *
- *
- * @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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * autoMlClient.deployModelAsync(name.toString()).get();
- * }
- *
- *
- * @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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * autoMlClient.deployModelAsync(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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().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[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()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallableOnly 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 OperationFutureOnly 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.toString()).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 OperationFutureOnly 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]");
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * autoMlClient.undeployModelAsync(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 OperationFutureOnly 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]");
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().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 OperationCallableOnly 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]");
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
- * ModelEvaluation response = autoMlClient.getModelEvaluation(name);
- * }
- *
- *
- * @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);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model evaluation.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
- * ModelEvaluation response = autoMlClient.getModelEvaluation(name.toString());
- * }
- *
- *
- * @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(String name) {
- GetModelEvaluationRequest request =
- GetModelEvaluationRequest.newBuilder().setName(name).build();
- return getModelEvaluation(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model evaluation.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
- * GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * 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
- */
- public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest request) {
- return getModelEvaluationCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets a model evaluation.
- *
- * Sample code: - * - *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]");
- * GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request);
- * // Do something
- * ModelEvaluation response = future.get();
- * }
- *
- */
- public final UnaryCallableThe default instance has everything set to sensible defaults: - * - *
The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *
For example, to set the total timeout of createDataset to 30 seconds: - * - *
- *
- * AutoMlSettings.Builder autoMlSettingsBuilder =
- * AutoMlSettings.newBuilder();
- * autoMlSettingsBuilder
- * .createDatasetSettings()
- * .setRetrySettings(
- * autoMlSettingsBuilder.createDatasetSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30))
- * .build());
- * AutoMlSettings autoMlSettings = autoMlSettingsBuilder.build();
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class AutoMlSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction On any input that is documented to expect a string parameter in snake_case or kebab-case,
- * either of those cases is accepted.
- *
- * This class provides the ability to make remote calls to the backing service through method
- * calls that map to API methods. Sample code to get started:
- *
- * Note: close() needs to be called on the predictionServiceClient object to clean up resources
- * such as threads. In the example above, try-with-resources is used, which automatically calls
- * close().
- *
- * The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- * See the individual methods for example code.
- *
- * Many parameters require resource names to be formatted in a particular way. To assist with
- * these names, this class includes a format method for each type of name, and additionally a parse
- * method to extract the individual identifiers contained within names that are returned.
- *
- * This class can be customized by passing in a custom instance of PredictionServiceSettings to
- * create(). For example:
- *
- * To customize credentials:
- *
- * [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. *
- * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.
- *
- * Sample code:
- *
- * * For Image Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for an image, it will only produce results that have at least this confidence score. The
- * default is 0.5.
- * * For Image Object Detection: `score_threshold` - (float) When Model detects objects
- * on the image, it will only produce bounding boxes which have at least this confidence
- * score. Value in 0 to 1 range, default is 0.5. `max_bounding_box_count` - (int64) No more
- * than this number of bounding boxes will be returned in the response. Default is 100, the
- * requested value may be limited by server. * For Tables:
- * feature_imp<span>ortan</span>ce - (boolean) Whether feature importance should
- * be populated in the returned TablesAnnotation. The default is false.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final PredictResponse predict(
- ModelName name, ExamplePayload payload, Map [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. *
- * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.
- *
- * Sample code:
- *
- * * For Image Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for an image, it will only produce results that have at least this confidence score. The
- * default is 0.5.
- * * For Image Object Detection: `score_threshold` - (float) When Model detects objects
- * on the image, it will only produce bounding boxes which have at least this confidence
- * score. Value in 0 to 1 range, default is 0.5. `max_bounding_box_count` - (int64) No more
- * than this number of bounding boxes will be returned in the response. Default is 100, the
- * requested value may be limited by server. * For Tables:
- * feature_imp<span>ortan</span>ce - (boolean) Whether feature importance should
- * be populated in the returned TablesAnnotation. The default is false.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final PredictResponse predict(
- String name, ExamplePayload payload, Map [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. *
- * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.
- *
- * Sample code:
- *
- * [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. *
- * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.
- *
- * Sample code:
- *
- * Sample code:
- *
- * * For Text Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for a text snippet, it will only produce results that have at least this confidence score.
- * The default is 0.5.
- * * For Image Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for an image, it will only produce results that have at least this confidence score. The
- * default is 0.5.
- * * For Image Object Detection:
- * `score_threshold` - (float) When Model detects objects on the image, it will only
- * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range,
- * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding
- * boxes will be produced per image. Default is 100, the requested value may be limited by
- * server.
- * * For Video Classification :
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for a video, it will only produce results that have at least this confidence score. The
- * default is 0.5. `segment_classification` - (boolean) Set to true to request segment-level
- * classification. AutoML Video Intelligence returns labels and their confidence scores for
- * the entire segment of the video that user specified in the request configuration. The
- * default is "true". `shot_classification` - (boolean) Set to true to request shot-level
- * classification. AutoML Video Intelligence determines the boundaries for each camera shot in
- * the entire segment of the video that user specified in the request configuration. AutoML
- * Video Intelligence then returns labels and their confidence scores for each detected shot,
- * along with the start and end time of the shot. WARNING: Model evaluation is not done for
- * this classification type, the quality of it depends on training data, but there are no
- * metrics provided to describe that quality. The default is "false".
- * `1s_interval_classification` - (boolean) Set to true to request classification for a video
- * at one-second intervals. AutoML Video Intelligence returns labels and their confidence
- * scores for each second of the entire segment of the video that user specified in the
- * request configuration. WARNING: Model evaluation is not done for this classification type,
- * the quality of it depends on training data, but there are no metrics provided to describe
- * that quality. The default is "false".
- * * For Tables:
- * feature_imp<span>ortan</span>ce - (boolean) Whether feature importance
- * should be populated in the returned TablesAnnotations. The default is false.
- * * For Video Object Tracking:
- * `score_threshold` - (float) When Model detects objects on video frames, it will only
- * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range,
- * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding
- * boxes will be returned per frame. Default is 100, the requested value may be limited by
- * server. `min_bounding_box_size` - (float) Only bounding boxes with shortest edge at least
- * that long as a relative value of video frame size will be returned. Value in 0 to 1 range.
- * Default is 0.
- * @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 Sample code:
- *
- * * For Text Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for a text snippet, it will only produce results that have at least this confidence score.
- * The default is 0.5.
- * * For Image Classification:
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for an image, it will only produce results that have at least this confidence score. The
- * default is 0.5.
- * * For Image Object Detection:
- * `score_threshold` - (float) When Model detects objects on the image, it will only
- * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range,
- * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding
- * boxes will be produced per image. Default is 100, the requested value may be limited by
- * server.
- * * For Video Classification :
- * `score_threshold` - (float) A value from 0.0 to 1.0. When the model makes predictions
- * for a video, it will only produce results that have at least this confidence score. The
- * default is 0.5. `segment_classification` - (boolean) Set to true to request segment-level
- * classification. AutoML Video Intelligence returns labels and their confidence scores for
- * the entire segment of the video that user specified in the request configuration. The
- * default is "true". `shot_classification` - (boolean) Set to true to request shot-level
- * classification. AutoML Video Intelligence determines the boundaries for each camera shot in
- * the entire segment of the video that user specified in the request configuration. AutoML
- * Video Intelligence then returns labels and their confidence scores for each detected shot,
- * along with the start and end time of the shot. WARNING: Model evaluation is not done for
- * this classification type, the quality of it depends on training data, but there are no
- * metrics provided to describe that quality. The default is "false".
- * `1s_interval_classification` - (boolean) Set to true to request classification for a video
- * at one-second intervals. AutoML Video Intelligence returns labels and their confidence
- * scores for each second of the entire segment of the video that user specified in the
- * request configuration. WARNING: Model evaluation is not done for this classification type,
- * the quality of it depends on training data, but there are no metrics provided to describe
- * that quality. The default is "false".
- * * For Tables:
- * feature_imp<span>ortan</span>ce - (boolean) Whether feature importance
- * should be populated in the returned TablesAnnotations. The default is false.
- * * For Video Object Tracking:
- * `score_threshold` - (float) When Model detects objects on video frames, it will only
- * produce bounding boxes which have at least this confidence score. Value in 0 to 1 range,
- * default is 0.5. `max_bounding_box_count` - (int64) No more than this number of bounding
- * boxes will be returned per frame. Default is 100, the requested value may be limited by
- * server. `min_bounding_box_size` - (float) Only bounding boxes with shortest edge at least
- * that long as a relative value of video frame size will be returned. Value in 0 to 1 range.
- * Default is 0.
- * @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 Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of predict to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction The interfaces provided are listed below, along with usage samples.
- *
- * ======================= PredictionServiceClient =======================
- *
- * Service Description: AutoML Prediction API.
- *
- * On any input that is documented to expect a string parameter in snake_case or kebab-case,
- * either of those cases is accepted.
- *
- * Sample for PredictionServiceClient:
- *
- * Service Description: AutoML Server API.
- *
- * The resource names are assigned by the server. The server never reuses names that it has
- * created after the resources with those names are deleted.
- *
- * An ID of a resource is the last element of the item's resource name. For
- * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item
- * is `{dataset_id}`.
- *
- * Currently the only supported `location_id` is "us-central1".
- *
- * On any input that is documented to expect a string parameter in snake_case or kebab-case,
- * either of those cases is accepted.
- *
- * Sample for AutoMlClient:
- *
- * This class is for advanced usage and reflects the underlying API directly.
- */
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
-public abstract class AutoMlStub implements BackgroundResource {
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- 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
- *
- *
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * PredictResponse response = predictionServiceClient.predict(name, payload, params);
- * }
- *
- *
- *
- *
- *
- *
- *
- * To customize the endpoint:
- *
- *
- * PredictionServiceSettings predictionServiceSettings =
- * PredictionServiceSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * PredictionServiceClient predictionServiceClient =
- * PredictionServiceClient.create(predictionServiceSettings);
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class PredictionServiceClient implements BackgroundResource {
- private final PredictionServiceSettings settings;
- private final PredictionServiceStub stub;
- private final OperationsClient operationsClient;
-
- /** Constructs an instance of PredictionServiceClient with default settings. */
- public static final PredictionServiceClient create() throws IOException {
- return create(PredictionServiceSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of PredictionServiceClient, using the given settings. The channels are
- * created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final PredictionServiceClient create(PredictionServiceSettings settings)
- throws IOException {
- return new PredictionServiceClient(settings);
- }
-
- /**
- * Constructs an instance of PredictionServiceClient, using the given stub for making calls. This
- * is for advanced usage - prefer to use PredictionServiceSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final PredictionServiceClient create(PredictionServiceStub stub) {
- return new PredictionServiceClient(stub);
- }
-
- /**
- * Constructs an instance of PredictionServiceClient, using the given settings. This is protected
- * so that it is easy to make a subclass, but otherwise, the static factory methods should be
- * preferred.
- */
- protected PredictionServiceClient(PredictionServiceSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((PredictionServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected PredictionServiceClient(PredictionServiceStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final PredictionServiceSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public PredictionServiceStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Perform an online prediction. The prediction result will be directly returned in the response.
- * Available for following ML problems, and their expected request payloads: * Image
- * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image
- * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text
- * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text
- * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation
- * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column
- * values matching the columns of the model, up to 5MB. Not available for FORECASTING
- *
- *
- * PredictionServiceSettings predictionServiceSettings =
- * PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * PredictionServiceClient predictionServiceClient =
- * PredictionServiceClient.create(predictionServiceSettings);
- *
- *
- *
- * @param name Required. Name of the model requested to serve the prediction.
- * @param payload Required. Payload to perform a prediction on. The payload must match the problem
- * type that the model was trained to solve.
- * @param params Additional domain-specific parameters, any string must be up to 25000 characters
- * long.
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * PredictResponse response = predictionServiceClient.predict(name, payload, params);
- * }
- *
- *
- * @param name Required. Name of the model requested to serve the prediction.
- * @param payload Required. Payload to perform a prediction on. The payload must match the problem
- * type that the model was trained to solve.
- * @param params Additional domain-specific parameters, any string must be up to 25000 characters
- * long.
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * PredictResponse response = predictionServiceClient.predict(name.toString(), payload, params);
- * }
- *
- *
- * @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 PredictResponse predict(PredictRequest request) {
- return predictCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Perform an online prediction. The prediction result will be directly returned in the response.
- * Available for following ML problems, and their expected request payloads: * Image
- * Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image
- * Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text
- * Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text
- * Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation
- * - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column
- * values matching the columns of the model, up to 5MB. Not available for FORECASTING
- *
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setName(name.toString())
- * .setPayload(payload)
- * .build();
- * PredictResponse response = predictionServiceClient.predict(request);
- * }
- *
- */
- public final UnaryCallable
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setName(name.toString())
- * .setPayload(payload)
- * .build();
- * ApiFuture<PredictResponse> future = predictionServiceClient.predictCallable().futureCall(request);
- * // Do something
- * PredictResponse response = future.get();
- * }
- *
- *
- * @param name Required. Name of the model requested to serve the batch prediction.
- * @param inputConfig Required. The input configuration for batch prediction.
- * @param outputConfig Required. The Configuration specifying where output predictions should be
- * written.
- * @param params Required. Additional domain-specific parameters for the predictions, any string
- * must be up to 25000 characters long.
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
- * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * BatchPredictResult response = predictionServiceClient.batchPredictAsync(name, inputConfig, outputConfig, params).get();
- * }
- *
- *
- * @param name Required. Name of the model requested to serve the batch prediction.
- * @param inputConfig Required. The input configuration for batch prediction.
- * @param outputConfig Required. The Configuration specifying where output predictions should be
- * written.
- * @param params Required. Additional domain-specific parameters for the predictions, any string
- * must be up to 25000 characters long.
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
- * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * BatchPredictResult response = predictionServiceClient.batchPredictAsync(name.toString(), inputConfig, outputConfig, params).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
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
- * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * BatchPredictRequest request = BatchPredictRequest.newBuilder()
- * .setName(name.toString())
- * .setInputConfig(inputConfig)
- * .setOutputConfig(outputConfig)
- * .putAllParams(params)
- * .build();
- * BatchPredictResult response = predictionServiceClient.batchPredictAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
- * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * BatchPredictRequest request = BatchPredictRequest.newBuilder()
- * .setName(name.toString())
- * .setInputConfig(inputConfig)
- * .setOutputConfig(outputConfig)
- * .putAllParams(params)
- * .build();
- * OperationFuture<BatchPredictResult, OperationMetadata> future = predictionServiceClient.batchPredictOperationCallable().futureCall(request);
- * // Do something
- * BatchPredictResult response = future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * BatchPredictInputConfig inputConfig = BatchPredictInputConfig.newBuilder().build();
- * BatchPredictOutputConfig outputConfig = BatchPredictOutputConfig.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * BatchPredictRequest request = BatchPredictRequest.newBuilder()
- * .setName(name.toString())
- * .setInputConfig(inputConfig)
- * .setOutputConfig(outputConfig)
- * .putAllParams(params)
- * .build();
- * ApiFuture<Operation> future = predictionServiceClient.batchPredictCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class PredictionServiceSettings extends ClientSettings
- * PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
- * PredictionServiceSettings.newBuilder();
- * predictionServiceSettingsBuilder
- * .predictSettings()
- * .setRetrySettings(
- * predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30))
- * .build());
- * PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
- *
- *
- *
- *
- * ============ AutoMlClient ============
- *
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExamplePayload payload = ExamplePayload.newBuilder().build();
- * Map<String, String> params = new HashMap<>();
- * PredictResponse response = predictionServiceClient.predict(name, payload, params);
- * }
- *
- *
- *
- */
-@Generated("by gapic-generator")
-package com.google.cloud.automl.v1beta1;
-
-import javax.annotation.Generated;
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
deleted file mode 100644
index 20f0040ea..000000000
--- a/google-cloud-automl/src/main/java/com/google/cloud/automl/v1beta1/stub/AutoMlStub.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.automl.v1beta1.stub;
-
-import static com.google.cloud.automl.v1beta1.AutoMlClient.ListColumnSpecsPagedResponse;
-import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse;
-import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse;
-import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelsPagedResponse;
-import static com.google.cloud.automl.v1beta1.AutoMlClient.ListTableSpecsPagedResponse;
-
-import com.google.api.core.BetaApi;
-import com.google.api.gax.core.BackgroundResource;
-import com.google.api.gax.rpc.OperationCallable;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.cloud.automl.v1beta1.AnnotationSpec;
-import com.google.cloud.automl.v1beta1.ColumnSpec;
-import com.google.cloud.automl.v1beta1.CreateDatasetRequest;
-import com.google.cloud.automl.v1beta1.CreateModelRequest;
-import com.google.cloud.automl.v1beta1.Dataset;
-import com.google.cloud.automl.v1beta1.DeleteDatasetRequest;
-import com.google.cloud.automl.v1beta1.DeleteModelRequest;
-import com.google.cloud.automl.v1beta1.DeployModelRequest;
-import com.google.cloud.automl.v1beta1.ExportDataRequest;
-import com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest;
-import com.google.cloud.automl.v1beta1.ExportModelRequest;
-import com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest;
-import com.google.cloud.automl.v1beta1.GetColumnSpecRequest;
-import com.google.cloud.automl.v1beta1.GetDatasetRequest;
-import com.google.cloud.automl.v1beta1.GetModelEvaluationRequest;
-import com.google.cloud.automl.v1beta1.GetModelRequest;
-import com.google.cloud.automl.v1beta1.GetTableSpecRequest;
-import com.google.cloud.automl.v1beta1.ImportDataRequest;
-import com.google.cloud.automl.v1beta1.ListColumnSpecsRequest;
-import com.google.cloud.automl.v1beta1.ListColumnSpecsResponse;
-import com.google.cloud.automl.v1beta1.ListDatasetsRequest;
-import com.google.cloud.automl.v1beta1.ListDatasetsResponse;
-import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest;
-import com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse;
-import com.google.cloud.automl.v1beta1.ListModelsRequest;
-import com.google.cloud.automl.v1beta1.ListModelsResponse;
-import com.google.cloud.automl.v1beta1.ListTableSpecsRequest;
-import com.google.cloud.automl.v1beta1.ListTableSpecsResponse;
-import com.google.cloud.automl.v1beta1.Model;
-import com.google.cloud.automl.v1beta1.ModelEvaluation;
-import com.google.cloud.automl.v1beta1.OperationMetadata;
-import com.google.cloud.automl.v1beta1.TableSpec;
-import com.google.cloud.automl.v1beta1.UndeployModelRequest;
-import com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest;
-import com.google.cloud.automl.v1beta1.UpdateDatasetRequest;
-import com.google.cloud.automl.v1beta1.UpdateTableSpecRequest;
-import com.google.longrunning.Operation;
-import com.google.longrunning.stub.OperationsStub;
-import com.google.protobuf.Empty;
-import javax.annotation.Generated;
-
-// AUTO-GENERATED DOCUMENTATION AND CLASS
-/**
- * Base stub class for Cloud AutoML API.
- *
- *
- * try (AutoMlClient autoMlClient = AutoMlClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = autoMlClient.createDataset(parent, dataset);
- * }
- *
- *