diff --git a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java index 274ca5cc..a69098b9 100644 --- a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java +++ b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java @@ -47,6 +47,14 @@ *
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: * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); + * } + * }+ * *
Note: close() needs to be called on the DataLabelingServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -165,6 +173,16 @@ public final OperationsClient getOperationsClient() { /** * Creates dataset. If success return a Dataset resource. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); + * } + * }+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param dataset Required. The dataset to be created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -182,6 +200,16 @@ public final Dataset createDataset(ProjectName parent, Dataset dataset) { /** * Creates dataset. If success return a Dataset resource. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); + * } + * }+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param dataset Required. The dataset to be created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -196,6 +224,19 @@ public final Dataset createDataset(String parent, Dataset dataset) { /** * Creates dataset. If success return a Dataset resource. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * Dataset response = dataLabelingServiceClient.createDataset(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -208,6 +249,20 @@ public final Dataset createDataset(CreateDatasetRequest request) { * Creates dataset. If success return a Dataset resource. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.createDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + * Dataset response = dataLabelingServiceClient.getDataset(name); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -231,6 +295,15 @@ public final Dataset getDataset(DatasetName name) { /** * Gets dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * Dataset response = dataLabelingServiceClient.getDataset(name); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -244,6 +317,18 @@ public final Dataset getDataset(String name) { /** * Gets dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .build(); + * Dataset response = dataLabelingServiceClient.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 */ @@ -256,6 +341,19 @@ public final Dataset getDataset(GetDatasetRequest request) { * Gets dataset by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param filter Optional. Filter on dataset is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -282,6 +392,18 @@ public final ListDatasetsPagedResponse listDatasets(ProjectName parent, String f /** * Lists datasets under a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param filter Optional. Filter on dataset is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -296,6 +418,23 @@ public final ListDatasetsPagedResponse listDatasets(String parent, String filter /** * Lists datasets under a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Dataset element : dataLabelingServiceClient.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 */ @@ -308,6 +447,24 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists datasets under a project. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listDatasetsPagedCallable().futureCall(request); + * // Do something. + * for (Dataset element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListDatasetsResponse response = + * dataLabelingServiceClient.listDatasetsCallable().call(request); + * for (Dataset element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + * dataLabelingServiceClient.deleteDataset(name); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -342,6 +526,15 @@ public final void deleteDataset(DatasetName name) { /** * Deletes a dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * dataLabelingServiceClient.deleteDataset(name); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -355,6 +548,18 @@ public final void deleteDataset(String name) { /** * Deletes a dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .build(); + * dataLabelingServiceClient.deleteDataset(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 */ @@ -367,6 +572,19 @@ public final void deleteDataset(DeleteDatasetRequest request) { * Deletes a dataset by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.deleteDatasetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * ImportDataOperationResponse response = + * dataLabelingServiceClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param inputConfig Required. Specify the input source of the data. @@ -401,6 +630,17 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * InputConfig inputConfig = InputConfig.newBuilder().build(); + * ImportDataOperationResponse response = + * dataLabelingServiceClient.importDataAsync(name, inputConfig).get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param inputConfig Required. Specify the input source of the data. @@ -420,6 +660,21 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * ImportDataOperationResponse response = + * dataLabelingServiceClient.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 */ @@ -436,6 +691,21 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * OperationFuture*/ public final OperationCallable< ImportDataRequest, ImportDataOperationResponse, ImportDataOperationMetadata> @@ -451,6 +721,21 @@ public final UnaryCallablefuture = + * dataLabelingServiceClient.importDataOperationCallable().futureCall(request); + * // Do something. + * ImportDataOperationResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setInputConfig(InputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.importDataCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + * AnnotatedDatasetName annotatedDataset = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); + * String filter = "filter-1274492040"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportDataOperationResponse response = + * dataLabelingServiceClient + * .exportDataAsync(name, annotatedDataset, filter, outputConfig) + * .get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -489,6 +790,22 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + * String annotatedDataset = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); + * String filter = "filter-1274492040"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportDataOperationResponse response = + * dataLabelingServiceClient + * .exportDataAsync(name, annotatedDataset, filter, outputConfig) + * .get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -515,6 +832,22 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * AnnotatedDatasetName annotatedDataset = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); + * String filter = "filter-1274492040"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportDataOperationResponse response = + * dataLabelingServiceClient + * .exportDataAsync(name, annotatedDataset, filter, outputConfig) + * .get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -544,6 +877,22 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * String annotatedDataset = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); + * String filter = "filter-1274492040"; + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportDataOperationResponse response = + * dataLabelingServiceClient + * .exportDataAsync(name, annotatedDataset, filter, outputConfig) + * .get(); + * } + * }+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -570,6 +919,25 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setAnnotatedDataset( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .setFilter("filter-1274492040") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * ExportDataOperationResponse response = + * dataLabelingServiceClient.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 */ @@ -583,6 +951,25 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setAnnotatedDataset( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .setFilter("filter-1274492040") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * OperationFuture*/ public final OperationCallable< ExportDataRequest, ExportDataOperationResponse, ExportDataOperationMetadata> @@ -595,6 +982,25 @@ public final UnaryCallablefuture = + * dataLabelingServiceClient.exportDataOperationCallable().futureCall(request); + * // Do something. + * ExportDataOperationResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setAnnotatedDataset( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .setFilter("filter-1274492040") + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .setUserEmailAddress("userEmailAddress-1844787165") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.exportDataCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DataItemName name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]"); + * DataItem response = dataLabelingServiceClient.getDataItem(name); + * } + * }+ * * @param name Required. The name of the data item to get, format: * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -620,6 +1035,15 @@ public final DataItem getDataItem(DataItemName name) { * Gets a data item in a dataset by resource name. This API can be called after data are imported * into dataset. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString(); + * DataItem response = dataLabelingServiceClient.getDataItem(name); + * } + * }+ * * @param name Required. The name of the data item to get, format: * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -634,6 +1058,18 @@ public final DataItem getDataItem(String name) { * Gets a data item in a dataset by resource name. This API can be called after data are imported * into dataset. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetDataItemRequest request = + * GetDataItemRequest.newBuilder() + * .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString()) + * .build(); + * DataItem response = dataLabelingServiceClient.getDataItem(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 */ @@ -647,6 +1083,19 @@ public final DataItem getDataItem(GetDataItemRequest request) { * into dataset. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetDataItemRequest request = + * GetDataItemRequest.newBuilder() + * .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getDataItemCallable().futureCall(request); + * // Do something. + * DataItem response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); + * String filter = "filter-1274492040"; + * for (DataItem element : + * dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the dataset to list data items, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -676,6 +1138,19 @@ public final ListDataItemsPagedResponse listDataItems(DatasetName parent, String * Lists data items in a dataset. This API can be called after data are imported into dataset. * Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * String filter = "filter-1274492040"; + * for (DataItem element : + * dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the dataset to list data items, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -692,6 +1167,23 @@ public final ListDataItemsPagedResponse listDataItems(String parent, String filt * Lists data items in a dataset. This API can be called after data are imported into dataset. * Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListDataItemsRequest request = + * ListDataItemsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (DataItem element : dataLabelingServiceClient.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 */ @@ -705,6 +1197,24 @@ public final ListDataItemsPagedResponse listDataItems(ListDataItemsRequest reque * Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListDataItemsRequest request = + * ListDataItemsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listDataItemsPagedCallable().futureCall(request); + * // Do something. + * for (DataItem element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListDataItemsResponse response = + * dataLabelingServiceClient.listDataItemsCallable().call(request); + * for (DataItem element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * AnnotatedDatasetName name = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); + * AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name); + * } + * }+ * * @param name Required. Name of the annotated dataset to get, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -742,6 +1280,16 @@ public final AnnotatedDataset getAnnotatedDataset(AnnotatedDatasetName name) { /** * Gets an annotated dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); + * AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name); + * } + * }+ * * @param name Required. Name of the annotated dataset to get, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -756,6 +1304,20 @@ public final AnnotatedDataset getAnnotatedDataset(String name) { /** * Gets an annotated dataset by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetAnnotatedDatasetRequest request = + * GetAnnotatedDatasetRequest.newBuilder() + * .setName( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .build(); + * AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(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 */ @@ -768,6 +1330,21 @@ public final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest req * Gets an annotated dataset by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetAnnotatedDatasetRequest request = + * GetAnnotatedDatasetRequest.newBuilder() + * .setName( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request); + * // Do something. + * AnnotatedDataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); + * String filter = "filter-1274492040"; + * for (AnnotatedDataset element : + * dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the dataset to list annotated datasets, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -797,6 +1387,19 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( /** * Lists annotated datasets for a dataset. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * String filter = "filter-1274492040"; + * for (AnnotatedDataset element : + * dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the dataset to list annotated datasets, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -813,6 +1416,24 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( /** * Lists annotated datasets for a dataset. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListAnnotatedDatasetsRequest request = + * ListAnnotatedDatasetsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (AnnotatedDataset element : + * dataLabelingServiceClient.listAnnotatedDatasets(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 */ @@ -826,6 +1447,24 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( * Lists annotated datasets for a dataset. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListAnnotatedDatasetsRequest request = + * ListAnnotatedDatasetsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listAnnotatedDatasetsPagedCallable().futureCall(request); + * // Do something. + * for (AnnotatedDataset element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListAnnotatedDatasetsResponse response = + * dataLabelingServiceClient.listAnnotatedDatasetsCallable().call(request); + * for (AnnotatedDataset element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteAnnotatedDatasetRequest request = + * DeleteAnnotatedDatasetRequest.newBuilder() + * .setName( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .build(); + * dataLabelingServiceClient.deleteAnnotatedDataset(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 */ @@ -859,6 +1530,21 @@ public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request) * Deletes an annotated dataset by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteAnnotatedDatasetRequest request = + * DeleteAnnotatedDatasetRequest.newBuilder() + * .setName( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -892,6 +1590,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -914,6 +1624,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelImageRequest request = + * LabelImageRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(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 */ @@ -928,6 +1651,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelImageRequest request = + * LabelImageRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * dataLabelingServiceClient.labelImageOperationCallable().futureCall(request); + * // Do something. + * AnnotatedDataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelImageRequest request = + * LabelImageRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.labelImageCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -972,6 +1735,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -994,6 +1769,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelVideoRequest request = + * LabelVideoRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(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 */ @@ -1008,6 +1796,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelVideoRequest request = + * LabelVideoRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * dataLabelingServiceClient.labelVideoOperationCallable().futureCall(request); + * // Do something. + * AnnotatedDataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelVideoRequest request = + * LabelVideoRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.labelVideoCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the data set to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -1052,6 +1880,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + * HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); + * LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0); + * AnnotatedDataset response = + * dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get(); + * } + * }+ * * @param parent Required. Name of the data set to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -1074,6 +1914,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelTextRequest request = + * LabelTextRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(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 */ @@ -1088,6 +1941,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelTextRequest request = + * LabelTextRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * dataLabelingServiceClient.labelTextOperationCallable().futureCall(request); + * // Do something. + * AnnotatedDataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * LabelTextRequest request = + * LabelTextRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + * .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.labelTextCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ExampleName name = + * ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]"); + * String filter = "filter-1274492040"; + * Example response = dataLabelingServiceClient.getExample(name, filter); + * } + * }+ * * @param name Required. Name of example, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ * {annotated_dataset_id}/examples/{example_id} @@ -1130,6 +2022,17 @@ public final Example getExample(ExampleName name, String filter) { /** * Gets an example by resource name, including both data and annotation. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = + * ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]").toString(); + * String filter = "filter-1274492040"; + * Example response = dataLabelingServiceClient.getExample(name, filter); + * } + * }+ * * @param name Required. Name of example, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ * {annotated_dataset_id}/examples/{example_id} @@ -1148,6 +2051,21 @@ public final Example getExample(String name, String filter) { /** * Gets an example by resource name, including both data and annotation. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetExampleRequest request = + * GetExampleRequest.newBuilder() + * .setName( + * ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]") + * .toString()) + * .setFilter("filter-1274492040") + * .build(); + * Example response = dataLabelingServiceClient.getExample(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 */ @@ -1160,6 +2078,22 @@ public final Example getExample(GetExampleRequest request) { * Gets an example by resource name, including both data and annotation. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetExampleRequest request = + * GetExampleRequest.newBuilder() + * .setName( + * ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]") + * .toString()) + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getExampleCallable().futureCall(request); + * // Do something. + * Example response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * AnnotatedDatasetName parent = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); + * String filter = "filter-1274492040"; + * for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Example resource parent. * @param filter Optional. An expression for filtering Examples. For annotated datasets that have * annotation spec set, filter by annotation_spec.display_name is supported. Format @@ -1188,6 +2135,19 @@ public final ListExamplesPagedResponse listExamples(AnnotatedDatasetName parent, /** * Lists examples in an annotated dataset. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); + * String filter = "filter-1274492040"; + * for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Example resource parent. * @param filter Optional. An expression for filtering Examples. For annotated datasets that have * annotation spec set, filter by annotation_spec.display_name is supported. Format @@ -1204,6 +2164,25 @@ public final ListExamplesPagedResponse listExamples(String parent, String filter /** * Lists examples in an annotated dataset. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListExamplesRequest request = + * ListExamplesRequest.newBuilder() + * .setParent( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Example element : dataLabelingServiceClient.listExamples(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 */ @@ -1216,6 +2195,26 @@ public final ListExamplesPagedResponse listExamples(ListExamplesRequest request) * Lists examples in an annotated dataset. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListExamplesRequest request = + * ListExamplesRequest.newBuilder() + * .setParent( + * AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") + * .toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listExamplesPagedCallable().futureCall(request); + * // Do something. + * for (Example element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListExamplesResponse response = + * dataLabelingServiceClient.listExamplesCallable().call(request); + * for (Example element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build(); + * AnnotationSpecSet response = + * dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet); + * } + * }+ * * @param parent Required. AnnotationSpecSet resource parent, format: projects/{project_id} * @param annotationSpecSet Required. Annotation spec set to create. Annotation specs must be * included. Only one annotation spec will be accepted for annotation specs with same @@ -1256,6 +2284,17 @@ public final AnnotationSpecSet createAnnotationSpecSet( /** * Creates an annotation spec set by providing a set of labels. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build(); + * AnnotationSpecSet response = + * dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet); + * } + * }+ * * @param parent Required. AnnotationSpecSet resource parent, format: projects/{project_id} * @param annotationSpecSet Required. Annotation spec set to create. Annotation specs must be * included. Only one annotation spec will be accepted for annotation specs with same @@ -1276,6 +2315,19 @@ public final AnnotationSpecSet createAnnotationSpecSet( /** * Creates an annotation spec set by providing a set of labels. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateAnnotationSpecSetRequest request = + * CreateAnnotationSpecSetRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build()) + * .build(); + * AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(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 */ @@ -1288,6 +2340,20 @@ public final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRe * Creates an annotation spec set by providing a set of labels. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateAnnotationSpecSetRequest request = + * CreateAnnotationSpecSetRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request); + * // Do something. + * AnnotationSpecSet response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]"); + * AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name); + * } + * }+ * * @param name Required. AnnotationSpecSet resource name, format: * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1314,6 +2389,15 @@ public final AnnotationSpecSet getAnnotationSpecSet(AnnotationSpecSetName name) /** * Gets an annotation spec set by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString(); + * AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name); + * } + * }+ * * @param name Required. AnnotationSpecSet resource name, format: * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1328,6 +2412,18 @@ public final AnnotationSpecSet getAnnotationSpecSet(String name) { /** * Gets an annotation spec set by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetAnnotationSpecSetRequest request = + * GetAnnotationSpecSetRequest.newBuilder() + * .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) + * .build(); + * AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(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 */ @@ -1340,6 +2436,19 @@ public final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest * Gets an annotation spec set by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetAnnotationSpecSetRequest request = + * GetAnnotationSpecSetRequest.newBuilder() + * .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request); + * // Do something. + * AnnotationSpecSet response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (AnnotationSpecSet element : + * dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Parent of AnnotationSpecSet resource, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1368,6 +2490,19 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( /** * Lists annotation spec sets for a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (AnnotationSpecSet element : + * dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Parent of AnnotationSpecSet resource, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1383,6 +2518,24 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( /** * Lists annotation spec sets for a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListAnnotationSpecSetsRequest request = + * ListAnnotationSpecSetsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (AnnotationSpecSet element : + * dataLabelingServiceClient.listAnnotationSpecSets(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 */ @@ -1396,6 +2549,24 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( * Lists annotation spec sets for a project. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListAnnotationSpecSetsRequest request = + * ListAnnotationSpecSetsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listAnnotationSpecSetsPagedCallable().futureCall(request); + * // Do something. + * for (AnnotationSpecSet element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListAnnotationSpecSetsResponse response = + * dataLabelingServiceClient.listAnnotationSpecSetsCallable().call(request); + * for (AnnotationSpecSet element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]"); + * dataLabelingServiceClient.deleteAnnotationSpecSet(name); + * } + * }+ * * @param name Required. AnnotationSpec resource name, format: * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1433,6 +2631,15 @@ public final void deleteAnnotationSpecSet(AnnotationSpecSetName name) { /** * Deletes an annotation spec set by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString(); + * dataLabelingServiceClient.deleteAnnotationSpecSet(name); + * } + * }+ * * @param name Required. AnnotationSpec resource name, format: * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1447,6 +2654,18 @@ public final void deleteAnnotationSpecSet(String name) { /** * Deletes an annotation spec set by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteAnnotationSpecSetRequest request = + * DeleteAnnotationSpecSetRequest.newBuilder() + * .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) + * .build(); + * dataLabelingServiceClient.deleteAnnotationSpecSet(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 */ @@ -1459,6 +2678,19 @@ public final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request * Deletes an annotation spec set by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteAnnotationSpecSetRequest request = + * DeleteAnnotationSpecSetRequest.newBuilder() + * .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Instruction instruction = Instruction.newBuilder().build(); + * Instruction response = + * dataLabelingServiceClient.createInstructionAsync(parent, instruction).get(); + * } + * }+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param instruction Required. Instruction of how to perform the labeling task. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1487,6 +2730,17 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * Instruction instruction = Instruction.newBuilder().build(); + * Instruction response = + * dataLabelingServiceClient.createInstructionAsync(parent, instruction).get(); + * } + * }+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param instruction Required. Instruction of how to perform the labeling task. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1502,6 +2756,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateInstructionRequest request = + * CreateInstructionRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setInstruction(Instruction.newBuilder().build()) + * .build(); + * Instruction response = dataLabelingServiceClient.createInstructionAsync(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 */ @@ -1515,6 +2782,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateInstructionRequest request = + * CreateInstructionRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setInstruction(Instruction.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request); + * // Do something. + * Instruction response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateInstructionRequest request = + * CreateInstructionRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setInstruction(Instruction.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.createInstructionCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]"); + * Instruction response = dataLabelingServiceClient.getInstruction(name); + * } + * }+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1549,6 +2853,15 @@ public final Instruction getInstruction(InstructionName name) { /** * Gets an instruction by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString(); + * Instruction response = dataLabelingServiceClient.getInstruction(name); + * } + * }+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1562,6 +2875,18 @@ public final Instruction getInstruction(String name) { /** * Gets an instruction by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetInstructionRequest request = + * GetInstructionRequest.newBuilder() + * .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) + * .build(); + * Instruction response = dataLabelingServiceClient.getInstruction(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 */ @@ -1574,6 +2899,19 @@ public final Instruction getInstruction(GetInstructionRequest request) { * Gets an instruction by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetInstructionRequest request = + * GetInstructionRequest.newBuilder() + * .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getInstructionCallable().futureCall(request); + * // Do something. + * Instruction response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (Instruction element : + * dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1600,6 +2951,19 @@ public final ListInstructionsPagedResponse listInstructions(ProjectName parent, /** * Lists instructions for a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (Instruction element : + * dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1614,6 +2978,23 @@ public final ListInstructionsPagedResponse listInstructions(String parent, Strin /** * Lists instructions for a project. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListInstructionsRequest request = + * ListInstructionsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Instruction element : dataLabelingServiceClient.listInstructions(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 */ @@ -1626,6 +3007,24 @@ public final ListInstructionsPagedResponse listInstructions(ListInstructionsRequ * Lists instructions for a project. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListInstructionsRequest request = + * ListInstructionsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listInstructionsPagedCallable().futureCall(request); + * // Do something. + * for (Instruction element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListInstructionsResponse response = + * dataLabelingServiceClient.listInstructionsCallable().call(request); + * for (Instruction element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]"); + * dataLabelingServiceClient.deleteInstruction(name); + * } + * }+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1663,6 +3089,15 @@ public final void deleteInstruction(InstructionName name) { /** * Deletes an instruction object by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString(); + * dataLabelingServiceClient.deleteInstruction(name); + * } + * }+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1676,6 +3111,18 @@ public final void deleteInstruction(String name) { /** * Deletes an instruction object by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteInstructionRequest request = + * DeleteInstructionRequest.newBuilder() + * .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) + * .build(); + * dataLabelingServiceClient.deleteInstruction(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 */ @@ -1688,6 +3135,19 @@ public final void deleteInstruction(DeleteInstructionRequest request) { * Deletes an instruction object by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteInstructionRequest request = + * DeleteInstructionRequest.newBuilder() + * .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.deleteInstructionCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationName name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); + * Evaluation response = dataLabelingServiceClient.getEvaluation(name); + * } + * }+ * * @param name Required. Name of the evaluation. Format: *
"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>' * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1713,6 +3182,15 @@ public final Evaluation getEvaluation(EvaluationName name) { * Gets an evaluation by resource name (to search, use * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); + * Evaluation response = dataLabelingServiceClient.getEvaluation(name); + * } + * }+ * * @param name Required. Name of the evaluation. Format: *
"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>' * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1727,6 +3205,18 @@ public final Evaluation getEvaluation(String name) { * Gets an evaluation by resource name (to search, use * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetEvaluationRequest request = + * GetEvaluationRequest.newBuilder() + * .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .build(); + * Evaluation response = dataLabelingServiceClient.getEvaluation(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 */ @@ -1740,6 +3230,19 @@ public final Evaluation getEvaluation(GetEvaluationRequest request) { * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetEvaluationRequest request = + * GetEvaluationRequest.newBuilder() + * .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getEvaluationCallable().futureCall(request); + * // Do something. + * Evaluation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); + * String filter = "filter-1274492040"; + * for (Evaluation element : + * dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Evaluation search parent (project ID). Format: * "projects/<var>{project_id}</var>" * @param filter Optional. To search evaluations, you can filter by the following: @@ -1799,6 +3315,19 @@ public final SearchEvaluationsPagedResponse searchEvaluations( /** * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); + * String filter = "filter-1274492040"; + * for (Evaluation element : + * dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Evaluation search parent (project ID). Format: * "projects/<var>{project_id}</var>" * @param filter Optional. To search evaluations, you can filter by the following: @@ -1845,6 +3374,23 @@ public final SearchEvaluationsPagedResponse searchEvaluations(String parent, Str /** * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * SearchEvaluationsRequest request = + * SearchEvaluationsRequest.newBuilder() + * .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Evaluation element : dataLabelingServiceClient.searchEvaluations(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 */ @@ -1857,6 +3403,24 @@ public final SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsR * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * SearchEvaluationsRequest request = + * SearchEvaluationsRequest.newBuilder() + * .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.searchEvaluationsPagedCallable().futureCall(request); + * // Do something. + * for (Evaluation element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * SearchEvaluationsResponse response = + * dataLabelingServiceClient.searchEvaluationsCallable().call(request); + * for (Evaluation element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); + * for (SearchExampleComparisonsResponse.ExampleComparison element : + * dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] * resource to search for example comparisons from. Format: *
"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>" @@ -1900,6 +3494,18 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( * comparisons that show ground truth and prediction(s) for a single input. Search by providing an * evaluation ID. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); + * for (SearchExampleComparisonsResponse.ExampleComparison element : + * dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] * resource to search for example comparisons from. Format: *
"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>" @@ -1917,6 +3523,23 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons(Stri * comparisons that show ground truth and prediction(s) for a single input. Search by providing an * evaluation ID. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * SearchExampleComparisonsRequest request = + * SearchExampleComparisonsRequest.newBuilder() + * .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (SearchExampleComparisonsResponse.ExampleComparison element : + * dataLabelingServiceClient.searchExampleComparisons(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 */ @@ -1932,6 +3555,23 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( * evaluation ID. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * SearchExampleComparisonsRequest request = + * SearchExampleComparisonsRequest.newBuilder() + * .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.searchExampleComparisonsPagedCallable().futureCall(request); + * // Do something. + * for (SearchExampleComparisonsResponse.ExampleComparison element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * SearchExampleComparisonsResponse response = + * dataLabelingServiceClient.searchExampleComparisonsCallable().call(request); + * for (SearchExampleComparisonsResponse.ExampleComparison element : + * response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * EvaluationJob job = EvaluationJob.newBuilder().build(); + * EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job); + * } + * }+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param job Required. The evaluation job to create. @@ -1973,6 +3642,16 @@ public final EvaluationJob createEvaluationJob(ProjectName parent, EvaluationJob /** * Creates an evaluation job. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * EvaluationJob job = EvaluationJob.newBuilder().build(); + * EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job); + * } + * }+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param job Required. The evaluation job to create. @@ -1988,6 +3667,19 @@ public final EvaluationJob createEvaluationJob(String parent, EvaluationJob job) /** * Creates an evaluation job. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateEvaluationJobRequest request = + * CreateEvaluationJobRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setJob(EvaluationJob.newBuilder().build()) + * .build(); + * EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(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 */ @@ -2000,6 +3692,20 @@ public final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest reques * Creates an evaluation job. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * CreateEvaluationJobRequest request = + * CreateEvaluationJobRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setJob(EvaluationJob.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.createEvaluationJobCallable().futureCall(request); + * // Do something. + * EvaluationJob response = future.get(); + * } + * }
If you want to change any other aspect of the evaluation job, you must delete the job and * create a new one. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationJob evaluationJob = EvaluationJob.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * EvaluationJob response = + * dataLabelingServiceClient.updateEvaluationJob(evaluationJob, updateMask); + * } + * }+ * * @param evaluationJob Required. Evaluation job that is going to be updated. * @param updateMask Optional. Mask for which fields to update. You can only provide the following * fields: @@ -2045,6 +3762,19 @@ public final EvaluationJob updateEvaluationJob( *
If you want to change any other aspect of the evaluation job, you must delete the job and * create a new one. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * UpdateEvaluationJobRequest request = + * UpdateEvaluationJobRequest.newBuilder() + * .setEvaluationJob(EvaluationJob.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(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 */ @@ -2062,6 +3792,20 @@ public final EvaluationJob updateEvaluationJob(UpdateEvaluationJobRequest reques * create a new one. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * UpdateEvaluationJobRequest request = + * UpdateEvaluationJobRequest.newBuilder() + * .setEvaluationJob(EvaluationJob.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.updateEvaluationJobCallable().futureCall(request); + * // Do something. + * EvaluationJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); + * EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2086,6 +3839,15 @@ public final EvaluationJob getEvaluationJob(EvaluationJobName name) { /** * Gets an evaluation job by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); + * EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2099,6 +3861,18 @@ public final EvaluationJob getEvaluationJob(String name) { /** * Gets an evaluation job by resource name. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetEvaluationJobRequest request = + * GetEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(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 */ @@ -2111,6 +3885,19 @@ public final EvaluationJob getEvaluationJob(GetEvaluationJobRequest request) { * Gets an evaluation job by resource name. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * GetEvaluationJobRequest request = + * GetEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.getEvaluationJobCallable().futureCall(request); + * // Do something. + * EvaluationJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); + * dataLabelingServiceClient.pauseEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be paused. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2138,6 +3934,15 @@ public final void pauseEvaluationJob(EvaluationJobName name) { * Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a * no-op. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); + * dataLabelingServiceClient.pauseEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be paused. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2153,6 +3958,18 @@ public final void pauseEvaluationJob(String name) { * Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a * no-op. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * PauseEvaluationJobRequest request = + * PauseEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * dataLabelingServiceClient.pauseEvaluationJob(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 */ @@ -2166,6 +3983,19 @@ public final void pauseEvaluationJob(PauseEvaluationJobRequest request) { * no-op. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * PauseEvaluationJobRequest request = + * PauseEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.pauseEvaluationJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); + * dataLabelingServiceClient.resumeEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be resumed. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2193,6 +4032,15 @@ public final void resumeEvaluationJob(EvaluationJobName name) { * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running * or scheduled evaluation job is a no-op. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); + * dataLabelingServiceClient.resumeEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be resumed. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2208,6 +4056,18 @@ public final void resumeEvaluationJob(String name) { * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running * or scheduled evaluation job is a no-op. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ResumeEvaluationJobRequest request = + * ResumeEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * dataLabelingServiceClient.resumeEvaluationJob(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 */ @@ -2221,6 +4081,19 @@ public final void resumeEvaluationJob(ResumeEvaluationJobRequest request) { * or scheduled evaluation job is a no-op. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ResumeEvaluationJobRequest request = + * ResumeEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.resumeEvaluationJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); + * dataLabelingServiceClient.deleteEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be deleted. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2246,6 +4128,15 @@ public final void deleteEvaluationJob(EvaluationJobName name) { /** * Stops and deletes an evaluation job. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); + * dataLabelingServiceClient.deleteEvaluationJob(name); + * } + * }+ * * @param name Required. Name of the evaluation job that is going to be deleted. Format: *
"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2260,6 +4151,18 @@ public final void deleteEvaluationJob(String name) { /** * Stops and deletes an evaluation job. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteEvaluationJobRequest request = + * DeleteEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * dataLabelingServiceClient.deleteEvaluationJob(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 */ @@ -2272,6 +4175,19 @@ public final void deleteEvaluationJob(DeleteEvaluationJobRequest request) { * Stops and deletes an evaluation job. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * DeleteEvaluationJobRequest request = + * DeleteEvaluationJobRequest.newBuilder() + * .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.deleteEvaluationJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String filter = "filter-1274492040"; + * for (EvaluationJob element : + * dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param filter Optional. You can filter the jobs to list by model_id (also known as model_name, @@ -2308,6 +4237,19 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs( /** * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String filter = "filter-1274492040"; + * for (EvaluationJob element : + * dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param filter Optional. You can filter the jobs to list by model_id (also known as model_name, @@ -2331,6 +4273,24 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs(String parent, S /** * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * + *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListEvaluationJobsRequest request = + * ListEvaluationJobsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (EvaluationJob element : + * dataLabelingServiceClient.listEvaluationJobs(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 */ @@ -2344,6 +4304,24 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs( * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * *
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ListEvaluationJobsRequest request = + * ListEvaluationJobsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * dataLabelingServiceClient.listEvaluationJobsPagedCallable().futureCall(request); + * // Do something. + * for (EvaluationJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * while (true) { + * ListEvaluationJobsResponse response = + * dataLabelingServiceClient.listEvaluationJobsCallable().call(request); + * for (EvaluationJob element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Service Description: Service for the AI Platform Data Labeling API. * *
Sample for DataLabelingServiceClient: + * + *
{@code + * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.datalabeling.v1beta1; diff --git a/synth.metadata b/synth.metadata index 6e390788..7a36480a 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-datalabeling.git", - "sha": "5fbc740dd3c3a19c175df83bb411ff58587f655d" + "sha": "0068095f205de84c929353ab2336c251e74a6b63" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {