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: + * 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * Dataset response = datasetServiceClient.getDataset(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the datasetServiceClient object to clean up resources such + *
Note: close() needs to be called on the DatasetServiceClient 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 @@ -83,30 +73,26 @@ * *
To customize credentials: * - *
- *
+ * {@code
* DatasetServiceSettings datasetServiceSettings =
* DatasetServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * DatasetServiceClient datasetServiceClient =
- * DatasetServiceClient.create(datasetServiceSettings);
- *
- *
+ * DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* DatasetServiceSettings datasetServiceSettings =
* DatasetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * DatasetServiceClient datasetServiceClient =
- * DatasetServiceClient.create(datasetServiceSettings);
- *
- *
+ * DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class DatasetServiceClient implements BackgroundResource { private final DatasetServiceSettings settings; private final DatasetServiceStub stub; @@ -128,7 +114,7 @@ public static final DatasetServiceClient create(DatasetServiceSettings settings) /** * Constructs an instance of DatasetServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use DatasetServiceSettings}. + * for advanced usage - prefer using create(DatasetServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final DatasetServiceClient create(DatasetServiceStub stub) { @@ -166,33 +152,19 @@ public DatasetServiceStub getStub() { * 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 + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a Dataset. * - *
Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the Dataset in. Format:
* `projects/{project}/locations/{location}`
* @param dataset Required. The Dataset to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * Dataset response = datasetServiceClient.createDatasetAsync(parent.toString(), dataset).get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the Dataset in. Format:
* `projects/{project}/locations/{location}`
* @param dataset Required. The Dataset to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFutureSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
- * .setParent(parent.toString())
- * .setDataset(dataset)
- * .build();
- * Dataset response = datasetServiceClient.createDatasetAsync(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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
- * .setParent(parent.toString())
- * .setDataset(dataset)
- * .build();
- * OperationFuture<Dataset, CreateDatasetOperationMetadata> future = datasetServiceClient.createDatasetOperationCallable().futureCall(request);
- * // Do something
- * Dataset 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Dataset dataset = Dataset.newBuilder().build();
- * CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
- * .setParent(parent.toString())
- * .setDataset(dataset)
- * .build();
- * ApiFuture<Operation> future = datasetServiceClient.createDatasetCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * Dataset response = datasetServiceClient.getDataset(name);
- * }
- *
- *
* @param name Required. The name of the Dataset resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -331,19 +237,10 @@ public final Dataset getDataset(DatasetName name) {
return getDataset(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Dataset.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * Dataset response = datasetServiceClient.getDataset(name.toString());
- * }
- *
- *
* @param name Required. The name of the Dataset resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -352,22 +249,10 @@ public final Dataset getDataset(String name) {
return getDataset(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Dataset.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * GetDatasetRequest request = GetDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Dataset response = datasetServiceClient.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
*/
@@ -375,42 +260,20 @@ public final Dataset getDataset(GetDatasetRequest request) {
return getDatasetCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Dataset.
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * GetDatasetRequest request = GetDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Dataset> future = datasetServiceClient.getDatasetCallable().futureCall(request);
- * // Do something
- * Dataset response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * Dataset dataset = Dataset.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Dataset response = datasetServiceClient.updateDataset(dataset, updateMask);
- * }
- *
- *
* @param dataset Required. The Dataset which replaces the resource on the server.
* @param updateMask Required. The update mask applies to the resource. For the `FieldMask`
* definition, see
@@ -425,24 +288,10 @@ public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) {
return updateDataset(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a Dataset.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * Dataset dataset = Dataset.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
- * .setDataset(dataset)
- * .setUpdateMask(updateMask)
- * .build();
- * Dataset response = datasetServiceClient.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
*/
@@ -450,45 +299,20 @@ public final Dataset updateDataset(UpdateDatasetRequest request) {
return updateDatasetCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a Dataset.
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * Dataset dataset = Dataset.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder()
- * .setDataset(dataset)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Dataset> future = datasetServiceClient.updateDatasetCallable().futureCall(request);
- * // Do something
- * Dataset response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The name of the Dataset's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -501,21 +325,10 @@ public final ListDatasetsPagedResponse listDatasets(LocationName parent) {
return listDatasets(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Datasets in a Location.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Dataset element : datasetServiceClient.listDatasets(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The name of the Dataset's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -525,24 +338,10 @@ public final ListDatasetsPagedResponse listDatasets(String parent) {
return listDatasets(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Datasets in a Location.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Dataset element : datasetServiceClient.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
*/
@@ -550,81 +349,35 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
return listDatasetsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Datasets in a Location.
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListDatasetsPagedResponse> future = datasetServiceClient.listDatasetsPagedCallable().futureCall(request);
- * // Do something
- * for (Dataset element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListDatasetsResponse response = datasetServiceClient.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * datasetServiceClient.deleteDatasetAsync(name).get();
- * }
- *
- *
* @param name Required. The resource name of the Dataset to delete. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * datasetServiceClient.deleteDatasetAsync(name.toString()).get();
- * }
- *
- *
* @param name Required. The resource name of the Dataset to delete. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * datasetServiceClient.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = datasetServiceClient.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = datasetServiceClient.deleteDatasetCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * List<ImportDataConfig> importConfigs = new ArrayList<>();
- * ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get();
- * }
- *
- *
* @param name Required. The name of the Dataset resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @param importConfigs Required. The desired input locations. The contents of all input locations
* will be imported in one batch.
* @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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * List<ImportDataConfig> importConfigs = new ArrayList<>();
- * ImportDataResponse response = datasetServiceClient.importDataAsync(name.toString(), importConfigs).get();
- * }
- *
- *
* @param name Required. The name of the Dataset resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @param importConfigs Required. The desired input locations. The contents of all input locations
* will be imported in one batch.
* @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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * List<ImportDataConfig> importConfigs = new ArrayList<>();
- * ImportDataRequest request = ImportDataRequest.newBuilder()
- * .setName(name.toString())
- * .addAllImportConfigs(importConfigs)
- * .build();
- * ImportDataResponse response = datasetServiceClient.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 OperationFutureSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * List<ImportDataConfig> importConfigs = new ArrayList<>();
- * ImportDataRequest request = ImportDataRequest.newBuilder()
- * .setName(name.toString())
- * .addAllImportConfigs(importConfigs)
- * .build();
- * OperationFuture<ImportDataResponse, ImportDataOperationMetadata> future = datasetServiceClient.importDataOperationCallable().futureCall(request);
- * // Do something
- * ImportDataResponse 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * List<ImportDataConfig> importConfigs = new ArrayList<>();
- * ImportDataRequest request = ImportDataRequest.newBuilder()
- * .setName(name.toString())
- * .addAllImportConfigs(importConfigs)
- * .build();
- * ApiFuture<Operation> future = datasetServiceClient.importDataCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
- * ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get();
- * }
- *
- *
* @param name Required. The name of the Dataset resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @param exportConfig 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
- * ExportDataResponse response = datasetServiceClient.exportDataAsync(name.toString(), exportConfig).get();
- * }
- *
- *
* @param name Required. The name of the Dataset resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @param exportConfig 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
- * ExportDataRequest request = ExportDataRequest.newBuilder()
- * .setName(name.toString())
- * .setExportConfig(exportConfig)
- * .build();
- * ExportDataResponse response = datasetServiceClient.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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
- * ExportDataRequest request = ExportDataRequest.newBuilder()
- * .setName(name.toString())
- * .setExportConfig(exportConfig)
- * .build();
- * OperationFuture<ExportDataResponse, ExportDataOperationMetadata> future = datasetServiceClient.exportDataOperationCallable().futureCall(request);
- * // Do something
- * ExportDataResponse 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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
- * ExportDataRequest request = ExportDataRequest.newBuilder()
- * .setName(name.toString())
- * .setExportConfig(exportConfig)
- * .build();
- * ApiFuture<Operation> future = datasetServiceClient.exportDataCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Dataset to list DataItems from. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1031,21 +585,10 @@ public final ListDataItemsPagedResponse listDataItems(DatasetName parent) {
return listDataItems(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataItems in a Dataset.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * for (DataItem element : datasetServiceClient.listDataItems(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Dataset to list DataItems from. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1055,24 +598,10 @@ public final ListDataItemsPagedResponse listDataItems(String parent) {
return listDataItems(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataItems in a Dataset.
*
- * Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (DataItem element : datasetServiceClient.listDataItems(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
*/
@@ -1080,75 +609,31 @@ public final ListDataItemsPagedResponse listDataItems(ListDataItemsRequest reque
return listDataItemsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataItems in a Dataset.
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListDataItemsPagedResponse> future = datasetServiceClient.listDataItemsPagedCallable().futureCall(request);
- * // Do something
- * for (DataItem element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
- * ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListDataItemsResponse response = datasetServiceClient.listDataItemsCallable().call(request);
- * for (DataItem element : response.getDataItemsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name);
- * }
- *
- *
* @param name Required. The name of the AnnotationSpec resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1161,19 +646,10 @@ public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { return getAnnotationSpec(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an AnnotationSpec. * - *
Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name.toString());
- * }
- *
- *
* @param name Required. The name of the AnnotationSpec resource. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1183,22 +659,10 @@ public final AnnotationSpec getAnnotationSpec(String name) { return getAnnotationSpec(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an AnnotationSpec. * - *
Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * AnnotationSpec response = datasetServiceClient.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
*/
@@ -1206,43 +670,20 @@ public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request)
return getAnnotationSpecCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets an AnnotationSpec.
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
- * GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<AnnotationSpec> future = datasetServiceClient.getAnnotationSpecCallable().futureCall(request);
- * // Do something
- * AnnotationSpec response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
- * for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the DataItem to list Annotations from. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1255,21 +696,10 @@ public final ListAnnotationsPagedResponse listAnnotations(DataItemName parent) { return listAnnotations(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Annotations belongs to a dataitem * - *
Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
- * for (Annotation element : datasetServiceClient.listAnnotations(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the DataItem to list Annotations from. Format:
* `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1279,24 +709,10 @@ public final ListAnnotationsPagedResponse listAnnotations(String parent) { return listAnnotations(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Annotations belongs to a dataitem * - *
Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
- * ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Annotation element : datasetServiceClient.listAnnotations(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
*/
@@ -1304,57 +720,22 @@ public final ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest
return listAnnotationsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Annotations belongs to a dataitem
*
* Sample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
- * ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListAnnotationsPagedResponse> future = datasetServiceClient.listAnnotationsPagedCallable().futureCall(request);
- * // Do something
- * for (Annotation element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
- * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
- * ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListAnnotationsResponse response = datasetServiceClient.listAnnotationsCallable().call(request);
- * for (Annotation element : response.getAnnotationsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getDataset to 30 seconds: * - *
- *
+ * {@code
* DatasetServiceSettings.Builder datasetServiceSettingsBuilder =
* DatasetServiceSettings.newBuilder();
* datasetServiceSettingsBuilder
* .getDatasetSettings()
* .setRetrySettings(
- * datasetServiceSettingsBuilder.getDatasetSettings().getRetrySettings().toBuilder()
+ * datasetServiceSettingsBuilder
+ * .getDatasetSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* DatasetServiceSettings datasetServiceSettings = datasetServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class DatasetServiceSettings extends ClientSettingsThis 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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * Endpoint response = endpointServiceClient.getEndpoint(name);
- * }
- *
- *
+ * 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 endpointServiceClient object to clean up resources + *
Note: close() needs to be called on the EndpointServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * @@ -85,30 +75,28 @@ * *
To customize credentials: * - *
- *
+ * {@code
* EndpointServiceSettings endpointServiceSettings =
* EndpointServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* EndpointServiceClient endpointServiceClient =
* EndpointServiceClient.create(endpointServiceSettings);
- *
- *
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* EndpointServiceSettings endpointServiceSettings =
* EndpointServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* EndpointServiceClient endpointServiceClient =
* EndpointServiceClient.create(endpointServiceSettings);
- *
- *
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class EndpointServiceClient implements BackgroundResource { private final EndpointServiceSettings settings; private final EndpointServiceStub stub; @@ -130,7 +118,7 @@ public static final EndpointServiceClient create(EndpointServiceSettings setting /** * Constructs an instance of EndpointServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer to use EndpointServiceSettings}. + * for advanced usage - prefer using create(EndpointServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EndpointServiceClient create(EndpointServiceStub stub) { @@ -168,33 +156,19 @@ public EndpointServiceStub getStub() { * 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 + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an Endpoint. * - *
Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the Endpoint in. Format:
* `projects/{project}/locations/{location}`
* @param endpoint Required. The Endpoint 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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * Endpoint response = endpointServiceClient.createEndpointAsync(parent.toString(), endpoint).get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the Endpoint in. Format:
* `projects/{project}/locations/{location}`
* @param endpoint Required. The Endpoint 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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * CreateEndpointRequest request = CreateEndpointRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEndpoint(endpoint)
- * .build();
- * Endpoint response = endpointServiceClient.createEndpointAsync(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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * CreateEndpointRequest request = CreateEndpointRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEndpoint(endpoint)
- * .build();
- * OperationFuture<Endpoint, CreateEndpointOperationMetadata> future = endpointServiceClient.createEndpointOperationCallable().futureCall(request);
- * // Do something
- * Endpoint 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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * CreateEndpointRequest request = CreateEndpointRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEndpoint(endpoint)
- * .build();
- * ApiFuture<Operation> future = endpointServiceClient.createEndpointCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * Endpoint response = endpointServiceClient.getEndpoint(name);
- * }
- *
- *
* @param name Required. The name of the Endpoint resource. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -334,19 +242,10 @@ public final Endpoint getEndpoint(EndpointName name) {
return getEndpoint(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets an Endpoint.
*
- * Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * Endpoint response = endpointServiceClient.getEndpoint(name.toString());
- * }
- *
- *
* @param name Required. The name of the Endpoint resource. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -356,22 +255,10 @@ public final Endpoint getEndpoint(String name) {
return getEndpoint(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets an Endpoint.
*
- * Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * GetEndpointRequest request = GetEndpointRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Endpoint response = endpointServiceClient.getEndpoint(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
*/
@@ -379,43 +266,20 @@ public final Endpoint getEndpoint(GetEndpointRequest request) {
return getEndpointCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets an Endpoint.
*
* Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * GetEndpointRequest request = GetEndpointRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Endpoint> future = endpointServiceClient.getEndpointCallable().futureCall(request);
- * // Do something
- * Endpoint response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location from which to list the Endpoints.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -428,21 +292,10 @@ public final ListEndpointsPagedResponse listEndpoints(LocationName parent) {
return listEndpoints(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Endpoints in a Location.
*
- * Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Endpoint element : endpointServiceClient.listEndpoints(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location from which to list the Endpoints.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -452,24 +305,10 @@ public final ListEndpointsPagedResponse listEndpoints(String parent) {
return listEndpoints(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Endpoints in a Location.
*
- * Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Endpoint element : endpointServiceClient.listEndpoints(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
*/
@@ -477,76 +316,31 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque
return listEndpointsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Endpoints in a Location.
*
* Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListEndpointsPagedResponse> future = endpointServiceClient.listEndpointsPagedCallable().futureCall(request);
- * // Do something
- * for (Endpoint element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListEndpointsResponse response = endpointServiceClient.listEndpointsCallable().call(request);
- * for (Endpoint element : response.getEndpointsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Endpoint response = endpointServiceClient.updateEndpoint(endpoint, updateMask);
- * }
- *
- *
* @param endpoint Required. The Endpoint which replaces the resource on the server.
* @param updateMask Required. The update mask applies to the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -557,24 +351,10 @@ public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) {
return updateEndpoint(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an Endpoint.
*
- * Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateEndpointRequest request = UpdateEndpointRequest.newBuilder()
- * .setEndpoint(endpoint)
- * .setUpdateMask(updateMask)
- * .build();
- * Endpoint response = endpointServiceClient.updateEndpoint(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
*/
@@ -582,49 +362,24 @@ public final Endpoint updateEndpoint(UpdateEndpointRequest request) {
return updateEndpointCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an Endpoint.
*
* Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * Endpoint endpoint = Endpoint.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateEndpointRequest request = UpdateEndpointRequest.newBuilder()
- * .setEndpoint(endpoint)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Endpoint> future = endpointServiceClient.updateEndpointCallable().futureCall(request);
- * // Do something
- * Endpoint response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * endpointServiceClient.deleteEndpointAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the Endpoint resource to be deleted. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * endpointServiceClient.deleteEndpointAsync(name.toString()).get();
- * }
- *
- *
* @param name Required. The name of the Endpoint resource to be deleted. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * endpointServiceClient.deleteEndpointAsync(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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = endpointServiceClient.deleteEndpointOperationCallable().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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = endpointServiceClient.deleteEndpointCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeployedModel deployedModel = DeployedModel.newBuilder().build();
- * Map<String, Integer> trafficSplit = new HashMap<>();
- * DeployModelResponse response = endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get();
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint resource into which to deploy a Model.
* Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that
@@ -761,8 +455,6 @@ public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeployedModel deployedModel = DeployedModel.newBuilder().build();
- * Map<String, Integer> trafficSplit = new HashMap<>();
- * DeployModelResponse response = endpointServiceClient.deployModelAsync(endpoint.toString(), deployedModel, trafficSplit).get();
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint resource into which to deploy a Model.
* Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that
@@ -807,8 +488,6 @@ public final OperationFutureSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeployedModel deployedModel = DeployedModel.newBuilder().build();
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModel(deployedModel)
- * .build();
- * DeployModelResponse response = endpointServiceClient.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 OperationFutureSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeployedModel deployedModel = DeployedModel.newBuilder().build();
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModel(deployedModel)
- * .build();
- * OperationFuture<DeployModelResponse, DeployModelOperationMetadata> future = endpointServiceClient.deployModelOperationCallable().futureCall(request);
- * // Do something
- * DeployModelResponse response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata>
deployModelOperationCallable() {
return stub.deployModelOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deploys a Model into this Endpoint, creating a DeployedModel within it.
*
* Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * DeployedModel deployedModel = DeployedModel.newBuilder().build();
- * DeployModelRequest request = DeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModel(deployedModel)
- * .build();
- * ApiFuture<Operation> future = endpointServiceClient.deployModelCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * String deployedModelId = "";
- * Map<String, Integer> trafficSplit = new HashMap<>();
- * UndeployModelResponse response = endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get();
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model.
* Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the
@@ -927,8 +550,6 @@ public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * String deployedModelId = "";
- * Map<String, Integer> trafficSplit = new HashMap<>();
- * UndeployModelResponse response = endpointServiceClient.undeployModelAsync(endpoint.toString(), deployedModelId, trafficSplit).get();
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model.
* Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the
@@ -969,8 +579,6 @@ public final UnaryCallableSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * String deployedModelId = "";
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModelId(deployedModelId)
- * .build();
- * UndeployModelResponse response = endpointServiceClient.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 OperationFutureSample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * String deployedModelId = "";
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModelId(deployedModelId)
- * .build();
- * OperationFuture<UndeployModelResponse, UndeployModelOperationMetadata> future = endpointServiceClient.undeployModelOperationCallable().futureCall(request);
- * // Do something
- * UndeployModelResponse response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata>
undeployModelOperationCallable() {
return stub.undeployModelOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Undeploys a Model from an Endpoint, removing a DeployedModel from it, and freeing all resources
* it's using.
*
* Sample code: - * - *
- * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * String deployedModelId = "";
- * UndeployModelRequest request = UndeployModelRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .setDeployedModelId(deployedModelId)
- * .build();
- * ApiFuture<Operation> future = endpointServiceClient.undeployModelCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getEndpoint to 30 seconds: * - *
- *
+ * {@code
* EndpointServiceSettings.Builder endpointServiceSettingsBuilder =
* EndpointServiceSettings.newBuilder();
* endpointServiceSettingsBuilder
* .getEndpointSettings()
* .setRetrySettings(
- * endpointServiceSettingsBuilder.getEndpointSettings().getRetrySettings().toBuilder()
+ * endpointServiceSettingsBuilder
+ * .getEndpointSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EndpointServiceSettings endpointServiceSettings = endpointServiceSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class EndpointServiceSettings extends ClientSettingsThis 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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * CustomJob customJob = CustomJob.newBuilder().build();
- * CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
- * }
- *
- *
- *
- * Note: close() needs to be called on the jobServiceClient object to clean up resources such as + *
Note: close() needs to be called on the JobServiceClient 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 @@ -83,30 +74,26 @@ * *
To customize credentials: * - *
- *
+ * {@code
* JobServiceSettings jobServiceSettings =
* JobServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * JobServiceClient jobServiceClient =
- * JobServiceClient.create(jobServiceSettings);
- *
- *
+ * JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* JobServiceSettings jobServiceSettings =
* JobServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * JobServiceClient jobServiceClient =
- * JobServiceClient.create(jobServiceSettings);
- *
- *
+ * JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class JobServiceClient implements BackgroundResource { private final JobServiceSettings settings; private final JobServiceStub stub; @@ -127,7 +114,7 @@ public static final JobServiceClient create(JobServiceSettings settings) throws /** * Constructs an instance of JobServiceClient, using the given stub for making calls. This is for - * advanced usage - prefer to use JobServiceSettings}. + * advanced usage - prefer using create(JobServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final JobServiceClient create(JobServiceStub stub) { @@ -164,26 +151,14 @@ public JobServiceStub getStub() { * 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 + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a CustomJob. A created CustomJob right away will be attempted to be run. * - *
Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * CustomJob customJob = CustomJob.newBuilder().build();
- * CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the CustomJob in. Format:
* `projects/{project}/locations/{location}`
* @param customJob Required. The CustomJob to create.
@@ -198,20 +173,10 @@ public final CustomJob createCustomJob(LocationName parent, CustomJob customJob)
return createCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a CustomJob. A created CustomJob right away will be attempted to be run.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * CustomJob customJob = CustomJob.newBuilder().build();
- * CustomJob response = jobServiceClient.createCustomJob(parent.toString(), customJob);
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the CustomJob in. Format:
* `projects/{project}/locations/{location}`
* @param customJob Required. The CustomJob to create.
@@ -223,24 +188,10 @@ public final CustomJob createCustomJob(String parent, CustomJob customJob) {
return createCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a CustomJob. A created CustomJob right away will be attempted to be run.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * CustomJob customJob = CustomJob.newBuilder().build();
- * CreateCustomJobRequest request = CreateCustomJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setCustomJob(customJob)
- * .build();
- * CustomJob response = jobServiceClient.createCustomJob(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
*/
@@ -248,43 +199,20 @@ public final CustomJob createCustomJob(CreateCustomJobRequest request) {
return createCustomJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a CustomJob. A created CustomJob right away will be attempted to be run.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * CustomJob customJob = CustomJob.newBuilder().build();
- * CreateCustomJobRequest request = CreateCustomJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setCustomJob(customJob)
- * .build();
- * ApiFuture<CustomJob> future = jobServiceClient.createCustomJobCallable().futureCall(request);
- * // Do something
- * CustomJob response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * CustomJob response = jobServiceClient.getCustomJob(name);
- * }
- *
- *
* @param name Required. The name of the CustomJob resource. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -295,19 +223,10 @@ public final CustomJob getCustomJob(CustomJobName name) {
return getCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a CustomJob.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * CustomJob response = jobServiceClient.getCustomJob(name.toString());
- * }
- *
- *
* @param name Required. The name of the CustomJob resource. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -317,22 +236,10 @@ public final CustomJob getCustomJob(String name) {
return getCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a CustomJob.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * GetCustomJobRequest request = GetCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * CustomJob response = jobServiceClient.getCustomJob(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
*/
@@ -340,43 +247,20 @@ public final CustomJob getCustomJob(GetCustomJobRequest request) {
return getCustomJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a CustomJob.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * GetCustomJobRequest request = GetCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<CustomJob> future = jobServiceClient.getCustomJobCallable().futureCall(request);
- * // Do something
- * CustomJob response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the CustomJobs from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -389,21 +273,10 @@ public final ListCustomJobsPagedResponse listCustomJobs(LocationName parent) {
return listCustomJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists CustomJobs in a Location.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (CustomJob element : jobServiceClient.listCustomJobs(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the CustomJobs from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -413,24 +286,10 @@ public final ListCustomJobsPagedResponse listCustomJobs(String parent) {
return listCustomJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists CustomJobs in a Location.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListCustomJobsRequest request = ListCustomJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (CustomJob element : jobServiceClient.listCustomJobs(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
*/
@@ -438,82 +297,36 @@ public final ListCustomJobsPagedResponse listCustomJobs(ListCustomJobsRequest re
return listCustomJobsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists CustomJobs in a Location.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListCustomJobsRequest request = ListCustomJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListCustomJobsPagedResponse> future = jobServiceClient.listCustomJobsPagedCallable().futureCall(request);
- * // Do something
- * for (CustomJob element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListCustomJobsRequest request = ListCustomJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListCustomJobsResponse response = jobServiceClient.listCustomJobsCallable().call(request);
- * for (CustomJob element : response.getCustomJobsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * jobServiceClient.deleteCustomJobAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the CustomJob resource to be deleted. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * jobServiceClient.deleteCustomJobAsync(name.toString()).get();
- * }
- *
- *
* @param name Required. The name of the CustomJob resource to be deleted. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * DeleteCustomJobRequest request = DeleteCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.deleteCustomJobAsync(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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * DeleteCustomJobRequest request = DeleteCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = jobServiceClient.deleteCustomJobOperationCallable().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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * DeleteCustomJobRequest request = DeleteCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = jobServiceClient.deleteCustomJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * jobServiceClient.cancelCustomJob(name);
- * }
- *
- *
* @param name Required. The name of the CustomJob to cancel. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -647,7 +401,7 @@ public final void cancelCustomJob(CustomJobName name) {
cancelCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best
* effort to cancel the job, but success is not guaranteed. Clients can use
@@ -658,15 +412,6 @@ public final void cancelCustomJob(CustomJobName name) {
* [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
* [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * jobServiceClient.cancelCustomJob(name.toString());
- * }
- *
- *
* @param name Required. The name of the CustomJob to cancel. Format:
* `projects/{project}/locations/{location}/customJobs/{custom_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -676,7 +421,7 @@ public final void cancelCustomJob(String name) {
cancelCustomJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best
* effort to cancel the job, but success is not guaranteed. Clients can use
@@ -687,18 +432,6 @@ public final void cancelCustomJob(String name) {
* [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
* [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * CancelCustomJobRequest request = CancelCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.cancelCustomJob(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
*/
@@ -706,7 +439,7 @@ public final void cancelCustomJob(CancelCustomJobRequest request) {
cancelCustomJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best
* effort to cancel the job, but success is not guaranteed. Clients can use
@@ -718,37 +451,15 @@ public final void cancelCustomJob(CancelCustomJobRequest request) {
* [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to `CANCELLED`.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
- * CancelCustomJobRequest request = CancelCustomJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = jobServiceClient.cancelCustomJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
- * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob);
- * }
- *
- *
* @param parent Required. The parent of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}`
* @param dataLabelingJob Required. The DataLabelingJob to create.
@@ -764,20 +475,10 @@ public final DataLabelingJob createDataLabelingJob(
return createDataLabelingJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a DataLabelingJob.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
- * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent.toString(), dataLabelingJob);
- * }
- *
- *
* @param parent Required. The parent of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}`
* @param dataLabelingJob Required. The DataLabelingJob to create.
@@ -793,24 +494,10 @@ public final DataLabelingJob createDataLabelingJob(
return createDataLabelingJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a DataLabelingJob.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
- * CreateDataLabelingJobRequest request = CreateDataLabelingJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setDataLabelingJob(dataLabelingJob)
- * .build();
- * DataLabelingJob response = jobServiceClient.createDataLabelingJob(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
*/
@@ -818,44 +505,21 @@ public final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest
return createDataLabelingJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a DataLabelingJob.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
- * CreateDataLabelingJobRequest request = CreateDataLabelingJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setDataLabelingJob(dataLabelingJob)
- * .build();
- * ApiFuture<DataLabelingJob> future = jobServiceClient.createDataLabelingJobCallable().futureCall(request);
- * // Do something
- * DataLabelingJob response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name);
- * }
- *
- *
* @param name Required. The name of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -868,19 +532,10 @@ public final DataLabelingJob getDataLabelingJob(DataLabelingJobName name) { return getDataLabelingJob(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataLabelingJob. * - *
Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name.toString());
- * }
- *
- *
* @param name Required. The name of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -891,22 +546,10 @@ public final DataLabelingJob getDataLabelingJob(String name) { return getDataLabelingJob(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets a DataLabelingJob. * - *
Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * GetDataLabelingJobRequest request = GetDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * DataLabelingJob response = jobServiceClient.getDataLabelingJob(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
*/
@@ -914,44 +557,21 @@ public final DataLabelingJob getDataLabelingJob(GetDataLabelingJobRequest reques
return getDataLabelingJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a DataLabelingJob.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * GetDataLabelingJobRequest request = GetDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<DataLabelingJob> future = jobServiceClient.getDataLabelingJobCallable().futureCall(request);
- * // Do something
- * DataLabelingJob response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The parent of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -964,21 +584,10 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(LocationName
return listDataLabelingJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataLabelingJobs in a Location.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The parent of the DataLabelingJob. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -989,24 +598,10 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(String paren
return listDataLabelingJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataLabelingJobs in a Location.
*
- * Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDataLabelingJobsRequest request = ListDataLabelingJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(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
*/
@@ -1015,82 +610,36 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(
return listDataLabelingJobsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists DataLabelingJobs in a Location.
*
* Sample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDataLabelingJobsRequest request = ListDataLabelingJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListDataLabelingJobsPagedResponse> future = jobServiceClient.listDataLabelingJobsPagedCallable().futureCall(request);
- * // Do something
- * for (DataLabelingJob element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListDataLabelingJobsRequest request = ListDataLabelingJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListDataLabelingJobsResponse response = jobServiceClient.listDataLabelingJobsCallable().call(request);
- * for (DataLabelingJob element : response.getDataLabelingJobsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * jobServiceClient.deleteDataLabelingJobAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the DataLabelingJob to be deleted. Format:
* `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @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:
- *
- * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @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:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1224,19 +714,10 @@ public final void cancelDataLabelingJob(DataLabelingJobName name) {
cancelDataLabelingJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1247,22 +728,10 @@ public final void cancelDataLabelingJob(String name) {
cancelDataLabelingJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1427,19 +827,10 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(
return getHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a HyperparameterTuningJob
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1450,22 +841,10 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(String name) {
return getHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a HyperparameterTuningJob
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @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:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @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:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1800,7 +1026,7 @@ public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name
cancelHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the
* HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not
@@ -1815,15 +1041,6 @@ public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name
* [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state]
* is set to `CANCELLED`.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1834,7 +1051,7 @@ public final void cancelHyperparameterTuningJob(String name) {
cancelHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the
* HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not
@@ -1849,18 +1066,6 @@ public final void cancelHyperparameterTuningJob(String name) {
* [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state]
* is set to `CANCELLED`.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2040,19 +1176,10 @@ public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName nam
return getBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a BatchPredictionJob
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2063,22 +1190,10 @@ public final BatchPredictionJob getBatchPredictionJob(String name) {
return getBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a BatchPredictionJob
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @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:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @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:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2405,7 +1367,7 @@ public final void cancelBatchPredictionJob(BatchPredictionJobName name) {
cancelBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a BatchPredictionJob.
*
@@ -2418,15 +1380,6 @@ public final void cancelBatchPredictionJob(BatchPredictionJobName name) {
* [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2437,7 +1390,7 @@ public final void cancelBatchPredictionJob(String name) {
cancelBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a BatchPredictionJob.
*
@@ -2450,18 +1403,6 @@ public final void cancelBatchPredictionJob(String name) {
* [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
- * Sample code:
- *
- * Sample code:
- *
- * For example, to set the total timeout of createCustomJob to 30 seconds:
*
- * 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 migrationServiceClient object to clean up resources
+ * Note: close() needs to be called on the MigrationServiceClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
*
@@ -85,30 +75,28 @@
*
* To customize credentials:
*
- * To customize the endpoint:
*
- * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class MigrationServiceClient implements BackgroundResource {
private final MigrationServiceSettings settings;
private final MigrationServiceStub stub;
@@ -130,7 +118,7 @@ public static final MigrationServiceClient create(MigrationServiceSettings setti
/**
* Constructs an instance of MigrationServiceClient, using the given stub for making calls. This
- * is for advanced usage - prefer to use MigrationServiceSettings}.
+ * is for advanced usage - prefer using create(MigrationServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final MigrationServiceClient create(MigrationServiceStub stub) {
@@ -168,28 +156,15 @@ public MigrationServiceStub getStub() {
* 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
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * For example, to set the total timeout of searchMigratableResources to 30 seconds:
*
- * 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 modelServiceClient object to clean up resources such
+ * Note: close() needs to be called on the ModelServiceClient 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
@@ -83,30 +75,26 @@
*
* To customize credentials:
*
- * To customize the endpoint:
*
- * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class ModelServiceClient implements BackgroundResource {
private final ModelServiceSettings settings;
private final ModelServiceStub stub;
@@ -127,7 +115,7 @@ public static final ModelServiceClient create(ModelServiceSettings settings) thr
/**
* Constructs an instance of ModelServiceClient, using the given stub for making calls. This is
- * for advanced usage - prefer to use ModelServiceSettings}.
+ * for advanced usage - prefer using create(ModelServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ModelServiceClient create(ModelServiceStub stub) {
@@ -165,33 +153,19 @@ public ModelServiceStub getStub() {
* 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
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Uploads a Model artifact into AI Platform.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -903,19 +530,10 @@ public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) {
return getModelEvaluation(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluation.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -926,22 +544,10 @@ public final ModelEvaluation getModelEvaluation(String name) {
return getModelEvaluation(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluation.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1132,19 +646,10 @@ public final ModelEvaluationSlice getModelEvaluationSlice(ModelEvaluationSliceNa
return getModelEvaluationSlice(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluationSlice.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1155,22 +660,10 @@ public final ModelEvaluationSlice getModelEvaluationSlice(String name) {
return getModelEvaluationSlice(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluationSlice.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
@@ -1231,21 +701,10 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
return listModelEvaluationSlices(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
@@ -1257,24 +716,10 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(St
return listModelEvaluationSlices(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * For example, to set the total timeout of getModel to 30 seconds:
*
- * 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 pipelineServiceClient object to clean up resources
+ * Note: close() needs to be called on the PipelineServiceClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
*
@@ -84,30 +75,28 @@
*
* To customize credentials:
*
- * To customize the endpoint:
*
- * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class PipelineServiceClient implements BackgroundResource {
private final PipelineServiceSettings settings;
private final PipelineServiceStub stub;
@@ -129,7 +118,7 @@ public static final PipelineServiceClient create(PipelineServiceSettings setting
/**
* Constructs an instance of PipelineServiceClient, using the given stub for making calls. This is
- * for advanced usage - prefer to use PipelineServiceSettings}.
+ * for advanced usage - prefer using create(PipelineServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final PipelineServiceClient create(PipelineServiceStub stub) {
@@ -167,26 +156,14 @@ public PipelineServiceStub getStub() {
* 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
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -306,19 +236,10 @@ public final TrainingPipeline getTrainingPipeline(TrainingPipelineName name) {
return getTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a TrainingPipeline.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -329,22 +250,10 @@ public final TrainingPipeline getTrainingPipeline(String name) {
return getTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a TrainingPipeline.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @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:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @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:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -672,7 +428,7 @@ public final void cancelTrainingPipeline(TrainingPipelineName name) {
cancelTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
* server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
@@ -686,15 +442,6 @@ public final void cancelTrainingPipeline(TrainingPipelineName name) {
* [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to
* `CANCELLED`.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -705,7 +452,7 @@ public final void cancelTrainingPipeline(String name) {
cancelTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
* server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
@@ -719,18 +466,6 @@ public final void cancelTrainingPipeline(String name) {
* [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to
* `CANCELLED`.
*
- * Sample code:
- *
- * Sample code:
- *
- * For example, to set the total timeout of createTrainingPipeline to 30 seconds:
*
- * 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
+ * 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().
*
@@ -73,30 +63,28 @@
*
* To customize credentials:
*
- * To customize the endpoint:
*
- * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class PredictionServiceClient implements BackgroundResource {
private final PredictionServiceSettings settings;
private final PredictionServiceStub stub;
@@ -117,7 +105,7 @@ public static final PredictionServiceClient create(PredictionServiceSettings set
/**
* Constructs an instance of PredictionServiceClient, using the given stub for making calls. This
- * is for advanced usage - prefer to use PredictionServiceSettings}.
+ * is for advanced usage - prefer using create(PredictionServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final PredictionServiceClient create(PredictionServiceStub stub) {
@@ -149,21 +137,10 @@ public PredictionServiceStub getStub() {
return stub;
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online prediction.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * For example, to set the total timeout of predict to 30 seconds:
*
- * 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 specialistPoolServiceClient object to clean up
+ * Note: close() needs to be called on the SpecialistPoolServiceClient object to clean up
* resources such as threads. In the example above, try-with-resources is used, which automatically
* calls close().
*
@@ -88,30 +80,28 @@
*
* To customize credentials:
*
- * To customize the endpoint:
*
- * Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
-@Generated("by gapic-generator")
@BetaApi
+@Generated("by gapic-generator")
public class SpecialistPoolServiceClient implements BackgroundResource {
private final SpecialistPoolServiceSettings settings;
private final SpecialistPoolServiceStub stub;
@@ -133,7 +123,7 @@ public static final SpecialistPoolServiceClient create(SpecialistPoolServiceSett
/**
* Constructs an instance of SpecialistPoolServiceClient, using the given stub for making calls.
- * This is for advanced usage - prefer to use SpecialistPoolServiceSettings}.
+ * This is for advanced usage - prefer using create(SpecialistPoolServiceSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final SpecialistPoolServiceClient create(SpecialistPoolServiceStub stub) {
@@ -171,33 +161,19 @@ public SpecialistPoolServiceStub getStub() {
* 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
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a SpecialistPool.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -344,19 +254,10 @@ public final SpecialistPool getSpecialistPool(SpecialistPoolName name) {
return getSpecialistPool(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a SpecialistPool.
*
- * Sample code:
- *
- * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -366,22 +267,10 @@ public final SpecialistPool getSpecialistPool(String name) {
return getSpecialistPool(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a SpecialistPool.
*
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- *
- *
* @param name Required. The name of the DataLabelingJob to be deleted. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * jobServiceClient.deleteDataLabelingJobAsync(name.toString()).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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * DeleteDataLabelingJobRequest request = DeleteDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.deleteDataLabelingJobAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ */
public final OperationCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * DeleteDataLabelingJobRequest request = DeleteDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = jobServiceClient.deleteDataLabelingJobOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * DeleteDataLabelingJobRequest request = DeleteDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = jobServiceClient.deleteDataLabelingJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param name Required. The name of the DataLabelingJob. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * jobServiceClient.cancelDataLabelingJob(name);
- * }
- *
- *
* @param name Required. The name of the DataLabelingJob. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * jobServiceClient.cancelDataLabelingJob(name.toString());
- * }
- *
- *
* @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
*/
@@ -1270,42 +739,20 @@ public final void cancelDataLabelingJob(CancelDataLabelingJobRequest request) {
cancelDataLabelingJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * CancelDataLabelingJobRequest request = CancelDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.cancelDataLabelingJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * DataLabelingJobName name = DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
- * CancelDataLabelingJobRequest request = CancelDataLabelingJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = jobServiceClient.cancelDataLabelingJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the HyperparameterTuningJob
* in. Format: `projects/{project}/locations/{location}`
* @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create.
@@ -1321,20 +768,10 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
return createHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a HyperparameterTuningJob
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * HyperparameterTuningJob hyperparameterTuningJob = HyperparameterTuningJob.newBuilder().build();
- * HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the HyperparameterTuningJob
* in. Format: `projects/{project}/locations/{location}`
* @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create.
@@ -1350,24 +787,10 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
return createHyperparameterTuningJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a HyperparameterTuningJob
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * HyperparameterTuningJob hyperparameterTuningJob = HyperparameterTuningJob.newBuilder().build();
- * HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(parent.toString(), hyperparameterTuningJob);
- * }
- *
- *
* @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
*/
@@ -1376,44 +799,21 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
return createHyperparameterTuningJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a HyperparameterTuningJob
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * HyperparameterTuningJob hyperparameterTuningJob = HyperparameterTuningJob.newBuilder().build();
- * CreateHyperparameterTuningJobRequest request = CreateHyperparameterTuningJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setHyperparameterTuningJob(hyperparameterTuningJob)
- * .build();
- * HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * HyperparameterTuningJob hyperparameterTuningJob = HyperparameterTuningJob.newBuilder().build();
- * CreateHyperparameterTuningJobRequest request = CreateHyperparameterTuningJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setHyperparameterTuningJob(hyperparameterTuningJob)
- * .build();
- * ApiFuture<HyperparameterTuningJob> future = jobServiceClient.createHyperparameterTuningJobCallable().futureCall(request);
- * // Do something
- * HyperparameterTuningJob response = future.get();
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob resource. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob resource. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name.toString());
- * }
- *
- *
* @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
*/
@@ -1474,44 +853,21 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(
return getHyperparameterTuningJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a HyperparameterTuningJob
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * GetHyperparameterTuningJobRequest request = GetHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * GetHyperparameterTuningJobRequest request = GetHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<HyperparameterTuningJob> future = jobServiceClient.getHyperparameterTuningJobCallable().futureCall(request);
- * // Do something
- * HyperparameterTuningJob response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs
* from. Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1525,21 +881,10 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
return listHyperparameterTuningJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists HyperparameterTuningJobs in a Location.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (HyperparameterTuningJob element : jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs
* from. Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1551,24 +896,10 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
return listHyperparameterTuningJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists HyperparameterTuningJobs in a Location.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (HyperparameterTuningJob element : jobServiceClient.listHyperparameterTuningJobs(parent.toString()).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
*/
@@ -1577,25 +908,11 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
return listHyperparameterTuningJobsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists HyperparameterTuningJobs in a Location.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListHyperparameterTuningJobsRequest request = ListHyperparameterTuningJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (HyperparameterTuningJob element : jobServiceClient.listHyperparameterTuningJobs(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable<
ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsPagedResponse>
@@ -1603,32 +920,11 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
return stub.listHyperparameterTuningJobsPagedCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists HyperparameterTuningJobs in a Location.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListHyperparameterTuningJobsRequest request = ListHyperparameterTuningJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListHyperparameterTuningJobsPagedResponse> future = jobServiceClient.listHyperparameterTuningJobsPagedCallable().futureCall(request);
- * // Do something
- * for (HyperparameterTuningJob element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable<
ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse>
@@ -1636,25 +932,14 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
return stub.listHyperparameterTuningJobsCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a HyperparameterTuningJob.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListHyperparameterTuningJobsRequest request = ListHyperparameterTuningJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListHyperparameterTuningJobsResponse response = jobServiceClient.listHyperparameterTuningJobsCallable().call(request);
- * for (HyperparameterTuningJob element : response.getHyperparameterTuningJobsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * jobServiceClient.deleteHyperparameterTuningJobAsync(name.toString()).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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * DeleteHyperparameterTuningJobRequest request = DeleteHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.deleteHyperparameterTuningJobAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ */
public final OperationCallable<
DeleteHyperparameterTuningJobRequest, Empty, DeleteOperationMetadata>
deleteHyperparameterTuningJobOperationCallable() {
return stub.deleteHyperparameterTuningJobOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a HyperparameterTuningJob.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * DeleteHyperparameterTuningJobRequest request = DeleteHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = jobServiceClient.deleteHyperparameterTuningJobOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * DeleteHyperparameterTuningJobRequest request = DeleteHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = jobServiceClient.deleteHyperparameterTuningJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob to cancel. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * jobServiceClient.cancelHyperparameterTuningJob(name);
- * }
- *
- *
* @param name Required. The name of the HyperparameterTuningJob to cancel. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * jobServiceClient.cancelHyperparameterTuningJob(name.toString());
- * }
- *
- *
* @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
*/
@@ -1868,7 +1073,7 @@ public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobReq
cancelHyperparameterTuningJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the
* HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not
@@ -1884,39 +1089,17 @@ public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobReq
* is set to `CANCELLED`.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * CancelHyperparameterTuningJobRequest request = CancelHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.cancelHyperparameterTuningJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * HyperparameterTuningJobName name = HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
- * CancelHyperparameterTuningJobRequest request = CancelHyperparameterTuningJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = jobServiceClient.cancelHyperparameterTuningJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the BatchPredictionJob in.
* Format: `projects/{project}/locations/{location}`
* @param batchPredictionJob Required. The BatchPredictionJob to create.
@@ -1932,21 +1115,11 @@ public final BatchPredictionJob createBatchPredictionJob(
return createBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to
* start.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
- * BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the BatchPredictionJob in.
* Format: `projects/{project}/locations/{location}`
* @param batchPredictionJob Required. The BatchPredictionJob to create.
@@ -1962,25 +1135,11 @@ public final BatchPredictionJob createBatchPredictionJob(
return createBatchPredictionJob(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to
* start.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
- * BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(parent.toString(), batchPredictionJob);
- * }
- *
- *
* @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
*/
@@ -1989,45 +1148,22 @@ public final BatchPredictionJob createBatchPredictionJob(
return createBatchPredictionJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to
* start.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
- * CreateBatchPredictionJobRequest request = CreateBatchPredictionJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setBatchPredictionJob(batchPredictionJob)
- * .build();
- * BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
- * CreateBatchPredictionJobRequest request = CreateBatchPredictionJobRequest.newBuilder()
- * .setParent(parent.toString())
- * .setBatchPredictionJob(batchPredictionJob)
- * .build();
- * ApiFuture<BatchPredictionJob> future = jobServiceClient.createBatchPredictionJobCallable().futureCall(request);
- * // Do something
- * BatchPredictionJob response = future.get();
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob resource. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob resource. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name.toString());
- * }
- *
- *
* @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
*/
@@ -2086,44 +1201,21 @@ public final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobReque
return getBatchPredictionJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a BatchPredictionJob
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * GetBatchPredictionJobRequest request = GetBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * GetBatchPredictionJobRequest request = GetBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<BatchPredictionJob> future = jobServiceClient.getBatchPredictionJobCallable().futureCall(request);
- * // Do something
- * BatchPredictionJob response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the BatchPredictionJobs from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2136,21 +1228,10 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(Locati
return listBatchPredictionJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists BatchPredictionJobs in a Location.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (BatchPredictionJob element : jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the BatchPredictionJobs from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2161,24 +1242,10 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(String
return listBatchPredictionJobs(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists BatchPredictionJobs in a Location.
*
- *
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (BatchPredictionJob element : jobServiceClient.listBatchPredictionJobs(parent.toString()).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
*/
@@ -2187,82 +1254,36 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(
return listBatchPredictionJobsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists BatchPredictionJobs in a Location.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListBatchPredictionJobsRequest request = ListBatchPredictionJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (BatchPredictionJob element : jobServiceClient.listBatchPredictionJobs(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListBatchPredictionJobsRequest request = ListBatchPredictionJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListBatchPredictionJobsPagedResponse> future = jobServiceClient.listBatchPredictionJobsPagedCallable().futureCall(request);
- * // Do something
- * for (BatchPredictionJob element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListBatchPredictionJobsRequest request = ListBatchPredictionJobsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListBatchPredictionJobsResponse response = jobServiceClient.listBatchPredictionJobsCallable().call(request);
- * for (BatchPredictionJob element : response.getBatchPredictionJobsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob resource to be deleted. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * jobServiceClient.deleteBatchPredictionJobAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob resource to be deleted. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * jobServiceClient.deleteBatchPredictionJobAsync(name.toString()).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 (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * DeleteBatchPredictionJobRequest request = DeleteBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.deleteBatchPredictionJobAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ */
public final OperationCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * DeleteBatchPredictionJobRequest request = DeleteBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = jobServiceClient.deleteBatchPredictionJobOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * DeleteBatchPredictionJobRequest request = DeleteBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = jobServiceClient.deleteBatchPredictionJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob to cancel. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * jobServiceClient.cancelBatchPredictionJob(name);
- * }
- *
- *
* @param name Required. The name of the BatchPredictionJob to cancel. Format:
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * jobServiceClient.cancelBatchPredictionJob(name.toString());
- * }
- *
- *
* @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
*/
@@ -2469,7 +1410,7 @@ public final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest reque
cancelBatchPredictionJobCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a BatchPredictionJob.
*
@@ -2483,18 +1424,6 @@ public final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest reque
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
*
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * CancelBatchPredictionJobRequest request = CancelBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * jobServiceClient.cancelBatchPredictionJob(request);
- * }
- *
*/
public final UnaryCallable
- * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
- * BatchPredictionJobName name = BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
- * CancelBatchPredictionJobRequest request = CancelBatchPredictionJobRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = jobServiceClient.cancelBatchPredictionJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class JobServiceSettings extends ClientSettings
- * JobServiceSettings.Builder jobServiceSettingsBuilder =
- * JobServiceSettings.newBuilder();
+ *
- * {@code
+ * JobServiceSettings.Builder jobServiceSettingsBuilder = JobServiceSettings.newBuilder();
* jobServiceSettingsBuilder
* .createCustomJobSettings()
* .setRetrySettings(
- * jobServiceSettingsBuilder.createCustomJobSettings().getRetrySettings().toBuilder()
+ * jobServiceSettingsBuilder
+ * .createCustomJobSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* JobServiceSettings jobServiceSettings = jobServiceSettingsBuilder.build();
- *
- *
- *
- *
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (MigratableResource element : migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- *
+ * }
*
- * To customize the endpoint:
+ *
+ *
- * {@code
* MigrationServiceSettings migrationServiceSettings =
* MigrationServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* MigrationServiceClient migrationServiceClient =
* MigrationServiceClient.create(migrationServiceSettings);
- *
- *
+ * }
+ *
+ *
+ *
- * {@code
* MigrationServiceSettings migrationServiceSettings =
* MigrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* MigrationServiceClient migrationServiceClient =
* MigrationServiceClient.create(migrationServiceSettings);
- *
- *
* @param parent Required. The location that the migratable resources should be searched from.
* It's the AI Platform location that the resources can be migrated to, not the resources'
* original location. Format: `projects/{project}/locations/{location}`
@@ -204,22 +179,11 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return searchMigratableResources(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
- *
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (MigratableResource element : migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The location that the migratable resources should be searched from.
* It's the AI Platform location that the resources can be migrated to, not the resources'
* original location. Format: `projects/{project}/locations/{location}`
@@ -231,25 +195,11 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(St
return searchMigratableResources(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
- *
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (MigratableResource element : migrationServiceClient.searchMigratableResources(parent.toString()).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
*/
@@ -258,26 +208,12 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return searchMigratableResourcesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
*
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SearchMigratableResourcesRequest request = SearchMigratableResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (MigratableResource element : migrationServiceClient.searchMigratableResources(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable<
SearchMigratableResourcesRequest, SearchMigratableResourcesPagedResponse>
@@ -285,54 +221,23 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return stub.searchMigratableResourcesPagedCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
*
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SearchMigratableResourcesRequest request = SearchMigratableResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<SearchMigratableResourcesPagedResponse> future = migrationServiceClient.searchMigratableResourcesPagedCallable().futureCall(request);
- * // Do something
- * for (MigratableResource element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SearchMigratableResourcesRequest request = SearchMigratableResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * SearchMigratableResourcesResponse response = migrationServiceClient.searchMigratableResourcesCallable().call(request);
- * for (MigratableResource element : response.getMigratableResourcesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param parent Required. The location of the migrated resource will live in. Format:
* `projects/{project}/locations/{location}`
* @param migrateResourceRequests Required. The request messages specifying the resources to
@@ -340,8 +245,6 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* migrated in one batch.
* @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<
BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>
batchMigrateResourcesAsync(
@@ -354,21 +257,11 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return batchMigrateResourcesAsync(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
- *
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * List<MigrateResourceRequest> migrateResourceRequests = new ArrayList<>();
- * BatchMigrateResourcesResponse response = migrationServiceClient.batchMigrateResourcesAsync(parent, migrateResourceRequests).get();
- * }
- *
- *
* @param parent Required. The location of the migrated resource will live in. Format:
* `projects/{project}/locations/{location}`
* @param migrateResourceRequests Required. The request messages specifying the resources to
@@ -376,8 +269,6 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* migrated in one batch.
* @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<
BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>
batchMigrateResourcesAsync(
@@ -390,58 +281,27 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return batchMigrateResourcesAsync(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
- *
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * List<MigrateResourceRequest> migrateResourceRequests = new ArrayList<>();
- * BatchMigrateResourcesResponse response = migrationServiceClient.batchMigrateResourcesAsync(parent.toString(), migrateResourceRequests).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<
BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata>
batchMigrateResourcesAsync(BatchMigrateResourcesRequest request) {
return batchMigrateResourcesOperationCallable().futureCall(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
*
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * List<MigrateResourceRequest> migrateResourceRequests = new ArrayList<>();
- * BatchMigrateResourcesRequest request = BatchMigrateResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllMigrateResourceRequests(migrateResourceRequests)
- * .build();
- * BatchMigrateResourcesResponse response = migrationServiceClient.batchMigrateResourcesAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
BatchMigrateResourcesRequest,
BatchMigrateResourcesResponse,
@@ -450,26 +310,12 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
return stub.batchMigrateResourcesOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
*
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * List<MigrateResourceRequest> migrateResourceRequests = new ArrayList<>();
- * BatchMigrateResourcesRequest request = BatchMigrateResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllMigrateResourceRequests(migrateResourceRequests)
- * .build();
- * OperationFuture<BatchMigrateResourcesResponse, BatchMigrateResourcesOperationMetadata> future = migrationServiceClient.batchMigrateResourcesOperationCallable().futureCall(request);
- * // Do something
- * BatchMigrateResourcesResponse response = future.get();
- * }
- *
*/
public final UnaryCallable
- * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * List<MigrateResourceRequest> migrateResourceRequests = new ArrayList<>();
- * BatchMigrateResourcesRequest request = BatchMigrateResourcesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllMigrateResourceRequests(migrateResourceRequests)
- * .build();
- * ApiFuture<Operation> future = migrationServiceClient.batchMigrateResourcesCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class MigrationServiceSettings extends ClientSettings
+ *
- * {@code
* MigrationServiceSettings.Builder migrationServiceSettingsBuilder =
* MigrationServiceSettings.newBuilder();
* migrationServiceSettingsBuilder
* .searchMigratableResourcesSettings()
* .setRetrySettings(
- * migrationServiceSettingsBuilder.searchMigratableResourcesSettings().getRetrySettings().toBuilder()
+ * migrationServiceSettingsBuilder
+ * .searchMigratableResourcesSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* MigrationServiceSettings migrationServiceSettings = migrationServiceSettingsBuilder.build();
- *
- *
- *
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * Model response = modelServiceClient.getModel(name);
- * }
- *
- *
- *
+ * ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+ * }
*
- * To customize the endpoint:
+ *
+ *
- * {@code
* ModelServiceSettings modelServiceSettings =
* ModelServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * ModelServiceClient modelServiceClient =
- * ModelServiceClient.create(modelServiceSettings);
- *
- *
+ * ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+ * }
+ *
+ *
+ *
- * {@code
* ModelServiceSettings modelServiceSettings =
* ModelServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * ModelServiceClient modelServiceClient =
- * ModelServiceClient.create(modelServiceSettings);
- *
- *
* @param parent Required. The resource name of the Location into which to upload the Model.
* Format: `projects/{project}/locations/{location}`
* @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 OperationFuture
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * UploadModelResponse response = modelServiceClient.uploadModelAsync(parent, model).get();
- * }
- *
- *
* @param parent Required. The resource name of the Location into which to upload the Model.
* Format: `projects/{project}/locations/{location}`
* @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 OperationFuture
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * UploadModelResponse response = modelServiceClient.uploadModelAsync(parent.toString(), model).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 (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * UploadModelRequest request = UploadModelRequest.newBuilder()
- * .setParent(parent.toString())
- * .setModel(model)
- * .build();
- * UploadModelResponse response = modelServiceClient.uploadModelAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
UploadModelRequest, UploadModelResponse, UploadModelOperationMetadata>
uploadModelOperationCallable() {
return stub.uploadModelOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Uploads a Model artifact into AI Platform.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * UploadModelRequest request = UploadModelRequest.newBuilder()
- * .setParent(parent.toString())
- * .setModel(model)
- * .build();
- * OperationFuture<UploadModelResponse, UploadModelOperationMetadata> future = modelServiceClient.uploadModelOperationCallable().futureCall(request);
- * // Do something
- * UploadModelResponse response = future.get();
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Model model = Model.newBuilder().build();
- * UploadModelRequest request = UploadModelRequest.newBuilder()
- * .setParent(parent.toString())
- * .setModel(model)
- * .build();
- * ApiFuture<Operation> future = modelServiceClient.uploadModelCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
* @param name Required. The name of the Model resource. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -332,19 +240,10 @@ public final Model getModel(ModelName name) {
return getModel(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Model.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * Model response = modelServiceClient.getModel(name);
- * }
- *
- *
* @param name Required. The name of the Model resource. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -354,22 +253,10 @@ public final Model getModel(String name) {
return getModel(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Model.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * Model response = modelServiceClient.getModel(name.toString());
- * }
- *
- *
* @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
*/
@@ -377,43 +264,20 @@ public final Model getModel(GetModelRequest request) {
return getModelCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a Model.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * GetModelRequest request = GetModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Model response = modelServiceClient.getModel(request);
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * GetModelRequest request = GetModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Model> future = modelServiceClient.getModelCallable().futureCall(request);
- * // Do something
- * Model response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the Models from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -424,21 +288,10 @@ public final ListModelsPagedResponse listModels(LocationName parent) {
return listModels(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Models in a Location.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the Models from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -448,24 +301,10 @@ public final ListModelsPagedResponse listModels(String parent) {
return listModels(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Models in a Location.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Model element : modelServiceClient.listModels(parent.toString()).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
*/
@@ -473,75 +312,30 @@ public final ListModelsPagedResponse listModels(ListModelsRequest request) {
return listModelsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Models in a Location.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListModelsRequest request = ListModelsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Model element : modelServiceClient.listModels(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListModelsRequest request = ListModelsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListModelsPagedResponse> future = modelServiceClient.listModelsPagedCallable().futureCall(request);
- * // Do something
- * for (Model element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListModelsRequest request = ListModelsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListModelsResponse response = modelServiceClient.listModelsCallable().call(request);
- * for (Model element : response.getModelsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param model Required. The Model which replaces the resource on the server.
* @param updateMask Required. The update mask applies to the resource. For the `FieldMask`
* definition, see
@@ -555,24 +349,10 @@ public final Model updateModel(Model model, FieldMask updateMask) {
return updateModel(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a Model.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * Model model = Model.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Model response = modelServiceClient.updateModel(model, updateMask);
- * }
- *
- *
* @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
*/
@@ -580,179 +360,92 @@ public final Model updateModel(UpdateModelRequest request) {
return updateModelCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a Model.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * Model model = Model.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateModelRequest request = UpdateModelRequest.newBuilder()
- * .setModel(model)
- * .setUpdateMask(updateMask)
- * .build();
- * Model response = modelServiceClient.updateModel(request);
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * Model model = Model.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateModelRequest request = UpdateModelRequest.newBuilder()
- * .setModel(model)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Model> future = modelServiceClient.updateModelCallable().futureCall(request);
- * // Do something
- * Model response = future.get();
- * }
- *
- *
* @param name Required. The name of the Model resource to be deleted. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @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 (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * modelServiceClient.deleteModelAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the Model resource to be deleted. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @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 (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * modelServiceClient.deleteModelAsync(name.toString()).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 (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeleteModelRequest request = DeleteModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * modelServiceClient.deleteModelAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeleteModelRequest request = DeleteModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = modelServiceClient.deleteModelOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * DeleteModelRequest request = DeleteModelRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = modelServiceClient.deleteModelCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param name Required. The resource name of the Model to export. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @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
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportModelRequest.OutputConfig outputConfig = ExportModelRequest.OutputConfig.newBuilder().build();
- * ExportModelResponse response = modelServiceClient.exportModelAsync(name, outputConfig).get();
- * }
- *
- *
* @param name Required. The resource name of the Model to export. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @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
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportModelRequest.OutputConfig outputConfig = ExportModelRequest.OutputConfig.newBuilder().build();
- * ExportModelResponse response = modelServiceClient.exportModelAsync(name.toString(), outputConfig).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 (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportModelRequest.OutputConfig outputConfig = ExportModelRequest.OutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * ExportModelResponse response = modelServiceClient.exportModelAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
ExportModelRequest, ExportModelResponse, ExportModelOperationMetadata>
exportModelOperationCallable() {
return stub.exportModelOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports a trained, exportable, Model to a location specified by the user. A Model is considered
* to be exportable if it has at least one [supported export
* format][google.cloud.aiplatform.v1beta1.Model.supported_export_formats].
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportModelRequest.OutputConfig outputConfig = ExportModelRequest.OutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * OperationFuture<ExportModelResponse, ExportModelOperationMetadata> future = modelServiceClient.exportModelOperationCallable().futureCall(request);
- * // Do something
- * ExportModelResponse response = future.get();
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ExportModelRequest.OutputConfig outputConfig = ExportModelRequest.OutputConfig.newBuilder().build();
- * ExportModelRequest request = ExportModelRequest.newBuilder()
- * .setName(name.toString())
- * .setOutputConfig(outputConfig)
- * .build();
- * ApiFuture<Operation> future = modelServiceClient.exportModelCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
* @param name Required. The name of the ModelEvaluation resource. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * ModelEvaluation response = modelServiceClient.getModelEvaluation(name);
- * }
- *
- *
* @param name Required. The name of the ModelEvaluation resource. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * ModelEvaluation response = modelServiceClient.getModelEvaluation(name.toString());
- * }
- *
- *
* @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
*/
@@ -949,44 +555,21 @@ public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest reques
return getModelEvaluationCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluation.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ModelEvaluation response = modelServiceClient.getModelEvaluation(request);
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<ModelEvaluation> future = modelServiceClient.getModelEvaluationCallable().futureCall(request);
- * // Do something
- * ModelEvaluation response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Model to list the ModelEvaluations from.
* Format: `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -999,21 +582,10 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName pa
return listModelEvaluations(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluations in a Model.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * for (ModelEvaluation element : modelServiceClient.listModelEvaluations(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Model to list the ModelEvaluations from.
* Format: `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1024,24 +596,10 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(String paren
return listModelEvaluations(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluations in a Model.
*
- *
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * for (ModelEvaluation element : modelServiceClient.listModelEvaluations(parent.toString()).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
*/
@@ -1050,76 +608,32 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(
return listModelEvaluationsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluations in a Model.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (ModelEvaluation element : modelServiceClient.listModelEvaluations(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListModelEvaluationsPagedResponse> future = modelServiceClient.listModelEvaluationsPagedCallable().futureCall(request);
- * // Do something
- * for (ModelEvaluation element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
- * ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListModelEvaluationsResponse response = modelServiceClient.listModelEvaluationsCallable().call(request);
- * for (ModelEvaluation element : response.getModelEvaluationsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param name Required. The name of the ModelEvaluationSlice resource. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationSliceName name = ModelEvaluationSliceName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]");
- * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(name);
- * }
- *
- *
* @param name Required. The name of the ModelEvaluationSlice resource. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationSliceName name = ModelEvaluationSliceName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]");
- * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(name.toString());
- * }
- *
- *
* @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
*/
@@ -1179,44 +672,21 @@ public final ModelEvaluationSlice getModelEvaluationSlice(
return getModelEvaluationSliceCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a ModelEvaluationSlice.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationSliceName name = ModelEvaluationSliceName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]");
- * GetModelEvaluationSliceRequest request = GetModelEvaluationSliceRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(request);
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationSliceName name = ModelEvaluationSliceName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]");
- * GetModelEvaluationSliceRequest request = GetModelEvaluationSliceRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<ModelEvaluationSlice> future = modelServiceClient.getModelEvaluationSliceCallable().futureCall(request);
- * // Do something
- * ModelEvaluationSlice response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the ModelEvaluation to list the
* ModelEvaluationSlices from. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * for (ModelEvaluationSlice element : modelServiceClient.listModelEvaluationSlices(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the ModelEvaluation to list the
* ModelEvaluationSlices from. Format:
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * for (ModelEvaluationSlice element : modelServiceClient.listModelEvaluationSlices(parent.toString()).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
*/
@@ -1283,25 +728,11 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
return listModelEvaluationSlicesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * ListModelEvaluationSlicesRequest request = ListModelEvaluationSlicesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (ModelEvaluationSlice element : modelServiceClient.listModelEvaluationSlices(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable<
ListModelEvaluationSlicesRequest, ListModelEvaluationSlicesPagedResponse>
@@ -1309,32 +740,11 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
return stub.listModelEvaluationSlicesPagedCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
*
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * ListModelEvaluationSlicesRequest request = ListModelEvaluationSlicesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListModelEvaluationSlicesPagedResponse> future = modelServiceClient.listModelEvaluationSlicesPagedCallable().futureCall(request);
- * // Do something
- * for (ModelEvaluationSlice element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
- * ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
- * ListModelEvaluationSlicesRequest request = ListModelEvaluationSlicesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListModelEvaluationSlicesResponse response = modelServiceClient.listModelEvaluationSlicesCallable().call(request);
- * for (ModelEvaluationSlice element : response.getModelEvaluationSlicesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class ModelServiceSettings extends ClientSettings
- * ModelServiceSettings.Builder modelServiceSettingsBuilder =
- * ModelServiceSettings.newBuilder();
+ *
- * {@code
+ * ModelServiceSettings.Builder modelServiceSettingsBuilder = ModelServiceSettings.newBuilder();
* modelServiceSettingsBuilder
* .getModelSettings()
* .setRetrySettings(
- * modelServiceSettingsBuilder.getModelSettings().getRetrySettings().toBuilder()
+ * modelServiceSettingsBuilder
+ * .getModelSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ModelServiceSettings modelServiceSettings = modelServiceSettingsBuilder.build();
- *
- *
- *
- *
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
- * TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
- * }
- *
- *
- *
+ * }
*
- * To customize the endpoint:
+ *
+ *
- * {@code
* PipelineServiceSettings pipelineServiceSettings =
* PipelineServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* PipelineServiceClient pipelineServiceClient =
* PipelineServiceClient.create(pipelineServiceSettings);
- *
- *
+ * }
+ *
+ *
+ *
- * {@code
* PipelineServiceSettings pipelineServiceSettings =
* PipelineServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* PipelineServiceClient pipelineServiceClient =
* PipelineServiceClient.create(pipelineServiceSettings);
- *
- *
* @param parent Required. The resource name of the Location to create the TrainingPipeline in.
* Format: `projects/{project}/locations/{location}`
* @param trainingPipeline Required. The TrainingPipeline to create.
@@ -202,20 +179,10 @@ public final TrainingPipeline createTrainingPipeline(
return createTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
- *
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
- * TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
- * }
- *
- *
* @param parent Required. The resource name of the Location to create the TrainingPipeline in.
* Format: `projects/{project}/locations/{location}`
* @param trainingPipeline Required. The TrainingPipeline to create.
@@ -231,24 +198,10 @@ public final TrainingPipeline createTrainingPipeline(
return createTrainingPipeline(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
- *
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
- * TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(parent.toString(), trainingPipeline);
- * }
- *
- *
* @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
*/
@@ -256,44 +209,21 @@ public final TrainingPipeline createTrainingPipeline(CreateTrainingPipelineReque
return createTrainingPipelineCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
- * CreateTrainingPipelineRequest request = CreateTrainingPipelineRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTrainingPipeline(trainingPipeline)
- * .build();
- * TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(request);
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
- * CreateTrainingPipelineRequest request = CreateTrainingPipelineRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTrainingPipeline(trainingPipeline)
- * .build();
- * ApiFuture<TrainingPipeline> future = pipelineServiceClient.createTrainingPipelineCallable().futureCall(request);
- * // Do something
- * TrainingPipeline response = future.get();
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline resource. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline resource. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name.toString());
- * }
- *
- *
* @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
*/
@@ -352,44 +261,21 @@ public final TrainingPipeline getTrainingPipeline(GetTrainingPipelineRequest req
return getTrainingPipelineCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a TrainingPipeline.
*
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * GetTrainingPipelineRequest request = GetTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(request);
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * GetTrainingPipelineRequest request = GetTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<TrainingPipeline> future = pipelineServiceClient.getTrainingPipelineCallable().futureCall(request);
- * // Do something
- * TrainingPipeline response = future.get();
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the TrainingPipelines from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -402,21 +288,10 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(LocationNa
return listTrainingPipelines(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists TrainingPipelines in a Location.
*
- *
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (TrainingPipeline element : pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The resource name of the Location to list the TrainingPipelines from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -427,24 +302,10 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(String par
return listTrainingPipelines(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists TrainingPipelines in a Location.
*
- *
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (TrainingPipeline element : pipelineServiceClient.listTrainingPipelines(parent.toString()).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
*/
@@ -453,82 +314,36 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(
return listTrainingPipelinesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists TrainingPipelines in a Location.
*
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListTrainingPipelinesRequest request = ListTrainingPipelinesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (TrainingPipeline element : pipelineServiceClient.listTrainingPipelines(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListTrainingPipelinesRequest request = ListTrainingPipelinesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListTrainingPipelinesPagedResponse> future = pipelineServiceClient.listTrainingPipelinesPagedCallable().futureCall(request);
- * // Do something
- * for (TrainingPipeline element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListTrainingPipelinesRequest request = ListTrainingPipelinesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListTrainingPipelinesResponse response = pipelineServiceClient.listTrainingPipelinesCallable().call(request);
- * for (TrainingPipeline element : response.getTrainingPipelinesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * pipelineServiceClient.deleteTrainingPipelineAsync(name.toString()).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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * DeleteTrainingPipelineRequest request = DeleteTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * pipelineServiceClient.deleteTrainingPipelineAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * DeleteTrainingPipelineRequest request = DeleteTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, DeleteOperationMetadata> future = pipelineServiceClient.deleteTrainingPipelineOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * DeleteTrainingPipelineRequest request = DeleteTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = pipelineServiceClient.deleteTrainingPipelineCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline to cancel. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * pipelineServiceClient.cancelTrainingPipeline(name);
- * }
- *
- *
* @param name Required. The name of the TrainingPipeline to cancel. Format:
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * pipelineServiceClient.cancelTrainingPipeline(name.toString());
- * }
- *
- *
* @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
*/
@@ -738,7 +473,7 @@ public final void cancelTrainingPipeline(CancelTrainingPipelineRequest request)
cancelTrainingPipelineCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
* server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
@@ -753,18 +488,6 @@ public final void cancelTrainingPipeline(CancelTrainingPipelineRequest request)
* `CANCELLED`.
*
*
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * CancelTrainingPipelineRequest request = CancelTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * pipelineServiceClient.cancelTrainingPipeline(request);
- * }
- *
*/
public final UnaryCallable
- * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
- * TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
- * CancelTrainingPipelineRequest request = CancelTrainingPipelineRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = pipelineServiceClient.cancelTrainingPipelineCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class PipelineServiceSettings extends ClientSettings
+ *
- * {@code
* PipelineServiceSettings.Builder pipelineServiceSettingsBuilder =
* PipelineServiceSettings.newBuilder();
* pipelineServiceSettingsBuilder
* .createTrainingPipelineSettings()
* .setRetrySettings(
- * pipelineServiceSettingsBuilder.createTrainingPipelineSettings().getRetrySettings().toBuilder()
+ * pipelineServiceSettingsBuilder
+ * .createTrainingPipelineSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* PipelineServiceSettings pipelineServiceSettings = pipelineServiceSettingsBuilder.build();
- *
- *
- *
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * Value parameters = Value.newBuilder().build();
- * PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
- * }
- *
- *
- *
+ * }
*
- * To customize the endpoint:
+ *
+ *
- * {@code
* PredictionServiceSettings predictionServiceSettings =
* PredictionServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* PredictionServiceClient predictionServiceClient =
* PredictionServiceClient.create(predictionServiceSettings);
- *
- *
+ * }
+ *
+ *
+ *
- * {@code
* PredictionServiceSettings predictionServiceSettings =
* PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* PredictionServiceClient predictionServiceClient =
* PredictionServiceClient.create(predictionServiceSettings);
- *
- *
* @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the prediction call. A
@@ -192,21 +169,10 @@ public final PredictResponse predict(
return predict(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online prediction.
*
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * Value parameters = Value.newBuilder().build();
- * PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the prediction call. A
@@ -234,24 +200,10 @@ public final PredictResponse predict(String endpoint, List
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * Value parameters = Value.newBuilder().build();
- * PredictResponse response = predictionServiceClient.predict(endpoint.toString(), instances, parameters);
- * }
- *
- *
* @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
*/
@@ -259,31 +211,17 @@ public final PredictResponse predict(PredictRequest request) {
return predictCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online prediction.
*
*
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .addAllInstances(instances)
- * .build();
- * PredictResponse response = predictionServiceClient.predict(request);
- * }
- *
*/
public final UnaryCallable
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .addAllInstances(instances)
- * .build();
- * ApiFuture<PredictResponse> future = predictionServiceClient.predictCallable().futureCall(request);
- * // Do something
- * PredictResponse response = future.get();
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint requested to serve the explanation. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the explanation call. A
@@ -339,7 +265,7 @@ public final ExplainResponse explain(
return explain(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online explanation.
*
@@ -351,18 +277,6 @@ public final ExplainResponse explain(
* [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated.
* Only deployed AutoML tabular Models have explanation_spec.
*
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * Value parameters = Value.newBuilder().build();
- * String deployedModelId = "";
- * ExplainResponse response = predictionServiceClient.explain(endpoint, instances, parameters, deployedModelId);
- * }
- *
- *
* @param endpoint Required. The name of the Endpoint requested to serve the explanation. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the explanation call. A
@@ -395,7 +309,7 @@ public final ExplainResponse explain(
return explain(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online explanation.
*
@@ -407,20 +321,6 @@ public final ExplainResponse explain(
* [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] populated.
* Only deployed AutoML tabular Models have explanation_spec.
*
- *
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * Value parameters = Value.newBuilder().build();
- * String deployedModelId = "";
- * ExplainResponse response = predictionServiceClient.explain(endpoint.toString(), instances, parameters, deployedModelId);
- * }
- *
- *
* @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
*/
@@ -428,7 +328,7 @@ public final ExplainResponse explain(ExplainRequest request) {
return explainCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online explanation.
*
@@ -441,20 +341,6 @@ public final ExplainResponse explain(ExplainRequest request) {
* Only deployed AutoML tabular Models have explanation_spec.
*
*
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * ExplainRequest request = ExplainRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .addAllInstances(instances)
- * .build();
- * ExplainResponse response = predictionServiceClient.explain(request);
- * }
- *
*/
public final UnaryCallable
- * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
- * List<Value> instances = new ArrayList<>();
- * ExplainRequest request = ExplainRequest.newBuilder()
- * .setEndpoint(endpoint.toString())
- * .addAllInstances(instances)
- * .build();
- * ApiFuture<ExplainResponse> future = predictionServiceClient.explainCallable().futureCall(request);
- * // Do something
- * ExplainResponse response = future.get();
- * }
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
-@BetaApi
+@Generated("by gapic-generator-java")
public class PredictionServiceSettings extends ClientSettings
+ *
- * {@code
* PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
* PredictionServiceSettings.newBuilder();
* predictionServiceSettingsBuilder
* .predictSettings()
* .setRetrySettings(
- * predictionServiceSettingsBuilder.predictSettings().getRetrySettings().toBuilder()
+ * predictionServiceSettingsBuilder
+ * .predictSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
- *
- *
- *
- *
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
- * }
- *
- *
- *
+ * }
*
- * To customize the endpoint:
+ *
+ *
- * {@code
* SpecialistPoolServiceSettings specialistPoolServiceSettings =
* SpecialistPoolServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* SpecialistPoolServiceClient specialistPoolServiceClient =
* SpecialistPoolServiceClient.create(specialistPoolServiceSettings);
- *
- *
+ * }
+ *
+ *
+ *
- * {@code
* SpecialistPoolServiceSettings specialistPoolServiceSettings =
* SpecialistPoolServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* SpecialistPoolServiceClient specialistPoolServiceClient =
* SpecialistPoolServiceClient.create(specialistPoolServiceSettings);
- *
- *
* @param parent Required. The parent Project name for the new SpecialistPool. The form is
* `projects/{project}/locations/{location}`.
* @param specialistPool Required. The SpecialistPool to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
- * SpecialistPool response = specialistPoolServiceClient.createSpecialistPoolAsync(parent, specialistPool).get();
- * }
- *
- *
* @param parent Required. The parent Project name for the new SpecialistPool. The form is
* `projects/{project}/locations/{location}`.
* @param specialistPool Required. The SpecialistPool to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
- * SpecialistPool response = specialistPoolServiceClient.createSpecialistPoolAsync(parent.toString(), specialistPool).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 (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
- * CreateSpecialistPoolRequest request = CreateSpecialistPoolRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSpecialistPool(specialistPool)
- * .build();
- * SpecialistPool response = specialistPoolServiceClient.createSpecialistPoolAsync(request).get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<
CreateSpecialistPoolRequest, SpecialistPool, CreateSpecialistPoolOperationMetadata>
createSpecialistPoolOperationCallable() {
return stub.createSpecialistPoolOperationCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a SpecialistPool.
*
*
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
- * CreateSpecialistPoolRequest request = CreateSpecialistPoolRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSpecialistPool(specialistPool)
- * .build();
- * OperationFuture<SpecialistPool, CreateSpecialistPoolOperationMetadata> future = specialistPoolServiceClient.createSpecialistPoolOperationCallable().futureCall(request);
- * // Do something
- * SpecialistPool response = future.get();
- * }
- *
*/
public final UnaryCallable
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
- * CreateSpecialistPoolRequest request = CreateSpecialistPoolRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSpecialistPool(specialistPool)
- * .build();
- * ApiFuture<Operation> future = specialistPoolServiceClient.createSpecialistPoolCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
* @param name Required. The name of the SpecialistPool resource. The form is
*
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
- * }
- *
- *
* @param name Required. The name of the SpecialistPool resource. The form is
*
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name.toString());
- * }
- *
- *
* @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
*/
@@ -389,43 +278,20 @@ public final SpecialistPool getSpecialistPool(GetSpecialistPoolRequest request)
return getSpecialistPoolCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets a SpecialistPool.
*
*
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * GetSpecialistPoolRequest request = GetSpecialistPoolRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(request);
- * }
- *
*/
public final UnaryCallable
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * GetSpecialistPoolRequest request = GetSpecialistPoolRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<SpecialistPool> future = specialistPoolServiceClient.getSpecialistPoolCallable().futureCall(request);
- * // Do something
- * SpecialistPool response = future.get();
- * }
- *
- *
* @param parent Required. The name of the SpecialistPool's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -438,21 +304,10 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(LocationName p
return listSpecialistPools(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists SpecialistPools in a Location.
*
- *
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (SpecialistPool element : specialistPoolServiceClient.listSpecialistPools(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The name of the SpecialistPool's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -463,24 +318,10 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(String parent)
return listSpecialistPools(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists SpecialistPools in a Location.
*
- *
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (SpecialistPool element : specialistPoolServiceClient.listSpecialistPools(parent.toString()).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
*/
@@ -489,82 +330,36 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(
return listSpecialistPoolsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists SpecialistPools in a Location.
*
*
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSpecialistPoolsRequest request = ListSpecialistPoolsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (SpecialistPool element : specialistPoolServiceClient.listSpecialistPools(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSpecialistPoolsRequest request = ListSpecialistPoolsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListSpecialistPoolsPagedResponse> future = specialistPoolServiceClient.listSpecialistPoolsPagedCallable().futureCall(request);
- * // Do something
- * for (SpecialistPool element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable
- * try (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSpecialistPoolsRequest request = ListSpecialistPoolsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListSpecialistPoolsResponse response = specialistPoolServiceClient.listSpecialistPoolsCallable().call(request);
- * for (SpecialistPool element : response.getSpecialistPoolsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
* @param name Required. The resource name of the SpecialistPool to delete. Format:
* `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`
* @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 (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * specialistPoolServiceClient.deleteSpecialistPoolAsync(name).get();
- * }
- *
- *
* @param name Required. The resource name of the SpecialistPool to delete. Format:
* `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`
* @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 (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * specialistPoolServiceClient.deleteSpecialistPoolAsync(name.toString()).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 (SpecialistPoolServiceClient specialistPoolServiceClient = SpecialistPoolServiceClient.create()) {
- * SpecialistPoolName name = SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
- * DeleteSpecialistPoolRequest request = DeleteSpecialistPoolRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * specialistPoolServiceClient.deleteSpecialistPoolAsync(request).get();
- * }
- *