Class DataLabelingServiceClient (0.162.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: Service for the AI Platform Data Labeling API.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
 }
 

Note: close() needs to be called on the DataLabelingServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

CreateDataset

Creates dataset. If success return a Dataset resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createDataset(CreateDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createDataset(ProjectName parent, Dataset dataset)

  • createDataset(String parent, Dataset dataset)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createDatasetCallable()

GetDataset

Gets dataset by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataset(GetDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataset(DatasetName name)

  • getDataset(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDatasetCallable()

ListDatasets

Lists datasets under a project. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDatasets(ListDatasetsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDatasets(ProjectName parent, String filter)

  • listDatasets(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDatasetsPagedCallable()

  • listDatasetsCallable()

DeleteDataset

Deletes a dataset by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteDataset(DeleteDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteDataset(DatasetName name)

  • deleteDataset(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteDatasetCallable()

ImportData

Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • importDataAsync(ImportDataRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • importDataAsync(DatasetName name, InputConfig inputConfig)

  • importDataAsync(String name, InputConfig inputConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • importDataOperationCallable()

  • importDataCallable()

ExportData

Exports data and annotations from dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • exportDataAsync(ExportDataRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • exportDataAsync(DatasetName name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

  • exportDataAsync(DatasetName name, String annotatedDataset, String filter, OutputConfig outputConfig)

  • exportDataAsync(String name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

  • exportDataAsync(String name, String annotatedDataset, String filter, OutputConfig outputConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • exportDataOperationCallable()

  • exportDataCallable()

GetDataItem

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataItem(GetDataItemRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataItem(DataItemName name)

  • getDataItem(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDataItemCallable()

ListDataItems

Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDataItems(ListDataItemsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDataItems(DatasetName parent, String filter)

  • listDataItems(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDataItemsPagedCallable()

  • listDataItemsCallable()

GetAnnotatedDataset

Gets an annotated dataset by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAnnotatedDataset(GetAnnotatedDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAnnotatedDataset(AnnotatedDatasetName name)

  • getAnnotatedDataset(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAnnotatedDatasetCallable()

ListAnnotatedDatasets

Lists annotated datasets for a dataset. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listAnnotatedDatasets(ListAnnotatedDatasetsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listAnnotatedDatasets(DatasetName parent, String filter)

  • listAnnotatedDatasets(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listAnnotatedDatasetsPagedCallable()

  • listAnnotatedDatasetsCallable()

DeleteAnnotatedDataset

Deletes an annotated dataset by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteAnnotatedDatasetCallable()

LabelImage

Starts a labeling task for image. The type of image labeling task is configured by feature in the request.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • labelImageAsync(LabelImageRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • labelImageAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)

  • labelImageAsync(String parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • labelImageOperationCallable()

  • labelImageCallable()

LabelVideo

Starts a labeling task for video. The type of video labeling task is configured by feature in the request.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • labelVideoAsync(LabelVideoRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • labelVideoAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)

  • labelVideoAsync(String parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • labelVideoOperationCallable()

  • labelVideoCallable()

LabelText

Starts a labeling task for text. The type of text labeling task is configured by feature in the request.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • labelTextAsync(LabelTextRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • labelTextAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)

  • labelTextAsync(String parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • labelTextOperationCallable()

  • labelTextCallable()

GetExample

Gets an example by resource name, including both data and annotation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getExample(GetExampleRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getExample(ExampleName name, String filter)

  • getExample(String name, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getExampleCallable()

ListExamples

Lists examples in an annotated dataset. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listExamples(ListExamplesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listExamples(AnnotatedDatasetName parent, String filter)

  • listExamples(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listExamplesPagedCallable()

  • listExamplesCallable()

CreateAnnotationSpecSet

Creates an annotation spec set by providing a set of labels.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createAnnotationSpecSet(ProjectName parent, AnnotationSpecSet annotationSpecSet)

  • createAnnotationSpecSet(String parent, AnnotationSpecSet annotationSpecSet)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createAnnotationSpecSetCallable()

GetAnnotationSpecSet

Gets an annotation spec set by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAnnotationSpecSet(GetAnnotationSpecSetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAnnotationSpecSet(AnnotationSpecSetName name)

  • getAnnotationSpecSet(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAnnotationSpecSetCallable()

ListAnnotationSpecSets

Lists annotation spec sets for a project. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listAnnotationSpecSets(ListAnnotationSpecSetsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listAnnotationSpecSets(ProjectName parent, String filter)

  • listAnnotationSpecSets(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listAnnotationSpecSetsPagedCallable()

  • listAnnotationSpecSetsCallable()

DeleteAnnotationSpecSet

Deletes an annotation spec set by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteAnnotationSpecSet(AnnotationSpecSetName name)

  • deleteAnnotationSpecSet(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteAnnotationSpecSetCallable()

CreateInstruction

Creates an instruction for how data should be labeled.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createInstructionAsync(CreateInstructionRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createInstructionAsync(ProjectName parent, Instruction instruction)

  • createInstructionAsync(String parent, Instruction instruction)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createInstructionOperationCallable()

  • createInstructionCallable()

GetInstruction

Gets an instruction by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getInstruction(GetInstructionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getInstruction(InstructionName name)

  • getInstruction(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getInstructionCallable()

ListInstructions

Lists instructions for a project. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listInstructions(ListInstructionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listInstructions(ProjectName parent, String filter)

  • listInstructions(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listInstructionsPagedCallable()

  • listInstructionsCallable()

DeleteInstruction

Deletes an instruction object by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteInstruction(DeleteInstructionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteInstruction(InstructionName name)

  • deleteInstruction(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteInstructionCallable()

GetEvaluation

Gets an evaluation by resource name (to search, use projects.evaluations.search).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getEvaluation(GetEvaluationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEvaluation(EvaluationName name)

  • getEvaluation(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEvaluationCallable()

SearchEvaluations

Searches evaluations within a project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • searchEvaluations(SearchEvaluationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • searchEvaluations(EvaluationName parent, String filter)

  • searchEvaluations(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • searchEvaluationsPagedCallable()

  • searchEvaluationsCallable()

SearchExampleComparisons

Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • searchExampleComparisons(SearchExampleComparisonsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • searchExampleComparisons(EvaluationName parent)

  • searchExampleComparisons(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • searchExampleComparisonsPagedCallable()

  • searchExampleComparisonsCallable()

CreateEvaluationJob

Creates an evaluation job.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createEvaluationJob(CreateEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createEvaluationJob(ProjectName parent, EvaluationJob job)

  • createEvaluationJob(String parent, EvaluationJob job)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createEvaluationJobCallable()

UpdateEvaluationJob

Updates an evaluation job. You can only update certain fields of the job's EvaluationJobConfig: humanAnnotationConfig.instruction, exampleCount, and exampleSamplePercentage.

If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateEvaluationJob(UpdateEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateEvaluationJob(EvaluationJob evaluationJob, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateEvaluationJobCallable()

GetEvaluationJob

Gets an evaluation job by resource name.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getEvaluationJob(GetEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEvaluationJob(EvaluationJobName name)

  • getEvaluationJob(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEvaluationJobCallable()

PauseEvaluationJob

Pauses an evaluation job. Pausing an evaluation job that is already in a PAUSED state is a no-op.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • pauseEvaluationJob(PauseEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • pauseEvaluationJob(EvaluationJobName name)

  • pauseEvaluationJob(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • pauseEvaluationJobCallable()

ResumeEvaluationJob

Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • resumeEvaluationJob(ResumeEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • resumeEvaluationJob(EvaluationJobName name)

  • resumeEvaluationJob(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • resumeEvaluationJobCallable()

DeleteEvaluationJob

Stops and deletes an evaluation job.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteEvaluationJob(DeleteEvaluationJobRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteEvaluationJob(EvaluationJobName name)

  • deleteEvaluationJob(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteEvaluationJobCallable()

ListEvaluationJobs

Lists all evaluation jobs within a project with possible filters. Pagination is supported.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listEvaluationJobs(ListEvaluationJobsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listEvaluationJobs(ProjectName parent, String filter)

  • listEvaluationJobs(String parent, String filter)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listEvaluationJobsPagedCallable()

  • listEvaluationJobsCallable()

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DataLabelingServiceSettings dataLabelingServiceSettings =
     DataLabelingServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataLabelingServiceClient dataLabelingServiceClient =
     DataLabelingServiceClient.create(dataLabelingServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DataLabelingServiceSettings dataLabelingServiceSettings =
     DataLabelingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataLabelingServiceClient dataLabelingServiceClient =
     DataLabelingServiceClient.create(dataLabelingServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > DataLabelingServiceClient

Static Methods

create()

public static final DataLabelingServiceClient create()

Constructs an instance of DataLabelingServiceClient with default settings.

Returns
Type Description
DataLabelingServiceClient
Exceptions
Type Description
IOException

create(DataLabelingServiceSettings settings)

public static final DataLabelingServiceClient create(DataLabelingServiceSettings settings)

Constructs an instance of DataLabelingServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings DataLabelingServiceSettings
Returns
Type Description
DataLabelingServiceClient
Exceptions
Type Description
IOException

create(DataLabelingServiceStub stub)

public static final DataLabelingServiceClient create(DataLabelingServiceStub stub)

Constructs an instance of DataLabelingServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataLabelingServiceSettings).

Parameter
Name Description
stub DataLabelingServiceStub
Returns
Type Description
DataLabelingServiceClient

Constructors

DataLabelingServiceClient(DataLabelingServiceSettings settings)

protected DataLabelingServiceClient(DataLabelingServiceSettings settings)

Constructs an instance of DataLabelingServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings DataLabelingServiceSettings

DataLabelingServiceClient(DataLabelingServiceStub stub)

protected DataLabelingServiceClient(DataLabelingServiceStub stub)
Parameter
Name Description
stub DataLabelingServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)

public final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)

Creates an annotation spec set by providing a set of labels.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateAnnotationSpecSetRequest request =
       CreateAnnotationSpecSetRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build())
           .build();
   AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(request);
 }
 
Parameter
Name Description
request CreateAnnotationSpecSetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AnnotationSpecSet

createAnnotationSpecSet(ProjectName parent, AnnotationSpecSet annotationSpecSet)

public final AnnotationSpecSet createAnnotationSpecSet(ProjectName parent, AnnotationSpecSet annotationSpecSet)

Creates an annotation spec set by providing a set of labels.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
   AnnotationSpecSet response =
       dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet);
 }
 
Parameters
Name Description
parent ProjectName

Required. AnnotationSpecSet resource parent, format: projects/{project_id}

annotationSpecSet 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.

Returns
Type Description
AnnotationSpecSet

createAnnotationSpecSet(String parent, AnnotationSpecSet annotationSpecSet)

public final AnnotationSpecSet createAnnotationSpecSet(String parent, AnnotationSpecSet annotationSpecSet)

Creates an annotation spec set by providing a set of labels.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
   AnnotationSpecSet response =
       dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet);
 }
 
Parameters
Name Description
parent String

Required. AnnotationSpecSet resource parent, format: projects/{project_id}

annotationSpecSet 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.

Returns
Type Description
AnnotationSpecSet

createAnnotationSpecSetCallable()

public final UnaryCallable<CreateAnnotationSpecSetRequest,AnnotationSpecSet> createAnnotationSpecSetCallable()

Creates an annotation spec set by providing a set of labels.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateAnnotationSpecSetRequest request =
       CreateAnnotationSpecSetRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build())
           .build();
   ApiFuture<AnnotationSpecSet> future =
       dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request);
   // Do something.
   AnnotationSpecSet response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateAnnotationSpecSetRequest,AnnotationSpecSet>

createDataset(CreateDatasetRequest request)

public final Dataset createDataset(CreateDatasetRequest request)

Creates dataset. If success return a Dataset resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   Dataset response = dataLabelingServiceClient.createDataset(request);
 }
 
Parameter
Name Description
request CreateDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dataset

createDataset(ProjectName parent, Dataset dataset)

public final Dataset createDataset(ProjectName parent, Dataset dataset)

Creates dataset. If success return a Dataset resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
 }
 
Parameters
Name Description
parent ProjectName

Required. Dataset resource parent, format: projects/{project_id}

dataset Dataset

Required. The dataset to be created.

Returns
Type Description
Dataset

createDataset(String parent, Dataset dataset)

public final Dataset createDataset(String parent, Dataset dataset)

Creates dataset. If success return a Dataset resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
 }
 
Parameters
Name Description
parent String

Required. Dataset resource parent, format: projects/{project_id}

dataset Dataset

Required. The dataset to be created.

Returns
Type Description
Dataset

createDatasetCallable()

public final UnaryCallable<CreateDatasetRequest,Dataset> createDatasetCallable()

Creates dataset. If success return a Dataset resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   ApiFuture<Dataset> future =
       dataLabelingServiceClient.createDatasetCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDatasetRequest,Dataset>

createEvaluationJob(CreateEvaluationJobRequest request)

public final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest request)

Creates an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateEvaluationJobRequest request =
       CreateEvaluationJobRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJob(EvaluationJob.newBuilder().build())
           .build();
   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(request);
 }
 
Parameter
Name Description
request CreateEvaluationJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
EvaluationJob

createEvaluationJob(ProjectName parent, EvaluationJob job)

public final EvaluationJob createEvaluationJob(ProjectName parent, EvaluationJob job)

Creates an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   EvaluationJob job = EvaluationJob.newBuilder().build();
   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job);
 }
 
Parameters
Name Description
parent ProjectName

Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"

job EvaluationJob

Required. The evaluation job to create.

Returns
Type Description
EvaluationJob

createEvaluationJob(String parent, EvaluationJob job)

public final EvaluationJob createEvaluationJob(String parent, EvaluationJob job)

Creates an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   EvaluationJob job = EvaluationJob.newBuilder().build();
   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job);
 }
 
Parameters
Name Description
parent String

Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"

job EvaluationJob

Required. The evaluation job to create.

Returns
Type Description
EvaluationJob

createEvaluationJobCallable()

public final UnaryCallable<CreateEvaluationJobRequest,EvaluationJob> createEvaluationJobCallable()

Creates an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateEvaluationJobRequest request =
       CreateEvaluationJobRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJob(EvaluationJob.newBuilder().build())
           .build();
   ApiFuture<EvaluationJob> future =
       dataLabelingServiceClient.createEvaluationJobCallable().futureCall(request);
   // Do something.
   EvaluationJob response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateEvaluationJobRequest,EvaluationJob>

createInstructionAsync(CreateInstructionRequest request)

public final OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(CreateInstructionRequest request)

Creates an instruction for how data should be labeled.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateInstructionRequest request =
       CreateInstructionRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInstruction(Instruction.newBuilder().build())
           .build();
   Instruction response = dataLabelingServiceClient.createInstructionAsync(request).get();
 }
 
Parameter
Name Description
request CreateInstructionRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instruction,CreateInstructionMetadata>

createInstructionAsync(ProjectName parent, Instruction instruction)

public final OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(ProjectName parent, Instruction instruction)

Creates an instruction for how data should be labeled.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   Instruction instruction = Instruction.newBuilder().build();
   Instruction response =
       dataLabelingServiceClient.createInstructionAsync(parent, instruction).get();
 }
 
Parameters
Name Description
parent ProjectName

Required. Instruction resource parent, format: projects/{project_id}

instruction Instruction

Required. Instruction of how to perform the labeling task.

Returns
Type Description
OperationFuture<Instruction,CreateInstructionMetadata>

createInstructionAsync(String parent, Instruction instruction)

public final OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(String parent, Instruction instruction)

Creates an instruction for how data should be labeled.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   Instruction instruction = Instruction.newBuilder().build();
   Instruction response =
       dataLabelingServiceClient.createInstructionAsync(parent, instruction).get();
 }
 
Parameters
Name Description
parent String

Required. Instruction resource parent, format: projects/{project_id}

instruction Instruction

Required. Instruction of how to perform the labeling task.

Returns
Type Description
OperationFuture<Instruction,CreateInstructionMetadata>

createInstructionCallable()

public final UnaryCallable<CreateInstructionRequest,Operation> createInstructionCallable()

Creates an instruction for how data should be labeled.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateInstructionRequest request =
       CreateInstructionRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInstruction(Instruction.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       dataLabelingServiceClient.createInstructionCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateInstructionRequest,Operation>

createInstructionOperationCallable()

public final OperationCallable<CreateInstructionRequest,Instruction,CreateInstructionMetadata> createInstructionOperationCallable()

Creates an instruction for how data should be labeled.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   CreateInstructionRequest request =
       CreateInstructionRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInstruction(Instruction.newBuilder().build())
           .build();
   OperationFuture<Instruction, CreateInstructionMetadata> future =
       dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request);
   // Do something.
   Instruction response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateInstructionRequest,Instruction,CreateInstructionMetadata>

deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)

public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)

Deletes an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteAnnotatedDatasetRequest request =
       DeleteAnnotatedDatasetRequest.newBuilder()
           .setName(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .build();
   dataLabelingServiceClient.deleteAnnotatedDataset(request);
 }
 
Parameter
Name Description
request DeleteAnnotatedDatasetRequest

The request object containing all of the parameters for the API call.

deleteAnnotatedDatasetCallable()

public final UnaryCallable<DeleteAnnotatedDatasetRequest,Empty> deleteAnnotatedDatasetCallable()

Deletes an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteAnnotatedDatasetRequest request =
       DeleteAnnotatedDatasetRequest.newBuilder()
           .setName(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteAnnotatedDatasetRequest,Empty>

deleteAnnotationSpecSet(AnnotationSpecSetName name)

public final void deleteAnnotationSpecSet(AnnotationSpecSetName name)

Deletes an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]");
   dataLabelingServiceClient.deleteAnnotationSpecSet(name);
 }
 
Parameter
Name Description
name AnnotationSpecSetName

Required. AnnotationSpec resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}.

deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)

public final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)

Deletes an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteAnnotationSpecSetRequest request =
       DeleteAnnotationSpecSetRequest.newBuilder()
           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
           .build();
   dataLabelingServiceClient.deleteAnnotationSpecSet(request);
 }
 
Parameter
Name Description
request DeleteAnnotationSpecSetRequest

The request object containing all of the parameters for the API call.

deleteAnnotationSpecSet(String name)

public final void deleteAnnotationSpecSet(String name)

Deletes an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString();
   dataLabelingServiceClient.deleteAnnotationSpecSet(name);
 }
 
Parameter
Name Description
name String

Required. AnnotationSpec resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}.

deleteAnnotationSpecSetCallable()

public final UnaryCallable<DeleteAnnotationSpecSetRequest,Empty> deleteAnnotationSpecSetCallable()

Deletes an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteAnnotationSpecSetRequest request =
       DeleteAnnotationSpecSetRequest.newBuilder()
           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
           .build();
   ApiFuture<Empty> future =
       dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteAnnotationSpecSetRequest,Empty>

deleteDataset(DatasetName name)

public final void deleteDataset(DatasetName name)

Deletes a dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
   dataLabelingServiceClient.deleteDataset(name);
 }
 
Parameter
Name Description
name DatasetName

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

deleteDataset(DeleteDatasetRequest request)

public final void deleteDataset(DeleteDatasetRequest request)

Deletes a dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .build();
   dataLabelingServiceClient.deleteDataset(request);
 }
 
Parameter
Name Description
request DeleteDatasetRequest

The request object containing all of the parameters for the API call.

deleteDataset(String name)

public final void deleteDataset(String name)

Deletes a dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
   dataLabelingServiceClient.deleteDataset(name);
 }
 
Parameter
Name Description
name String

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

deleteDatasetCallable()

public final UnaryCallable<DeleteDatasetRequest,Empty> deleteDatasetCallable()

Deletes a dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .build();
   ApiFuture<Empty> future =
       dataLabelingServiceClient.deleteDatasetCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDatasetRequest,Empty>

deleteEvaluationJob(DeleteEvaluationJobRequest request)

public final void deleteEvaluationJob(DeleteEvaluationJobRequest request)

Stops and deletes an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteEvaluationJobRequest request =
       DeleteEvaluationJobRequest.newBuilder()
           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
           .build();
   dataLabelingServiceClient.deleteEvaluationJob(request);
 }
 
Parameter
Name Description
request DeleteEvaluationJobRequest

The request object containing all of the parameters for the API call.

deleteEvaluationJob(EvaluationJobName name)

public final void deleteEvaluationJob(EvaluationJobName name)

Stops and deletes an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]");
   dataLabelingServiceClient.deleteEvaluationJob(name);
 }
 
Parameter
Name Description
name EvaluationJobName

Required. Name of the evaluation job that is going to be deleted. Format:

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"

deleteEvaluationJob(String name)

public final void deleteEvaluationJob(String name)

Stops and deletes an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString();
   dataLabelingServiceClient.deleteEvaluationJob(name);
 }
 
Parameter
Name Description
name String

Required. Name of the evaluation job that is going to be deleted. Format:

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"

deleteEvaluationJobCallable()

public final UnaryCallable<DeleteEvaluationJobRequest,Empty> deleteEvaluationJobCallable()

Stops and deletes an evaluation job.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteEvaluationJobRequest request =
       DeleteEvaluationJobRequest.newBuilder()
           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
           .build();
   ApiFuture<Empty> future =
       dataLabelingServiceClient.deleteEvaluationJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteEvaluationJobRequest,Empty>

deleteInstruction(DeleteInstructionRequest request)

public final void deleteInstruction(DeleteInstructionRequest request)

Deletes an instruction object by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteInstructionRequest request =
       DeleteInstructionRequest.newBuilder()
           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
           .build();
   dataLabelingServiceClient.deleteInstruction(request);
 }
 
Parameter
Name Description
request DeleteInstructionRequest

The request object containing all of the parameters for the API call.

deleteInstruction(InstructionName name)

public final void deleteInstruction(InstructionName name)

Deletes an instruction object by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]");
   dataLabelingServiceClient.deleteInstruction(name);
 }
 
Parameter
Name Description
name InstructionName

Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}

deleteInstruction(String name)

public final void deleteInstruction(String name)

Deletes an instruction object by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString();
   dataLabelingServiceClient.deleteInstruction(name);
 }
 
Parameter
Name Description
name String

Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}

deleteInstructionCallable()

public final UnaryCallable<DeleteInstructionRequest,Empty> deleteInstructionCallable()

Deletes an instruction object by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DeleteInstructionRequest request =
       DeleteInstructionRequest.newBuilder()
           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
           .build();
   ApiFuture<Empty> future =
       dataLabelingServiceClient.deleteInstructionCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteInstructionRequest,Empty>

exportDataAsync(DatasetName name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

public final OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
   AnnotatedDatasetName annotatedDataset =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
   String filter = "filter-1274492040";
   OutputConfig outputConfig = OutputConfig.newBuilder().build();
   ExportDataOperationResponse response =
       dataLabelingServiceClient
           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
           .get();
 }
 
Parameters
Name Description
name DatasetName

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

annotatedDataset AnnotatedDatasetName

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 String

Optional. Filter is not supported at this moment.

outputConfig OutputConfig

Required. Specify the output destination.

Returns
Type Description
OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>

exportDataAsync(DatasetName name, String annotatedDataset, String filter, OutputConfig outputConfig)

public final OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, String annotatedDataset, String filter, OutputConfig outputConfig)

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
   String annotatedDataset =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
   String filter = "filter-1274492040";
   OutputConfig outputConfig = OutputConfig.newBuilder().build();
   ExportDataOperationResponse response =
       dataLabelingServiceClient
           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
           .get();
 }
 
Parameters
Name Description
name DatasetName

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

annotatedDataset String

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 String

Optional. Filter is not supported at this moment.

outputConfig OutputConfig

Required. Specify the output destination.

Returns
Type Description
OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>

exportDataAsync(ExportDataRequest request)

public final OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request)

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .setAnnotatedDataset(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .setFilter("filter-1274492040")
           .setOutputConfig(OutputConfig.newBuilder().build())
           .setUserEmailAddress("userEmailAddress-1844787165")
           .build();
   ExportDataOperationResponse response =
       dataLabelingServiceClient.exportDataAsync(request).get();
 }
 
Parameter
Name Description
request ExportDataRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>

exportDataAsync(String name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

public final OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(String name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
   AnnotatedDatasetName annotatedDataset =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
   String filter = "filter-1274492040";
   OutputConfig outputConfig = OutputConfig.newBuilder().build();
   ExportDataOperationResponse response =
       dataLabelingServiceClient
           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
           .get();
 }
 
Parameters
Name Description
name String

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

annotatedDataset AnnotatedDatasetName

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 String

Optional. Filter is not supported at this moment.

outputConfig OutputConfig

Required. Specify the output destination.

Returns
Type Description
OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>

exportDataAsync(String name, String annotatedDataset, String filter, OutputConfig outputConfig)

public final OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(String name, String annotatedDataset, String filter, OutputConfig outputConfig)

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
   String annotatedDataset =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
   String filter = "filter-1274492040";
   OutputConfig outputConfig = OutputConfig.newBuilder().build();
   ExportDataOperationResponse response =
       dataLabelingServiceClient
           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
           .get();
 }
 
Parameters
Name Description
name String

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

annotatedDataset String

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 String

Optional. Filter is not supported at this moment.

outputConfig OutputConfig

Required. Specify the output destination.

Returns
Type Description
OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>

exportDataCallable()

public final UnaryCallable<ExportDataRequest,Operation> exportDataCallable()

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .setAnnotatedDataset(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .setFilter("filter-1274492040")
           .setOutputConfig(OutputConfig.newBuilder().build())
           .setUserEmailAddress("userEmailAddress-1844787165")
           .build();
   ApiFuture<Operation> future =
       dataLabelingServiceClient.exportDataCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ExportDataRequest,Operation>

exportDataOperationCallable()

public final OperationCallable<ExportDataRequest,ExportDataOperationResponse,ExportDataOperationMetadata> exportDataOperationCallable()

Exports data and annotations from dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .setAnnotatedDataset(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .setFilter("filter-1274492040")
           .setOutputConfig(OutputConfig.newBuilder().build())
           .setUserEmailAddress("userEmailAddress-1844787165")
           .build();
   OperationFuture<ExportDataOperationResponse, ExportDataOperationMetadata> future =
       dataLabelingServiceClient.exportDataOperationCallable().futureCall(request);
   // Do something.
   ExportDataOperationResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<ExportDataRequest,ExportDataOperationResponse,ExportDataOperationMetadata>

getAnnotatedDataset(AnnotatedDatasetName name)

public final AnnotatedDataset getAnnotatedDataset(AnnotatedDatasetName name)

Gets an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   AnnotatedDatasetName name =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name);
 }
 
Parameter
Name Description
name AnnotatedDatasetName

Required. Name of the annotated dataset to get, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

Returns
Type Description
AnnotatedDataset

getAnnotatedDataset(GetAnnotatedDatasetRequest request)

public final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest request)

Gets an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetAnnotatedDatasetRequest request =
       GetAnnotatedDatasetRequest.newBuilder()
           .setName(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .build();
   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(request);
 }
 
Parameter
Name Description
request GetAnnotatedDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AnnotatedDataset

getAnnotatedDataset(String name)

public final AnnotatedDataset getAnnotatedDataset(String name)

Gets an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name =
       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name);
 }
 
Parameter
Name Description
name String

Required. Name of the annotated dataset to get, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

Returns
Type Description
AnnotatedDataset

getAnnotatedDatasetCallable()

public final UnaryCallable<GetAnnotatedDatasetRequest,AnnotatedDataset> getAnnotatedDatasetCallable()

Gets an annotated dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetAnnotatedDatasetRequest request =
       GetAnnotatedDatasetRequest.newBuilder()
           .setName(
               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
                   .toString())
           .build();
   ApiFuture<AnnotatedDataset> future =
       dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request);
   // Do something.
   AnnotatedDataset response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetAnnotatedDatasetRequest,AnnotatedDataset>

getAnnotationSpecSet(AnnotationSpecSetName name)

public final AnnotationSpecSet getAnnotationSpecSet(AnnotationSpecSetName name)

Gets an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]");
   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name);
 }
 
Parameter
Name Description
name AnnotationSpecSetName

Required. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}

Returns
Type Description
AnnotationSpecSet

getAnnotationSpecSet(GetAnnotationSpecSetRequest request)

public final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest request)

Gets an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetAnnotationSpecSetRequest request =
       GetAnnotationSpecSetRequest.newBuilder()
           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
           .build();
   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(request);
 }
 
Parameter
Name Description
request GetAnnotationSpecSetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AnnotationSpecSet

getAnnotationSpecSet(String name)

public final AnnotationSpecSet getAnnotationSpecSet(String name)

Gets an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString();
   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name);
 }
 
Parameter
Name Description
name String

Required. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}

Returns
Type Description
AnnotationSpecSet

getAnnotationSpecSetCallable()

public final UnaryCallable<GetAnnotationSpecSetRequest,AnnotationSpecSet> getAnnotationSpecSetCallable()

Gets an annotation spec set by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetAnnotationSpecSetRequest request =
       GetAnnotationSpecSetRequest.newBuilder()
           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
           .build();
   ApiFuture<AnnotationSpecSet> future =
       dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request);
   // Do something.
   AnnotationSpecSet response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetAnnotationSpecSetRequest,AnnotationSpecSet>

getDataItem(DataItemName name)

public final DataItem getDataItem(DataItemName name)

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DataItemName name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
   DataItem response = dataLabelingServiceClient.getDataItem(name);
 }
 
Parameter
Name Description
name DataItemName

Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}

Returns
Type Description
DataItem

getDataItem(GetDataItemRequest request)

public final DataItem getDataItem(GetDataItemRequest request)

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetDataItemRequest request =
       GetDataItemRequest.newBuilder()
           .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString())
           .build();
   DataItem response = dataLabelingServiceClient.getDataItem(request);
 }
 
Parameter
Name Description
request GetDataItemRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
DataItem

getDataItem(String name)

public final DataItem getDataItem(String name)

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString();
   DataItem response = dataLabelingServiceClient.getDataItem(name);
 }
 
Parameter
Name Description
name String

Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}

Returns
Type Description
DataItem

getDataItemCallable()

public final UnaryCallable<GetDataItemRequest,DataItem> getDataItemCallable()

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetDataItemRequest request =
       GetDataItemRequest.newBuilder()
           .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString())
           .build();
   ApiFuture<DataItem> future =
       dataLabelingServiceClient.getDataItemCallable().futureCall(request);
   // Do something.
   DataItem response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDataItemRequest,DataItem>

getDataset(DatasetName name)

public final Dataset getDataset(DatasetName name)

Gets dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
   Dataset response = dataLabelingServiceClient.getDataset(name);
 }
 
Parameter
Name Description
name DatasetName

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Returns
Type Description
Dataset

getDataset(GetDatasetRequest request)

public final Dataset getDataset(GetDatasetRequest request)

Gets dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .build();
   Dataset response = dataLabelingServiceClient.getDataset(request);
 }
 
Parameter
Name Description
request GetDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dataset

getDataset(String name)

public final Dataset getDataset(String name)

Gets dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
   Dataset response = dataLabelingServiceClient.getDataset(name);
 }
 
Parameter
Name Description
name String

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Returns
Type Description
Dataset

getDatasetCallable()

public final UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()

Gets dataset by resource name.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
           .build();
   ApiFuture<Dataset> future =
       dataLabelingServiceClient.getDatasetCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDatasetRequest,Dataset>

getEvaluation(EvaluationName name)

public final Evaluation getEvaluation(EvaluationName name)

Gets an evaluation by resource name (to search, use projects.evaluations.search).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   EvaluationName name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]");
   Evaluation response = dataLabelingServiceClient.getEvaluation(name);
 }
 
Parameter
Name Description
name EvaluationName

Required. Name of the evaluation. Format:

"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>'

Returns
Type Description
Evaluation

getEvaluation(GetEvaluationRequest request)

public final Evaluation getEvaluation(GetEvaluationRequest request)

Gets an evaluation by resource name (to search, use projects.evaluations.search).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
   GetEvaluationRequest request =
       GetEvaluationRequest.newBuilder()
           .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
           .build();
   Evaluation response = dataLabelingServiceClient.getEvaluation(request);
 }
 
Parameter
Name Description
request GetEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Evaluation

getEvaluation(String name)

public final Evaluation getEvaluation(