@Generated(value="by gapic-generator") @BetaApi public class DataLabelingServiceClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = dataLabelingServiceClient.createDataset(formattedParent, 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().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DataLabelingServiceSettings to create(). For example:
To customize credentials:
DataLabelingServiceSettings dataLabelingServiceSettings =
DataLabelingServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataLabelingServiceClient dataLabelingServiceClient =
DataLabelingServiceClient.create(dataLabelingServiceSettings);
To customize the endpoint:
DataLabelingServiceSettings dataLabelingServiceSettings =
DataLabelingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataLabelingServiceClient dataLabelingServiceClient =
DataLabelingServiceClient.create(dataLabelingServiceSettings);
Modifier | Constructor and Description |
---|---|
protected |
DataLabelingServiceClient(DataLabelingServiceSettings settings)
Constructs an instance of DataLabelingServiceClient, using the given settings.
|
protected |
DataLabelingServiceClient(DataLabelingServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DataLabelingServiceClient |
create()
Constructs an instance of DataLabelingServiceClient with default settings.
|
static DataLabelingServiceClient |
create(DataLabelingServiceSettings settings)
Constructs an instance of DataLabelingServiceClient, using the given settings.
|
static DataLabelingServiceClient |
create(DataLabelingServiceStub stub)
Constructs an instance of DataLabelingServiceClient, using the given stub for making calls.
|
com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet |
createAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest request)
Creates an annotation spec set by providing a set of labels.
|
com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet |
createAnnotationSpecSet(String parent,
com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet annotationSpecSet)
Creates an annotation spec set by providing a set of labels.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest,com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet> |
createAnnotationSpecSetCallable()
Creates an annotation spec set by providing a set of labels.
|
com.google.cloud.datalabeling.v1beta1.Dataset |
createDataset(com.google.cloud.datalabeling.v1beta1.CreateDatasetRequest request)
Creates dataset.
|
com.google.cloud.datalabeling.v1beta1.Dataset |
createDataset(String parent,
com.google.cloud.datalabeling.v1beta1.Dataset dataset)
Creates dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateDatasetRequest,com.google.cloud.datalabeling.v1beta1.Dataset> |
createDatasetCallable()
Creates dataset.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> |
createInstructionAsync(com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest request)
Creates an instruction for how data should be labeled.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> |
createInstructionAsync(String parent,
com.google.cloud.datalabeling.v1beta1.Instruction instruction)
Creates an instruction for how data should be labeled.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest,Operation> |
createInstructionCallable()
Creates an instruction for how data should be labeled.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest,com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> |
createInstructionOperationCallable()
Creates an instruction for how data should be labeled.
|
void |
deleteAnnotatedDataset(com.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest request)
Deletes an annotated dataset by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest,Empty> |
deleteAnnotatedDatasetCallable()
Deletes an annotated dataset by resource name.
|
void |
deleteAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest request)
Deletes an annotation spec set by resource name.
|
void |
deleteAnnotationSpecSet(String name)
Deletes an annotation spec set by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest,Empty> |
deleteAnnotationSpecSetCallable()
Deletes an annotation spec set by resource name.
|
void |
deleteDataset(com.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest request)
Deletes a dataset by resource name.
|
void |
deleteDataset(String name)
Deletes a dataset by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest,Empty> |
deleteDatasetCallable()
Deletes a dataset by resource name.
|
void |
deleteInstruction(com.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest request)
Deletes an instruction object by resource name.
|
void |
deleteInstruction(String name)
Deletes an instruction object by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest,Empty> |
deleteInstructionCallable()
Deletes an instruction object by resource name.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> |
exportDataAsync(com.google.cloud.datalabeling.v1beta1.ExportDataRequest request)
Exports data and annotations from dataset.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> |
exportDataAsync(String name,
String annotatedDataset,
String filter,
com.google.cloud.datalabeling.v1beta1.OutputConfig outputConfig)
Exports data and annotations from dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ExportDataRequest,Operation> |
exportDataCallable()
Exports data and annotations from dataset.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.ExportDataRequest,com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> |
exportDataOperationCallable()
Exports data and annotations from dataset.
|
static String |
formatAnnotatedDatasetName(String project,
String dataset,
String annotatedDataset)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
formatAnnotationSpecSetName(String project,
String annotationSpecSet)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
formatDataItemName(String project,
String dataset,
String dataItem)
Deprecated.
Use the
DataItemName class instead. |
static String |
formatDatasetName(String project,
String dataset)
Deprecated.
Use the
DatasetName class instead. |
static String |
formatExampleName(String project,
String dataset,
String annotatedDataset,
String example)
Deprecated.
Use the
ExampleName class instead. |
static String |
formatInstructionName(String project,
String instruction)
Deprecated.
Use the
InstructionName class instead. |
static String |
formatProjectName(String project)
Deprecated.
Use the
ProjectName class instead. |
com.google.cloud.datalabeling.v1beta1.AnnotatedDataset |
getAnnotatedDataset(com.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest request)
Gets an annotated dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.AnnotatedDataset |
getAnnotatedDataset(String name)
Gets an annotated dataset by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset> |
getAnnotatedDatasetCallable()
Gets an annotated dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet |
getAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest request)
Gets an annotation spec set by resource name.
|
com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet |
getAnnotationSpecSet(String name)
Gets an annotation spec set by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest,com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet> |
getAnnotationSpecSetCallable()
Gets an annotation spec set by resource name.
|
com.google.cloud.datalabeling.v1beta1.DataItem |
getDataItem(com.google.cloud.datalabeling.v1beta1.GetDataItemRequest request)
Gets a data item in a dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.DataItem |
getDataItem(String name)
Gets a data item in a dataset by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetDataItemRequest,com.google.cloud.datalabeling.v1beta1.DataItem> |
getDataItemCallable()
Gets a data item in a dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.Dataset |
getDataset(com.google.cloud.datalabeling.v1beta1.GetDatasetRequest request)
Gets dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.Dataset |
getDataset(String name)
Gets dataset by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetDatasetRequest,com.google.cloud.datalabeling.v1beta1.Dataset> |
getDatasetCallable()
Gets dataset by resource name.
|
com.google.cloud.datalabeling.v1beta1.Example |
getExample(com.google.cloud.datalabeling.v1beta1.GetExampleRequest request)
Gets an example by resource name, including both data and annotation.
|
com.google.cloud.datalabeling.v1beta1.Example |
getExample(String name,
String filter)
Gets an example by resource name, including both data and annotation.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetExampleRequest,com.google.cloud.datalabeling.v1beta1.Example> |
getExampleCallable()
Gets an example by resource name, including both data and annotation.
|
com.google.cloud.datalabeling.v1beta1.Instruction |
getInstruction(com.google.cloud.datalabeling.v1beta1.GetInstructionRequest request)
Gets an instruction by resource name.
|
com.google.cloud.datalabeling.v1beta1.Instruction |
getInstruction(String name)
Gets an instruction by resource name.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetInstructionRequest,com.google.cloud.datalabeling.v1beta1.Instruction> |
getInstructionCallable()
Gets an instruction by resource name.
|
OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DataLabelingServiceSettings |
getSettings() |
DataLabelingServiceStub |
getStub() |
OperationFuture<com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> |
importDataAsync(com.google.cloud.datalabeling.v1beta1.ImportDataRequest request)
Imports data into dataset based on source locations defined in request.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> |
importDataAsync(String name,
com.google.cloud.datalabeling.v1beta1.InputConfig inputConfig)
Imports data into dataset based on source locations defined in request.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ImportDataRequest,Operation> |
importDataCallable()
Imports data into dataset based on source locations defined in request.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.ImportDataRequest,com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> |
importDataOperationCallable()
Imports data into dataset based on source locations defined in request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelAudioAsync(com.google.cloud.datalabeling.v1beta1.LabelAudioRequest request)
Starts a labeling task for audio.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelAudioAsync(String parent,
com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig,
com.google.cloud.datalabeling.v1beta1.LabelAudioRequest.Feature feature)
Starts a labeling task for audio.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelAudioRequest,Operation> |
labelAudioCallable()
Starts a labeling task for audio.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelAudioRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelAudioOperationCallable()
Starts a labeling task for audio.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelImageAsync(com.google.cloud.datalabeling.v1beta1.LabelImageRequest request)
Starts a labeling task for image.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelImageAsync(String parent,
com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig,
com.google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature feature)
Starts a labeling task for image.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelImageRequest,Operation> |
labelImageCallable()
Starts a labeling task for image.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelImageRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelImageOperationCallable()
Starts a labeling task for image.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelTextAsync(com.google.cloud.datalabeling.v1beta1.LabelTextRequest request)
Starts a labeling task for text.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelTextAsync(String parent,
com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig,
com.google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature feature)
Starts a labeling task for text.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelTextRequest,Operation> |
labelTextCallable()
Starts a labeling task for text.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelTextRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelTextOperationCallable()
Starts a labeling task for text.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelVideoAsync(com.google.cloud.datalabeling.v1beta1.LabelVideoRequest request)
Starts a labeling task for video.
|
OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelVideoAsync(String parent,
com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig,
com.google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature feature)
Starts a labeling task for video.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelVideoRequest,Operation> |
labelVideoCallable()
Starts a labeling task for video.
|
OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelVideoRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> |
labelVideoOperationCallable()
Starts a labeling task for video.
|
DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse |
listAnnotatedDatasets(com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest request)
Lists annotated datasets for a dataset.
|
DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse |
listAnnotatedDatasets(String parent,
String filter)
Lists annotated datasets for a dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest,com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse> |
listAnnotatedDatasetsCallable()
Lists annotated datasets for a dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest,DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse> |
listAnnotatedDatasetsPagedCallable()
Lists annotated datasets for a dataset.
|
DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse |
listAnnotationSpecSets(com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest request)
Lists annotation spec sets for a project.
|
DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse |
listAnnotationSpecSets(String parent,
String filter)
Lists annotation spec sets for a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest,com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse> |
listAnnotationSpecSetsCallable()
Lists annotation spec sets for a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest,DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse> |
listAnnotationSpecSetsPagedCallable()
Lists annotation spec sets for a project.
|
DataLabelingServiceClient.ListDataItemsPagedResponse |
listDataItems(com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest request)
Lists data items in a dataset.
|
DataLabelingServiceClient.ListDataItemsPagedResponse |
listDataItems(String parent,
String filter)
Lists data items in a dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest,com.google.cloud.datalabeling.v1beta1.ListDataItemsResponse> |
listDataItemsCallable()
Lists data items in a dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest,DataLabelingServiceClient.ListDataItemsPagedResponse> |
listDataItemsPagedCallable()
Lists data items in a dataset.
|
DataLabelingServiceClient.ListDatasetsPagedResponse |
listDatasets(com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest request)
Lists datasets under a project.
|
DataLabelingServiceClient.ListDatasetsPagedResponse |
listDatasets(String parent,
String filter)
Lists datasets under a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest,com.google.cloud.datalabeling.v1beta1.ListDatasetsResponse> |
listDatasetsCallable()
Lists datasets under a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest,DataLabelingServiceClient.ListDatasetsPagedResponse> |
listDatasetsPagedCallable()
Lists datasets under a project.
|
DataLabelingServiceClient.ListExamplesPagedResponse |
listExamples(com.google.cloud.datalabeling.v1beta1.ListExamplesRequest request)
Lists examples in an annotated dataset.
|
DataLabelingServiceClient.ListExamplesPagedResponse |
listExamples(String parent,
String filter)
Lists examples in an annotated dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListExamplesRequest,com.google.cloud.datalabeling.v1beta1.ListExamplesResponse> |
listExamplesCallable()
Lists examples in an annotated dataset.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListExamplesRequest,DataLabelingServiceClient.ListExamplesPagedResponse> |
listExamplesPagedCallable()
Lists examples in an annotated dataset.
|
DataLabelingServiceClient.ListInstructionsPagedResponse |
listInstructions(com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest request)
Lists instructions for a project.
|
DataLabelingServiceClient.ListInstructionsPagedResponse |
listInstructions(String parent,
String filter)
Lists instructions for a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest,com.google.cloud.datalabeling.v1beta1.ListInstructionsResponse> |
listInstructionsCallable()
Lists instructions for a project.
|
UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest,DataLabelingServiceClient.ListInstructionsPagedResponse> |
listInstructionsPagedCallable()
Lists instructions for a project.
|
static String |
parseAnnotatedDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseAnnotatedDatasetFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseAnnotationSpecSetFromAnnotationSpecSetName(String annotationSpecSetName)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
parseDataItemFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseDatasetFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseDatasetFromDatasetName(String datasetName)
Deprecated.
Use the
DatasetName class instead. |
static String |
parseDatasetFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseExampleFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseInstructionFromInstructionName(String instructionName)
Deprecated.
Use the
InstructionName class instead. |
static String |
parseProjectFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseProjectFromAnnotationSpecSetName(String annotationSpecSetName)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
parseProjectFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseProjectFromDatasetName(String datasetName)
Deprecated.
Use the
DatasetName class instead. |
static String |
parseProjectFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseProjectFromInstructionName(String instructionName)
Deprecated.
Use the
InstructionName class instead. |
static String |
parseProjectFromProjectName(String projectName)
Deprecated.
Use the
ProjectName class instead. |
void |
shutdown() |
void |
shutdownNow() |
protected DataLabelingServiceClient(DataLabelingServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DataLabelingServiceClient(DataLabelingServiceStub stub)
@Deprecated public static final String formatAnnotatedDatasetName(String project, String dataset, String annotatedDataset)
AnnotatedDatasetName
class instead.@Deprecated public static final String formatAnnotationSpecSetName(String project, String annotationSpecSet)
AnnotationSpecSetName
class instead.@Deprecated public static final String formatDataItemName(String project, String dataset, String dataItem)
DataItemName
class instead.@Deprecated public static final String formatDatasetName(String project, String dataset)
DatasetName
class instead.@Deprecated public static final String formatExampleName(String project, String dataset, String annotatedDataset, String example)
ExampleName
class instead.@Deprecated public static final String formatInstructionName(String project, String instruction)
InstructionName
class instead.@Deprecated public static final String formatProjectName(String project)
ProjectName
class instead.@Deprecated public static final String parseProjectFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseAnnotatedDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseProjectFromAnnotationSpecSetName(String annotationSpecSetName)
AnnotationSpecSetName
class instead.@Deprecated public static final String parseAnnotationSpecSetFromAnnotationSpecSetName(String annotationSpecSetName)
AnnotationSpecSetName
class instead.@Deprecated public static final String parseProjectFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseDatasetFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseDataItemFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseProjectFromDatasetName(String datasetName)
DatasetName
class instead.@Deprecated public static final String parseDatasetFromDatasetName(String datasetName)
DatasetName
class instead.@Deprecated public static final String parseProjectFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseDatasetFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseAnnotatedDatasetFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseExampleFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseProjectFromInstructionName(String instructionName)
InstructionName
class instead.@Deprecated public static final String parseInstructionFromInstructionName(String instructionName)
InstructionName
class instead.@Deprecated public static final String parseProjectFromProjectName(String projectName)
ProjectName
class instead.public static final DataLabelingServiceClient create() throws IOException
IOException
public static final DataLabelingServiceClient create(DataLabelingServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DataLabelingServiceClient create(DataLabelingServiceStub stub)
public final DataLabelingServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DataLabelingServiceStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient()
public final com.google.cloud.datalabeling.v1beta1.Dataset createDataset(String parent, com.google.cloud.datalabeling.v1beta1.Dataset dataset)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = dataLabelingServiceClient.createDataset(formattedParent, dataset);
}
parent
- Required. Dataset resource parent, format: projects/{project_id}dataset
- Required. The dataset to be created.ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.Dataset createDataset(com.google.cloud.datalabeling.v1beta1.CreateDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(formattedParent)
.setDataset(dataset)
.build();
Dataset response = dataLabelingServiceClient.createDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateDatasetRequest,com.google.cloud.datalabeling.v1beta1.Dataset> createDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(formattedParent)
.setDataset(dataset)
.build();
ApiFuture<Dataset> future = dataLabelingServiceClient.createDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final com.google.cloud.datalabeling.v1beta1.Dataset getDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
Dataset response = dataLabelingServiceClient.getDataset(formattedName);
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.Dataset getDataset(com.google.cloud.datalabeling.v1beta1.GetDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(formattedName)
.build();
Dataset response = dataLabelingServiceClient.getDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetDatasetRequest,com.google.cloud.datalabeling.v1beta1.Dataset> getDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Dataset> future = dataLabelingServiceClient.getDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Dataset element : dataLabelingServiceClient.listDatasets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Dataset resource parent, format: projects/{project_id}filter
- Optional. Filter on dataset is not supported at this moment.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Dataset element : dataLabelingServiceClient.listDatasets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest,DataLabelingServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListDatasetsPagedResponse> future = dataLabelingServiceClient.listDatasetsPagedCallable().futureCall(request);
// Do something
for (Dataset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDatasetsRequest,com.google.cloud.datalabeling.v1beta1.ListDatasetsResponse> listDatasetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListDatasetsResponse response = dataLabelingServiceClient.listDatasetsCallable().call(request);
for (Dataset element : response.getDatasetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
dataLabelingServiceClient.deleteDataset(formattedName);
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}ApiException
- if the remote call failspublic final void deleteDataset(com.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest,Empty> deleteDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteDatasetCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> importDataAsync(String name, com.google.cloud.datalabeling.v1beta1.InputConfig inputConfig)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(formattedName, inputConfig).get();
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}inputConfig
- Required. Specify the input source of the data.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> importDataAsync(com.google.cloud.datalabeling.v1beta1.ImportDataRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.ImportDataRequest,com.google.cloud.datalabeling.v1beta1.ImportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata> importDataOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
OperationFuture<ImportDataOperationResponse, ImportDataOperationMetadata> future = dataLabelingServiceClient.importDataOperationCallable().futureCall(request);
// Do something
ImportDataOperationResponse response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ImportDataRequest,Operation> importDataCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.importDataCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> exportDataAsync(String name, String annotatedDataset, String filter, com.google.cloud.datalabeling.v1beta1.OutputConfig outputConfig)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
String filter = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataOperationResponse response = dataLabelingServiceClient.exportDataAsync(formattedName, annotatedDataset, filter, outputConfig).get();
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}annotatedDataset
- Required. Annotated dataset resource name. DataItem in Dataset and
their annotations in specified annotated dataset will be exported. It's in format of
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}filter
- Optional. Filter is not supported at this moment.outputConfig
- Required. Specify the output destination.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> exportDataAsync(com.google.cloud.datalabeling.v1beta1.ExportDataRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
ExportDataOperationResponse response = dataLabelingServiceClient.exportDataAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.ExportDataRequest,com.google.cloud.datalabeling.v1beta1.ExportDataOperationResponse,com.google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata> exportDataOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
OperationFuture<ExportDataOperationResponse, ExportDataOperationMetadata> future = dataLabelingServiceClient.exportDataOperationCallable().futureCall(request);
// Do something
ExportDataOperationResponse response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ExportDataRequest,Operation> exportDataCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.exportDataCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.cloud.datalabeling.v1beta1.DataItem getDataItem(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
DataItem response = dataLabelingServiceClient.getDataItem(formattedName);
}
name
- Required. The name of the data item to get, format:
projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.DataItem getDataItem(com.google.cloud.datalabeling.v1beta1.GetDataItemRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
GetDataItemRequest request = GetDataItemRequest.newBuilder()
.setName(formattedName)
.build();
DataItem response = dataLabelingServiceClient.getDataItem(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetDataItemRequest,com.google.cloud.datalabeling.v1beta1.DataItem> getDataItemCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
GetDataItemRequest request = GetDataItemRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<DataItem> future = dataLabelingServiceClient.getDataItemCallable().futureCall(request);
// Do something
DataItem response = future.get();
}
public final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String filter = "";
for (DataItem element : dataLabelingServiceClient.listDataItems(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the dataset to list data items, format:
projects/{project_id}/datasets/{dataset_id}filter
- Optional. Filter is not supported at this moment.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (DataItem element : dataLabelingServiceClient.listDataItems(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest,DataLabelingServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListDataItemsPagedResponse> future = dataLabelingServiceClient.listDataItemsPagedCallable().futureCall(request);
// Do something
for (DataItem element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListDataItemsRequest,com.google.cloud.datalabeling.v1beta1.ListDataItemsResponse> listDataItemsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListDataItemsResponse response = dataLabelingServiceClient.listDataItemsCallable().call(request);
for (DataItem element : response.getDataItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.datalabeling.v1beta1.AnnotatedDataset getAnnotatedDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(formattedName);
}
name
- Required. Name of the annotated dataset to get, format:
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.AnnotatedDataset getAnnotatedDataset(com.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder()
.setName(formattedName)
.build();
AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset> getAnnotatedDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<AnnotatedDataset> future = dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String filter = "";
for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the dataset to list annotated datasets, format:
projects/{project_id}/datasets/{dataset_id}filter
- Optional. Filter is not supported at this moment.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest,DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse> listAnnotatedDatasetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListAnnotatedDatasetsPagedResponse> future = dataLabelingServiceClient.listAnnotatedDatasetsPagedCallable().futureCall(request);
// Do something
for (AnnotatedDataset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest,com.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse> listAnnotatedDatasetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListAnnotatedDatasetsResponse response = dataLabelingServiceClient.listAnnotatedDatasetsCallable().call(request);
for (AnnotatedDataset element : response.getAnnotatedDatasetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelImageAsync(String parent, com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig, com.google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the dataset to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of image labeling task.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelImageAsync(com.google.cloud.datalabeling.v1beta1.LabelImageRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelImageRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelImageOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelImageOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelImageRequest,Operation> labelImageCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelImageCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelVideoAsync(String parent, com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig, com.google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the dataset to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of video labeling task.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelVideoAsync(com.google.cloud.datalabeling.v1beta1.LabelVideoRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelVideoRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelVideoOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelVideoOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelVideoRequest,Operation> labelVideoCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelVideoCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelTextAsync(String parent, com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig, com.google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the data set to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of text labeling task.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelTextAsync(com.google.cloud.datalabeling.v1beta1.LabelTextRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelTextRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelTextOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelTextOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelTextRequest,Operation> labelTextCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelTextCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelAudioAsync(String parent, com.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig basicConfig, com.google.cloud.datalabeling.v1beta1.LabelAudioRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelAudioRequest.Feature feature = LabelAudioRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelAudioAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the dataset to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of audio labeling task.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelAudioAsync(com.google.cloud.datalabeling.v1beta1.LabelAudioRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelAudioRequest.Feature feature = LabelAudioRequest.Feature.FEATURE_UNSPECIFIED;
LabelAudioRequest request = LabelAudioRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelAudioAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.LabelAudioRequest,com.google.cloud.datalabeling.v1beta1.AnnotatedDataset,com.google.cloud.datalabeling.v1beta1.LabelOperationMetadata> labelAudioOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelAudioRequest.Feature feature = LabelAudioRequest.Feature.FEATURE_UNSPECIFIED;
LabelAudioRequest request = LabelAudioRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelAudioOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.LabelAudioRequest,Operation> labelAudioCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelAudioRequest.Feature feature = LabelAudioRequest.Feature.FEATURE_UNSPECIFIED;
LabelAudioRequest request = LabelAudioRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelAudioCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.cloud.datalabeling.v1beta1.Example getExample(String name, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
String filter = "";
Example response = dataLabelingServiceClient.getExample(formattedName, filter);
}
name
- Required. Name of example, format:
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
{annotated_dataset_id}/examples/{example_id}filter
- Optional. An expression for filtering Examples. Filter by
annotation_spec.display_name is supported. Format "annotation_spec.display_name =
{display_name}"ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.Example getExample(com.google.cloud.datalabeling.v1beta1.GetExampleRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
GetExampleRequest request = GetExampleRequest.newBuilder()
.setName(formattedName)
.build();
Example response = dataLabelingServiceClient.getExample(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetExampleRequest,com.google.cloud.datalabeling.v1beta1.Example> getExampleCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
GetExampleRequest request = GetExampleRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Example> future = dataLabelingServiceClient.getExampleCallable().futureCall(request);
// Do something
Example response = future.get();
}
public final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
String filter = "";
for (Example element : dataLabelingServiceClient.listExamples(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Example resource parent.filter
- Optional. An expression for filtering Examples. For annotated datasets that have
annotation spec set, filter by annotation_spec.display_name is supported. Format
"annotation_spec.display_name = {display_name}"ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(com.google.cloud.datalabeling.v1beta1.ListExamplesRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Example element : dataLabelingServiceClient.listExamples(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListExamplesRequest,DataLabelingServiceClient.ListExamplesPagedResponse> listExamplesPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListExamplesPagedResponse> future = dataLabelingServiceClient.listExamplesPagedCallable().futureCall(request);
// Do something
for (Example element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListExamplesRequest,com.google.cloud.datalabeling.v1beta1.ListExamplesResponse> listExamplesCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListExamplesResponse response = dataLabelingServiceClient.listExamplesCallable().call(request);
for (Example element : response.getExamplesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet createAnnotationSpecSet(String parent, com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet annotationSpecSet)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(formattedParent, annotationSpecSet);
}
parent
- Required. AnnotationSpecSet resource parent, format: projects/{project_id}annotationSpecSet
- Required. Annotation spec set to create. Annotation specs must be
included. Only one annotation spec will be accepted for annotation specs with same
display_name.ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet createAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder()
.setParent(formattedParent)
.setAnnotationSpecSet(annotationSpecSet)
.build();
AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest,com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet> createAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder()
.setParent(formattedParent)
.setAnnotationSpecSet(annotationSpecSet)
.build();
ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request);
// Do something
AnnotationSpecSet response = future.get();
}
public final com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet getAnnotationSpecSet(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(formattedName);
}
name
- Required. AnnotationSpecSet resource name, format:
projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet getAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest,com.google.cloud.datalabeling.v1beta1.AnnotationSpecSet> getAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request);
// Do something
AnnotationSpecSet response = future.get();
}
public final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest,DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse> listAnnotationSpecSetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListAnnotationSpecSetsPagedResponse> future = dataLabelingServiceClient.listAnnotationSpecSetsPagedCallable().futureCall(request);
// Do something
for (AnnotationSpecSet element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest,com.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse> listAnnotationSpecSetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListAnnotationSpecSetsResponse response = dataLabelingServiceClient.listAnnotationSpecSetsCallable().call(request);
for (AnnotationSpecSet element : response.getAnnotationSpecSetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteAnnotationSpecSet(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
dataLabelingServiceClient.deleteAnnotationSpecSet(formattedName);
}
name
- Required. AnnotationSpec resource name, format:
`projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.ApiException
- if the remote call failspublic final void deleteAnnotationSpecSet(com.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest,Empty> deleteAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> createInstructionAsync(String parent, com.google.cloud.datalabeling.v1beta1.Instruction instruction)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
Instruction response = dataLabelingServiceClient.createInstructionAsync(formattedParent, instruction).get();
}
parent
- Required. Instruction resource parent, format: projects/{project_id}instruction
- Required. Instruction of how to perform the labeling task.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> createInstructionAsync(com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
Instruction response = dataLabelingServiceClient.createInstructionAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest,com.google.cloud.datalabeling.v1beta1.Instruction,com.google.cloud.datalabeling.v1beta1.CreateInstructionMetadata> createInstructionOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
OperationFuture<Instruction, CreateInstructionMetadata> future = dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request);
// Do something
Instruction response = future.get();
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.CreateInstructionRequest,Operation> createInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.createInstructionCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.cloud.datalabeling.v1beta1.Instruction getInstruction(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
Instruction response = dataLabelingServiceClient.getInstruction(formattedName);
}
name
- Required. Instruction resource name, format:
projects/{project_id}/instructions/{instruction_id}ApiException
- if the remote call failspublic final com.google.cloud.datalabeling.v1beta1.Instruction getInstruction(com.google.cloud.datalabeling.v1beta1.GetInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
GetInstructionRequest request = GetInstructionRequest.newBuilder()
.setName(formattedName)
.build();
Instruction response = dataLabelingServiceClient.getInstruction(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.GetInstructionRequest,com.google.cloud.datalabeling.v1beta1.Instruction> getInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
GetInstructionRequest request = GetInstructionRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Instruction> future = dataLabelingServiceClient.getInstructionCallable().futureCall(request);
// Do something
Instruction response = future.get();
}
public final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Instruction element : dataLabelingServiceClient.listInstructions(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Instruction resource parent, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Instruction element : dataLabelingServiceClient.listInstructions(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest,DataLabelingServiceClient.ListInstructionsPagedResponse> listInstructionsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListInstructionsPagedResponse> future = dataLabelingServiceClient.listInstructionsPagedCallable().futureCall(request);
// Do something
for (Instruction element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.datalabeling.v1beta1.ListInstructionsRequest,com.google.cloud.datalabeling.v1beta1.ListInstructionsResponse> listInstructionsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListInstructionsResponse response = dataLabelingServiceClient.listInstructionsCallable().call(request);
for (Instruction element : response.getInstructionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteInstruction(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
dataLabelingServiceClient.deleteInstruction(formattedName);
}
name
- Required. Instruction resource name, format:
projects/{project_id}/instructions/{instruction_id}ApiException
- if the remote call failspublic final void deleteInstruction(com.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteInstruction(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest,Empty> deleteInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteInstructionCallable().futureCall(request);
// Do something
future.get();
}
public final void deleteAnnotatedDataset(com.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder().build();
dataLabelingServiceClient.deleteAnnotatedDataset(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest,Empty> deleteAnnotatedDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder().build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request);
// Do something
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.