@Generated(value="by gapic-generator") @BetaApi public class DataLabelingServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = dataLabelingServiceClient.createDataset(formattedParent, dataset);
}
Note: close() needs to be called on the dataLabelingServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DataLabelingServiceSettings to create(). For example:
To customize credentials:
DataLabelingServiceSettings dataLabelingServiceSettings =
DataLabelingServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataLabelingServiceClient dataLabelingServiceClient =
DataLabelingServiceClient.create(dataLabelingServiceSettings);
To customize the endpoint:
DataLabelingServiceSettings dataLabelingServiceSettings =
DataLabelingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataLabelingServiceClient dataLabelingServiceClient =
DataLabelingServiceClient.create(dataLabelingServiceSettings);
Modifier | Constructor and Description |
---|---|
protected |
DataLabelingServiceClient(DataLabelingServiceSettings settings)
Constructs an instance of DataLabelingServiceClient, using the given settings.
|
protected |
DataLabelingServiceClient(DataLabelingServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DataLabelingServiceClient |
create()
Constructs an instance of DataLabelingServiceClient with default settings.
|
static DataLabelingServiceClient |
create(DataLabelingServiceSettings settings)
Constructs an instance of DataLabelingServiceClient, using the given settings.
|
static DataLabelingServiceClient |
create(DataLabelingServiceStub stub)
Constructs an instance of DataLabelingServiceClient, using the given stub for making calls.
|
AnnotationSpecSet |
createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)
Creates an annotation spec set by providing a set of labels.
|
AnnotationSpecSet |
createAnnotationSpecSet(String parent,
AnnotationSpecSet annotationSpecSet)
Creates an annotation spec set by providing a set of labels.
|
com.google.api.gax.rpc.UnaryCallable<CreateAnnotationSpecSetRequest,AnnotationSpecSet> |
createAnnotationSpecSetCallable()
Creates an annotation spec set by providing a set of labels.
|
Dataset |
createDataset(CreateDatasetRequest request)
Creates dataset.
|
Dataset |
createDataset(String parent,
Dataset dataset)
Creates dataset.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset> |
createDatasetCallable()
Creates dataset.
|
EvaluationJob |
createEvaluationJob(CreateEvaluationJobRequest request)
Creates an evaluation job.
|
EvaluationJob |
createEvaluationJob(String parent,
EvaluationJob job)
Creates an evaluation job.
|
com.google.api.gax.rpc.UnaryCallable<CreateEvaluationJobRequest,EvaluationJob> |
createEvaluationJobCallable()
Creates an evaluation job.
|
com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> |
createInstructionAsync(CreateInstructionRequest request)
Creates an instruction for how data should be labeled.
|
com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> |
createInstructionAsync(String parent,
Instruction instruction)
Creates an instruction for how data should be labeled.
|
com.google.api.gax.rpc.UnaryCallable<CreateInstructionRequest,com.google.longrunning.Operation> |
createInstructionCallable()
Creates an instruction for how data should be labeled.
|
com.google.api.gax.rpc.OperationCallable<CreateInstructionRequest,Instruction,CreateInstructionMetadata> |
createInstructionOperationCallable()
Creates an instruction for how data should be labeled.
|
void |
deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)
Deletes an annotated dataset by resource name.
|
com.google.api.gax.rpc.UnaryCallable<DeleteAnnotatedDatasetRequest,Empty> |
deleteAnnotatedDatasetCallable()
Deletes an annotated dataset by resource name.
|
void |
deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)
Deletes an annotation spec set by resource name.
|
void |
deleteAnnotationSpecSet(String name)
Deletes an annotation spec set by resource name.
|
com.google.api.gax.rpc.UnaryCallable<DeleteAnnotationSpecSetRequest,Empty> |
deleteAnnotationSpecSetCallable()
Deletes an annotation spec set by resource name.
|
void |
deleteDataset(DeleteDatasetRequest request)
Deletes a dataset by resource name.
|
void |
deleteDataset(String name)
Deletes a dataset by resource name.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,Empty> |
deleteDatasetCallable()
Deletes a dataset by resource name.
|
void |
deleteEvaluationJob(DeleteEvaluationJobRequest request)
Stops and deletes an evaluation job.
|
void |
deleteEvaluationJob(String name)
Stops and deletes an evaluation job.
|
com.google.api.gax.rpc.UnaryCallable<DeleteEvaluationJobRequest,Empty> |
deleteEvaluationJobCallable()
Stops and deletes an evaluation job.
|
void |
deleteInstruction(DeleteInstructionRequest request)
Deletes an instruction object by resource name.
|
void |
deleteInstruction(String name)
Deletes an instruction object by resource name.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInstructionRequest,Empty> |
deleteInstructionCallable()
Deletes an instruction object by resource name.
|
com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> |
exportDataAsync(ExportDataRequest request)
Exports data and annotations from dataset.
|
com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> |
exportDataAsync(String name,
String annotatedDataset,
String filter,
OutputConfig outputConfig)
Exports data and annotations from dataset.
|
com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> |
exportDataCallable()
Exports data and annotations from dataset.
|
com.google.api.gax.rpc.OperationCallable<ExportDataRequest,ExportDataOperationResponse,ExportDataOperationMetadata> |
exportDataOperationCallable()
Exports data and annotations from dataset.
|
static String |
formatAnnotatedDatasetName(String project,
String dataset,
String annotatedDataset)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
formatAnnotationSpecSetName(String project,
String annotationSpecSet)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
formatDataItemName(String project,
String dataset,
String dataItem)
Deprecated.
Use the
DataItemName class instead. |
static String |
formatDatasetName(String project,
String dataset)
Deprecated.
Use the
DatasetName class instead. |
static String |
formatEvaluationJobName(String project,
String evaluationJob)
Deprecated.
Use the
EvaluationJobName class instead. |
static String |
formatEvaluationName(String project,
String dataset,
String evaluation)
Deprecated.
Use the
EvaluationName class instead. |
static String |
formatExampleName(String project,
String dataset,
String annotatedDataset,
String example)
Deprecated.
Use the
ExampleName class instead. |
static String |
formatInstructionName(String project,
String instruction)
Deprecated.
Use the
InstructionName class instead. |
static String |
formatProjectName(String project)
Deprecated.
Use the
ProjectName class instead. |
AnnotatedDataset |
getAnnotatedDataset(GetAnnotatedDatasetRequest request)
Gets an annotated dataset by resource name.
|
AnnotatedDataset |
getAnnotatedDataset(String name)
Gets an annotated dataset by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetAnnotatedDatasetRequest,AnnotatedDataset> |
getAnnotatedDatasetCallable()
Gets an annotated dataset by resource name.
|
AnnotationSpecSet |
getAnnotationSpecSet(GetAnnotationSpecSetRequest request)
Gets an annotation spec set by resource name.
|
AnnotationSpecSet |
getAnnotationSpecSet(String name)
Gets an annotation spec set by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecSetRequest,AnnotationSpecSet> |
getAnnotationSpecSetCallable()
Gets an annotation spec set by resource name.
|
DataItem |
getDataItem(GetDataItemRequest request)
Gets a data item in a dataset by resource name.
|
DataItem |
getDataItem(String name)
Gets a data item in a dataset by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetDataItemRequest,DataItem> |
getDataItemCallable()
Gets a data item in a dataset by resource name.
|
Dataset |
getDataset(GetDatasetRequest request)
Gets dataset by resource name.
|
Dataset |
getDataset(String name)
Gets dataset by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> |
getDatasetCallable()
Gets dataset by resource name.
|
Evaluation |
getEvaluation(GetEvaluationRequest request)
Gets an evaluation by resource name.
|
Evaluation |
getEvaluation(String name)
Gets an evaluation by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation> |
getEvaluationCallable()
Gets an evaluation by resource name.
|
EvaluationJob |
getEvaluationJob(GetEvaluationJobRequest request)
Gets an evaluation job by resource name.
|
EvaluationJob |
getEvaluationJob(String name)
Gets an evaluation job by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetEvaluationJobRequest,EvaluationJob> |
getEvaluationJobCallable()
Gets an evaluation job by resource name.
|
Example |
getExample(GetExampleRequest request)
Gets an example by resource name, including both data and annotation.
|
Example |
getExample(String name,
String filter)
Gets an example by resource name, including both data and annotation.
|
com.google.api.gax.rpc.UnaryCallable<GetExampleRequest,Example> |
getExampleCallable()
Gets an example by resource name, including both data and annotation.
|
Instruction |
getInstruction(GetInstructionRequest request)
Gets an instruction by resource name.
|
Instruction |
getInstruction(String name)
Gets an instruction by resource name.
|
com.google.api.gax.rpc.UnaryCallable<GetInstructionRequest,Instruction> |
getInstructionCallable()
Gets an instruction by resource name.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DataLabelingServiceSettings |
getSettings() |
DataLabelingServiceStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> |
importDataAsync(ImportDataRequest request)
Imports data into dataset based on source locations defined in request.
|
com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> |
importDataAsync(String name,
InputConfig inputConfig)
Imports data into dataset based on source locations defined in request.
|
com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> |
importDataCallable()
Imports data into dataset based on source locations defined in request.
|
com.google.api.gax.rpc.OperationCallable<ImportDataRequest,ImportDataOperationResponse,ImportDataOperationMetadata> |
importDataOperationCallable()
Imports data into dataset based on source locations defined in request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelImageAsync(LabelImageRequest request)
Starts a labeling task for image.
|
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelImageAsync(String parent,
HumanAnnotationConfig basicConfig,
LabelImageRequest.Feature feature)
Starts a labeling task for image.
|
com.google.api.gax.rpc.UnaryCallable<LabelImageRequest,com.google.longrunning.Operation> |
labelImageCallable()
Starts a labeling task for image.
|
com.google.api.gax.rpc.OperationCallable<LabelImageRequest,AnnotatedDataset,LabelOperationMetadata> |
labelImageOperationCallable()
Starts a labeling task for image.
|
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelTextAsync(LabelTextRequest request)
Starts a labeling task for text.
|
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelTextAsync(String parent,
HumanAnnotationConfig basicConfig,
LabelTextRequest.Feature feature)
Starts a labeling task for text.
|
com.google.api.gax.rpc.UnaryCallable<LabelTextRequest,com.google.longrunning.Operation> |
labelTextCallable()
Starts a labeling task for text.
|
com.google.api.gax.rpc.OperationCallable<LabelTextRequest,AnnotatedDataset,LabelOperationMetadata> |
labelTextOperationCallable()
Starts a labeling task for text.
|
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelVideoAsync(LabelVideoRequest request)
Starts a labeling task for video.
|
com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> |
labelVideoAsync(String parent,
HumanAnnotationConfig basicConfig,
LabelVideoRequest.Feature feature)
Starts a labeling task for video.
|
com.google.api.gax.rpc.UnaryCallable<LabelVideoRequest,com.google.longrunning.Operation> |
labelVideoCallable()
Starts a labeling task for video.
|
com.google.api.gax.rpc.OperationCallable<LabelVideoRequest,AnnotatedDataset,LabelOperationMetadata> |
labelVideoOperationCallable()
Starts a labeling task for video.
|
DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse |
listAnnotatedDatasets(ListAnnotatedDatasetsRequest request)
Lists annotated datasets for a dataset.
|
DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse |
listAnnotatedDatasets(String parent,
String filter)
Lists annotated datasets for a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,ListAnnotatedDatasetsResponse> |
listAnnotatedDatasetsCallable()
Lists annotated datasets for a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse> |
listAnnotatedDatasetsPagedCallable()
Lists annotated datasets for a dataset.
|
DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse |
listAnnotationSpecSets(ListAnnotationSpecSetsRequest request)
Lists annotation spec sets for a project.
|
DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse |
listAnnotationSpecSets(String parent,
String filter)
Lists annotation spec sets for a project.
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,ListAnnotationSpecSetsResponse> |
listAnnotationSpecSetsCallable()
Lists annotation spec sets for a project.
|
com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse> |
listAnnotationSpecSetsPagedCallable()
Lists annotation spec sets for a project.
|
DataLabelingServiceClient.ListDataItemsPagedResponse |
listDataItems(ListDataItemsRequest request)
Lists data items in a dataset.
|
DataLabelingServiceClient.ListDataItemsPagedResponse |
listDataItems(String parent,
String filter)
Lists data items in a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> |
listDataItemsCallable()
Lists data items in a dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,DataLabelingServiceClient.ListDataItemsPagedResponse> |
listDataItemsPagedCallable()
Lists data items in a dataset.
|
DataLabelingServiceClient.ListDatasetsPagedResponse |
listDatasets(ListDatasetsRequest request)
Lists datasets under a project.
|
DataLabelingServiceClient.ListDatasetsPagedResponse |
listDatasets(String parent,
String filter)
Lists datasets under a project.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> |
listDatasetsCallable()
Lists datasets under a project.
|
com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,DataLabelingServiceClient.ListDatasetsPagedResponse> |
listDatasetsPagedCallable()
Lists datasets under a project.
|
DataLabelingServiceClient.ListEvaluationJobsPagedResponse |
listEvaluationJobs(ListEvaluationJobsRequest request)
Lists all evaluation jobs within a project with possible filters.
|
DataLabelingServiceClient.ListEvaluationJobsPagedResponse |
listEvaluationJobs(String parent,
String filter)
Lists all evaluation jobs within a project with possible filters.
|
com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,ListEvaluationJobsResponse> |
listEvaluationJobsCallable()
Lists all evaluation jobs within a project with possible filters.
|
com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,DataLabelingServiceClient.ListEvaluationJobsPagedResponse> |
listEvaluationJobsPagedCallable()
Lists all evaluation jobs within a project with possible filters.
|
DataLabelingServiceClient.ListExamplesPagedResponse |
listExamples(ListExamplesRequest request)
Lists examples in an annotated dataset.
|
DataLabelingServiceClient.ListExamplesPagedResponse |
listExamples(String parent,
String filter)
Lists examples in an annotated dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,ListExamplesResponse> |
listExamplesCallable()
Lists examples in an annotated dataset.
|
com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,DataLabelingServiceClient.ListExamplesPagedResponse> |
listExamplesPagedCallable()
Lists examples in an annotated dataset.
|
DataLabelingServiceClient.ListInstructionsPagedResponse |
listInstructions(ListInstructionsRequest request)
Lists instructions for a project.
|
DataLabelingServiceClient.ListInstructionsPagedResponse |
listInstructions(String parent,
String filter)
Lists instructions for a project.
|
com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,ListInstructionsResponse> |
listInstructionsCallable()
Lists instructions for a project.
|
com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,DataLabelingServiceClient.ListInstructionsPagedResponse> |
listInstructionsPagedCallable()
Lists instructions for a project.
|
static String |
parseAnnotatedDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseAnnotatedDatasetFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseAnnotationSpecSetFromAnnotationSpecSetName(String annotationSpecSetName)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
parseDataItemFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseDatasetFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseDatasetFromDatasetName(String datasetName)
Deprecated.
Use the
DatasetName class instead. |
static String |
parseDatasetFromEvaluationName(String evaluationName)
Deprecated.
Use the
EvaluationName class instead. |
static String |
parseDatasetFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseEvaluationFromEvaluationName(String evaluationName)
Deprecated.
Use the
EvaluationName class instead. |
static String |
parseEvaluationJobFromEvaluationJobName(String evaluationJobName)
Deprecated.
Use the
EvaluationJobName class instead. |
static String |
parseExampleFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseInstructionFromInstructionName(String instructionName)
Deprecated.
Use the
InstructionName class instead. |
static String |
parseProjectFromAnnotatedDatasetName(String annotatedDatasetName)
Deprecated.
Use the
AnnotatedDatasetName class instead. |
static String |
parseProjectFromAnnotationSpecSetName(String annotationSpecSetName)
Deprecated.
Use the
AnnotationSpecSetName class instead. |
static String |
parseProjectFromDataItemName(String dataItemName)
Deprecated.
Use the
DataItemName class instead. |
static String |
parseProjectFromDatasetName(String datasetName)
Deprecated.
Use the
DatasetName class instead. |
static String |
parseProjectFromEvaluationJobName(String evaluationJobName)
Deprecated.
Use the
EvaluationJobName class instead. |
static String |
parseProjectFromEvaluationName(String evaluationName)
Deprecated.
Use the
EvaluationName class instead. |
static String |
parseProjectFromExampleName(String exampleName)
Deprecated.
Use the
ExampleName class instead. |
static String |
parseProjectFromInstructionName(String instructionName)
Deprecated.
Use the
InstructionName class instead. |
static String |
parseProjectFromProjectName(String projectName)
Deprecated.
Use the
ProjectName class instead. |
void |
pauseEvaluationJob(PauseEvaluationJobRequest request)
Pauses an evaluation job.
|
void |
pauseEvaluationJob(String name)
Pauses an evaluation job.
|
com.google.api.gax.rpc.UnaryCallable<PauseEvaluationJobRequest,Empty> |
pauseEvaluationJobCallable()
Pauses an evaluation job.
|
void |
resumeEvaluationJob(ResumeEvaluationJobRequest request)
Resumes a paused evaluation job.
|
void |
resumeEvaluationJob(String name)
Resumes a paused evaluation job.
|
com.google.api.gax.rpc.UnaryCallable<ResumeEvaluationJobRequest,Empty> |
resumeEvaluationJobCallable()
Resumes a paused evaluation job.
|
DataLabelingServiceClient.SearchEvaluationsPagedResponse |
searchEvaluations(SearchEvaluationsRequest request)
Searchs evaluations within a project.
|
DataLabelingServiceClient.SearchEvaluationsPagedResponse |
searchEvaluations(String parent,
String filter)
Searchs evaluations within a project.
|
com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,SearchEvaluationsResponse> |
searchEvaluationsCallable()
Searchs evaluations within a project.
|
com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,DataLabelingServiceClient.SearchEvaluationsPagedResponse> |
searchEvaluationsPagedCallable()
Searchs evaluations within a project.
|
DataLabelingServiceClient.SearchExampleComparisonsPagedResponse |
searchExampleComparisons(SearchExampleComparisonsRequest request)
Searchs example comparisons in evaluation, in format of examples of both ground truth and
prediction(s).
|
DataLabelingServiceClient.SearchExampleComparisonsPagedResponse |
searchExampleComparisons(String parent)
Searchs example comparisons in evaluation, in format of examples of both ground truth and
prediction(s).
|
com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,SearchExampleComparisonsResponse> |
searchExampleComparisonsCallable()
Searchs example comparisons in evaluation, in format of examples of both ground truth and
prediction(s).
|
com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,DataLabelingServiceClient.SearchExampleComparisonsPagedResponse> |
searchExampleComparisonsPagedCallable()
Searchs example comparisons in evaluation, in format of examples of both ground truth and
prediction(s).
|
void |
shutdown() |
void |
shutdownNow() |
EvaluationJob |
updateEvaluationJob(EvaluationJob evaluationJob,
FieldMask updateMask)
Updates an evaluation job.
|
EvaluationJob |
updateEvaluationJob(UpdateEvaluationJobRequest request)
Updates an evaluation job.
|
com.google.api.gax.rpc.UnaryCallable<UpdateEvaluationJobRequest,EvaluationJob> |
updateEvaluationJobCallable()
Updates an evaluation job.
|
protected DataLabelingServiceClient(DataLabelingServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DataLabelingServiceClient(DataLabelingServiceStub stub)
@Deprecated public static final String formatAnnotatedDatasetName(String project, String dataset, String annotatedDataset)
AnnotatedDatasetName
class instead.@Deprecated public static final String formatAnnotationSpecSetName(String project, String annotationSpecSet)
AnnotationSpecSetName
class instead.@Deprecated public static final String formatDataItemName(String project, String dataset, String dataItem)
DataItemName
class instead.@Deprecated public static final String formatDatasetName(String project, String dataset)
DatasetName
class instead.@Deprecated public static final String formatEvaluationName(String project, String dataset, String evaluation)
EvaluationName
class instead.@Deprecated public static final String formatEvaluationJobName(String project, String evaluationJob)
EvaluationJobName
class instead.@Deprecated public static final String formatExampleName(String project, String dataset, String annotatedDataset, String example)
ExampleName
class instead.@Deprecated public static final String formatInstructionName(String project, String instruction)
InstructionName
class instead.@Deprecated public static final String formatProjectName(String project)
ProjectName
class instead.@Deprecated public static final String parseProjectFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseAnnotatedDatasetFromAnnotatedDatasetName(String annotatedDatasetName)
AnnotatedDatasetName
class instead.@Deprecated public static final String parseProjectFromAnnotationSpecSetName(String annotationSpecSetName)
AnnotationSpecSetName
class instead.@Deprecated public static final String parseAnnotationSpecSetFromAnnotationSpecSetName(String annotationSpecSetName)
AnnotationSpecSetName
class instead.@Deprecated public static final String parseProjectFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseDatasetFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseDataItemFromDataItemName(String dataItemName)
DataItemName
class instead.@Deprecated public static final String parseProjectFromDatasetName(String datasetName)
DatasetName
class instead.@Deprecated public static final String parseDatasetFromDatasetName(String datasetName)
DatasetName
class instead.@Deprecated public static final String parseProjectFromEvaluationName(String evaluationName)
EvaluationName
class instead.@Deprecated public static final String parseDatasetFromEvaluationName(String evaluationName)
EvaluationName
class instead.@Deprecated public static final String parseEvaluationFromEvaluationName(String evaluationName)
EvaluationName
class instead.@Deprecated public static final String parseProjectFromEvaluationJobName(String evaluationJobName)
EvaluationJobName
class instead.@Deprecated public static final String parseEvaluationJobFromEvaluationJobName(String evaluationJobName)
EvaluationJobName
class instead.@Deprecated public static final String parseProjectFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseDatasetFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseAnnotatedDatasetFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseExampleFromExampleName(String exampleName)
ExampleName
class instead.@Deprecated public static final String parseProjectFromInstructionName(String instructionName)
InstructionName
class instead.@Deprecated public static final String parseInstructionFromInstructionName(String instructionName)
InstructionName
class instead.@Deprecated public static final String parseProjectFromProjectName(String projectName)
ProjectName
class instead.public static final DataLabelingServiceClient create() throws IOException
IOException
public static final DataLabelingServiceClient create(DataLabelingServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DataLabelingServiceClient create(DataLabelingServiceStub stub)
public final DataLabelingServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DataLabelingServiceStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.longrunning.OperationsClient getOperationsClient()
public final Dataset createDataset(String parent, Dataset dataset)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = dataLabelingServiceClient.createDataset(formattedParent, dataset);
}
parent
- Required. Dataset resource parent, format: projects/{project_id}dataset
- Required. The dataset to be created.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Dataset createDataset(CreateDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(formattedParent)
.setDataset(dataset)
.build();
Dataset response = dataLabelingServiceClient.createDataset(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset> createDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Dataset dataset = Dataset.newBuilder().build();
CreateDatasetRequest request = CreateDatasetRequest.newBuilder()
.setParent(formattedParent)
.setDataset(dataset)
.build();
ApiFuture<Dataset> future = dataLabelingServiceClient.createDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final Dataset getDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
Dataset response = dataLabelingServiceClient.getDataset(formattedName);
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Dataset getDataset(GetDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(formattedName)
.build();
Dataset response = dataLabelingServiceClient.getDataset(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
GetDatasetRequest request = GetDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Dataset> future = dataLabelingServiceClient.getDatasetCallable().futureCall(request);
// Do something
Dataset response = future.get();
}
public final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Dataset element : dataLabelingServiceClient.listDatasets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Dataset resource parent, format: projects/{project_id}filter
- Optional. Filter on dataset is not supported at this moment.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Dataset element : dataLabelingServiceClient.listDatasets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,DataLabelingServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListDatasetsPagedResponse> future = dataLabelingServiceClient.listDatasetsPagedCallable().futureCall(request);
// Do something
for (Dataset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListDatasetsRequest request = ListDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListDatasetsResponse response = dataLabelingServiceClient.listDatasetsCallable().call(request);
for (Dataset element : response.getDatasetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
dataLabelingServiceClient.deleteDataset(formattedName);
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteDataset(DeleteDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteDataset(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,Empty> deleteDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteDatasetCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> importDataAsync(String name, InputConfig inputConfig)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(formattedName, inputConfig).get();
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}inputConfig
- Required. Specify the input source of the data.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> importDataAsync(ImportDataRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<ImportDataRequest,ImportDataOperationResponse,ImportDataOperationMetadata> importDataOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
OperationFuture<ImportDataOperationResponse, ImportDataOperationMetadata> future = dataLabelingServiceClient.importDataOperationCallable().futureCall(request);
// Do something
ImportDataOperationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> importDataCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
InputConfig inputConfig = InputConfig.newBuilder().build();
ImportDataRequest request = ImportDataRequest.newBuilder()
.setName(formattedName)
.setInputConfig(inputConfig)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.importDataCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(String name, String annotatedDataset, String filter, OutputConfig outputConfig)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
String filter = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataOperationResponse response = dataLabelingServiceClient.exportDataAsync(formattedName, annotatedDataset, filter, outputConfig).get();
}
name
- Required. Dataset resource name, format:
projects/{project_id}/datasets/{dataset_id}annotatedDataset
- Required. Annotated dataset resource name. DataItem in Dataset and
their annotations in specified annotated dataset will be exported. It's in format of
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}filter
- Optional. Filter is not supported at this moment.outputConfig
- Required. Specify the output destination.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
ExportDataOperationResponse response = dataLabelingServiceClient.exportDataAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<ExportDataRequest,ExportDataOperationResponse,ExportDataOperationMetadata> exportDataOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
OperationFuture<ExportDataOperationResponse, ExportDataOperationMetadata> future = dataLabelingServiceClient.exportDataOperationCallable().futureCall(request);
// Do something
ExportDataOperationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> exportDataCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String annotatedDataset = "";
OutputConfig outputConfig = OutputConfig.newBuilder().build();
ExportDataRequest request = ExportDataRequest.newBuilder()
.setName(formattedName)
.setAnnotatedDataset(annotatedDataset)
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.exportDataCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final DataItem getDataItem(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
DataItem response = dataLabelingServiceClient.getDataItem(formattedName);
}
name
- Required. The name of the data item to get, format:
projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataItem getDataItem(GetDataItemRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
GetDataItemRequest request = GetDataItemRequest.newBuilder()
.setName(formattedName)
.build();
DataItem response = dataLabelingServiceClient.getDataItem(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataItemRequest,DataItem> getDataItemCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatDataItemName("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
GetDataItemRequest request = GetDataItemRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<DataItem> future = dataLabelingServiceClient.getDataItemCallable().futureCall(request);
// Do something
DataItem response = future.get();
}
public final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String filter = "";
for (DataItem element : dataLabelingServiceClient.listDataItems(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the dataset to list data items, format:
projects/{project_id}/datasets/{dataset_id}filter
- Optional. Filter is not supported at this moment.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(ListDataItemsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (DataItem element : dataLabelingServiceClient.listDataItems(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,DataLabelingServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListDataItemsPagedResponse> future = dataLabelingServiceClient.listDataItemsPagedCallable().futureCall(request);
// Do something
for (DataItem element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> listDataItemsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListDataItemsRequest request = ListDataItemsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListDataItemsResponse response = dataLabelingServiceClient.listDataItemsCallable().call(request);
for (DataItem element : response.getDataItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final AnnotatedDataset getAnnotatedDataset(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(formattedName);
}
name
- Required. Name of the annotated dataset to get, format:
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder()
.setName(formattedName)
.build();
AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAnnotatedDatasetRequest,AnnotatedDataset> getAnnotatedDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<AnnotatedDataset> future = dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
String filter = "";
for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the dataset to list annotated datasets, format:
projects/{project_id}/datasets/{dataset_id}filter
- Optional. Filter is not supported at this moment.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(ListAnnotatedDatasetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse> listAnnotatedDatasetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListAnnotatedDatasetsPagedResponse> future = dataLabelingServiceClient.listAnnotatedDatasetsPagedCallable().futureCall(request);
// Do something
for (AnnotatedDataset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,ListAnnotatedDatasetsResponse> listAnnotatedDatasetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListAnnotatedDatasetsResponse response = dataLabelingServiceClient.listAnnotatedDatasetsCallable().call(request);
for (AnnotatedDataset element : response.getAnnotatedDatasetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelImageAsync(String parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the dataset to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of image labeling task.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelImageAsync(LabelImageRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<LabelImageRequest,AnnotatedDataset,LabelOperationMetadata> labelImageOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelImageOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<LabelImageRequest,com.google.longrunning.Operation> labelImageCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelImageRequest.Feature feature = LabelImageRequest.Feature.FEATURE_UNSPECIFIED;
LabelImageRequest request = LabelImageRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelImageCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelVideoAsync(String parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the dataset to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of video labeling task.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelVideoAsync(LabelVideoRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<LabelVideoRequest,AnnotatedDataset,LabelOperationMetadata> labelVideoOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelVideoOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<LabelVideoRequest,com.google.longrunning.Operation> labelVideoCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.FEATURE_UNSPECIFIED;
LabelVideoRequest request = LabelVideoRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelVideoCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelTextAsync(String parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(formattedParent, basicConfig, feature).get();
}
parent
- Required. Name of the data set to request labeling task, format:
projects/{project_id}/datasets/{dataset_id}basicConfig
- Required. Basic human annotation config.feature
- Required. The type of text labeling task.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelTextAsync(LabelTextRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<LabelTextRequest,AnnotatedDataset,LabelOperationMetadata> labelTextOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelTextOperationCallable().futureCall(request);
// Do something
AnnotatedDataset response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<LabelTextRequest,com.google.longrunning.Operation> labelTextCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatDatasetName("[PROJECT]", "[DATASET]");
HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
LabelTextRequest.Feature feature = LabelTextRequest.Feature.FEATURE_UNSPECIFIED;
LabelTextRequest request = LabelTextRequest.newBuilder()
.setParent(formattedParent)
.setBasicConfig(basicConfig)
.setFeature(feature)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.labelTextCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final Example getExample(String name, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
String filter = "";
Example response = dataLabelingServiceClient.getExample(formattedName, filter);
}
name
- Required. Name of example, format:
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
{annotated_dataset_id}/examples/{example_id}filter
- Optional. An expression for filtering Examples. Filter by
annotation_spec.display_name is supported. Format "annotation_spec.display_name =
{display_name}"com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Example getExample(GetExampleRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
GetExampleRequest request = GetExampleRequest.newBuilder()
.setName(formattedName)
.build();
Example response = dataLabelingServiceClient.getExample(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetExampleRequest,Example> getExampleCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
GetExampleRequest request = GetExampleRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Example> future = dataLabelingServiceClient.getExampleCallable().futureCall(request);
// Do something
Example response = future.get();
}
public final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
String filter = "";
for (Example element : dataLabelingServiceClient.listExamples(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Example resource parent.filter
- Optional. An expression for filtering Examples. For annotated datasets that have
annotation spec set, filter by annotation_spec.display_name is supported. Format
"annotation_spec.display_name = {display_name}"com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(ListExamplesRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Example element : dataLabelingServiceClient.listExamples(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,DataLabelingServiceClient.ListExamplesPagedResponse> listExamplesPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListExamplesPagedResponse> future = dataLabelingServiceClient.listExamplesPagedCallable().futureCall(request);
// Do something
for (Example element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,ListExamplesResponse> listExamplesCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatAnnotatedDatasetName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
ListExamplesRequest request = ListExamplesRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListExamplesResponse response = dataLabelingServiceClient.listExamplesCallable().call(request);
for (Example element : response.getExamplesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final AnnotationSpecSet createAnnotationSpecSet(String parent, AnnotationSpecSet annotationSpecSet)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(formattedParent, annotationSpecSet);
}
parent
- Required. AnnotationSpecSet resource parent, format: projects/{project_id}annotationSpecSet
- Required. Annotation spec set to create. Annotation specs must be
included. Only one annotation spec will be accepted for annotation specs with same
display_name.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder()
.setParent(formattedParent)
.setAnnotationSpecSet(annotationSpecSet)
.build();
AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateAnnotationSpecSetRequest,AnnotationSpecSet> createAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder()
.setParent(formattedParent)
.setAnnotationSpecSet(annotationSpecSet)
.build();
ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request);
// Do something
AnnotationSpecSet response = future.get();
}
public final AnnotationSpecSet getAnnotationSpecSet(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(formattedName);
}
name
- Required. AnnotationSpecSet resource name, format:
projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecSetRequest,AnnotationSpecSet> getAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request);
// Do something
AnnotationSpecSet response = future.get();
}
public final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(ListAnnotationSpecSetsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse> listAnnotationSpecSetsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListAnnotationSpecSetsPagedResponse> future = dataLabelingServiceClient.listAnnotationSpecSetsPagedCallable().futureCall(request);
// Do something
for (AnnotationSpecSet element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,ListAnnotationSpecSetsResponse> listAnnotationSpecSetsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListAnnotationSpecSetsResponse response = dataLabelingServiceClient.listAnnotationSpecSetsCallable().call(request);
for (AnnotationSpecSet element : response.getAnnotationSpecSetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteAnnotationSpecSet(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
dataLabelingServiceClient.deleteAnnotationSpecSet(formattedName);
}
name
- Required. AnnotationSpec resource name, format:
`projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteAnnotationSpecSet(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteAnnotationSpecSetRequest,Empty> deleteAnnotationSpecSetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatAnnotationSpecSetName("[PROJECT]", "[ANNOTATION_SPEC_SET]");
DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(String parent, Instruction instruction)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
Instruction response = dataLabelingServiceClient.createInstructionAsync(formattedParent, instruction).get();
}
parent
- Required. Instruction resource parent, format: projects/{project_id}instruction
- Required. Instruction of how to perform the labeling task.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(CreateInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
Instruction response = dataLabelingServiceClient.createInstructionAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<CreateInstructionRequest,Instruction,CreateInstructionMetadata> createInstructionOperationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
OperationFuture<Instruction, CreateInstructionMetadata> future = dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request);
// Do something
Instruction response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateInstructionRequest,com.google.longrunning.Operation> createInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
Instruction instruction = Instruction.newBuilder().build();
CreateInstructionRequest request = CreateInstructionRequest.newBuilder()
.setParent(formattedParent)
.setInstruction(instruction)
.build();
ApiFuture<Operation> future = dataLabelingServiceClient.createInstructionCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final Instruction getInstruction(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
Instruction response = dataLabelingServiceClient.getInstruction(formattedName);
}
name
- Required. Instruction resource name, format:
projects/{project_id}/instructions/{instruction_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Instruction getInstruction(GetInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
GetInstructionRequest request = GetInstructionRequest.newBuilder()
.setName(formattedName)
.build();
Instruction response = dataLabelingServiceClient.getInstruction(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetInstructionRequest,Instruction> getInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
GetInstructionRequest request = GetInstructionRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Instruction> future = dataLabelingServiceClient.getInstructionCallable().futureCall(request);
// Do something
Instruction response = future.get();
}
public final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Instruction element : dataLabelingServiceClient.listInstructions(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Instruction resource parent, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(ListInstructionsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (Instruction element : dataLabelingServiceClient.listInstructions(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,DataLabelingServiceClient.ListInstructionsPagedResponse> listInstructionsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListInstructionsPagedResponse> future = dataLabelingServiceClient.listInstructionsPagedCallable().futureCall(request);
// Do something
for (Instruction element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,ListInstructionsResponse> listInstructionsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
ListInstructionsRequest request = ListInstructionsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListInstructionsResponse response = dataLabelingServiceClient.listInstructionsCallable().call(request);
for (Instruction element : response.getInstructionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteInstruction(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
dataLabelingServiceClient.deleteInstruction(formattedName);
}
name
- Required. Instruction resource name, format:
projects/{project_id}/instructions/{instruction_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteInstruction(DeleteInstructionRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteInstruction(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteInstructionRequest,Empty> deleteInstructionCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatInstructionName("[PROJECT]", "[INSTRUCTION]");
DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteInstructionCallable().futureCall(request);
// Do something
future.get();
}
public final Evaluation getEvaluation(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
Evaluation response = dataLabelingServiceClient.getEvaluation(formattedName);
}
name
- Required. Name of the evaluation. Format:
'projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}'com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Evaluation getEvaluation(GetEvaluationRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
GetEvaluationRequest request = GetEvaluationRequest.newBuilder()
.setName(formattedName)
.build();
Evaluation response = dataLabelingServiceClient.getEvaluation(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation> getEvaluationCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
GetEvaluationRequest request = GetEvaluationRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Evaluation> future = dataLabelingServiceClient.getEvaluationCallable().futureCall(request);
// Do something
Evaluation response = future.get();
}
public final DataLabelingServiceClient.SearchEvaluationsPagedResponse searchEvaluations(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Evaluation element : dataLabelingServiceClient.searchEvaluations(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Evaluation search parent. Format: projects/{project_id}filter
- Optional. Support filtering by model id, job state, start and end time. Format:
"evaluation_job.evaluation_job_id = {evaluation_job_id} AND
evaluation_job.evaluation_job_run_time_start = {timestamp} AND
evaluation_job.evaluation_job_run_time_end = {timestamp} AND annotation_spec.display_name =
{display_name}"com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
for (Evaluation element : dataLabelingServiceClient.searchEvaluations(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,DataLabelingServiceClient.SearchEvaluationsPagedResponse> searchEvaluationsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
ApiFuture<SearchEvaluationsPagedResponse> future = dataLabelingServiceClient.searchEvaluationsPagedCallable().futureCall(request);
// Do something
for (Evaluation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,SearchEvaluationsResponse> searchEvaluationsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
while (true) {
SearchEvaluationsResponse response = dataLabelingServiceClient.searchEvaluationsCallable().call(request);
for (Evaluation element : response.getEvaluationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DataLabelingServiceClient.SearchExampleComparisonsPagedResponse searchExampleComparisons(String parent)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
for (SearchExampleComparisonsResponse.ExampleComparison element : dataLabelingServiceClient.searchExampleComparisons(formattedParent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Name of the Evaluation resource to search example comparison from.
Format: projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.SearchExampleComparisonsPagedResponse searchExampleComparisons(SearchExampleComparisonsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (SearchExampleComparisonsResponse.ExampleComparison element : dataLabelingServiceClient.searchExampleComparisons(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,DataLabelingServiceClient.SearchExampleComparisonsPagedResponse> searchExampleComparisonsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<SearchExampleComparisonsPagedResponse> future = dataLabelingServiceClient.searchExampleComparisonsPagedCallable().futureCall(request);
// Do something
for (SearchExampleComparisonsResponse.ExampleComparison element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,SearchExampleComparisonsResponse> searchExampleComparisonsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatEvaluationName("[PROJECT]", "[DATASET]", "[EVALUATION]");
SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
SearchExampleComparisonsResponse response = dataLabelingServiceClient.searchExampleComparisonsCallable().call(request);
for (SearchExampleComparisonsResponse.ExampleComparison element : response.getExampleComparisonsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final EvaluationJob createEvaluationJob(String parent, EvaluationJob job)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
EvaluationJob job = EvaluationJob.newBuilder().build();
EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(formattedParent, job);
}
parent
- Required. Evaluation job resource parent, format: projects/{project_id}.job
- Required. The evaluation job to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
EvaluationJob job = EvaluationJob.newBuilder().build();
CreateEvaluationJobRequest request = CreateEvaluationJobRequest.newBuilder()
.setParent(formattedParent)
.setJob(job)
.build();
EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEvaluationJobRequest,EvaluationJob> createEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
EvaluationJob job = EvaluationJob.newBuilder().build();
CreateEvaluationJobRequest request = CreateEvaluationJobRequest.newBuilder()
.setParent(formattedParent)
.setJob(job)
.build();
ApiFuture<EvaluationJob> future = dataLabelingServiceClient.createEvaluationJobCallable().futureCall(request);
// Do something
EvaluationJob response = future.get();
}
public final EvaluationJob updateEvaluationJob(EvaluationJob evaluationJob, FieldMask updateMask)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
EvaluationJob evaluationJob = EvaluationJob.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(evaluationJob, updateMask);
}
evaluationJob
- Required. Evaluation job that is going to be updated.updateMask
- Optional. Mask for which field in evaluation_job should be updated.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EvaluationJob updateEvaluationJob(UpdateEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
EvaluationJob evaluationJob = EvaluationJob.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateEvaluationJobRequest request = UpdateEvaluationJobRequest.newBuilder()
.setEvaluationJob(evaluationJob)
.setUpdateMask(updateMask)
.build();
EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateEvaluationJobRequest,EvaluationJob> updateEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
EvaluationJob evaluationJob = EvaluationJob.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateEvaluationJobRequest request = UpdateEvaluationJobRequest.newBuilder()
.setEvaluationJob(evaluationJob)
.setUpdateMask(updateMask)
.build();
ApiFuture<EvaluationJob> future = dataLabelingServiceClient.updateEvaluationJobCallable().futureCall(request);
// Do something
EvaluationJob response = future.get();
}
public final EvaluationJob getEvaluationJob(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(formattedName);
}
name
- Required. Name of the evaluation job. Format:
'projects/{project_id}/evaluationJobs/{evaluation_job_id}'com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EvaluationJob getEvaluationJob(GetEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
GetEvaluationJobRequest request = GetEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEvaluationJobRequest,EvaluationJob> getEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
GetEvaluationJobRequest request = GetEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<EvaluationJob> future = dataLabelingServiceClient.getEvaluationJobCallable().futureCall(request);
// Do something
EvaluationJob response = future.get();
}
public final void pauseEvaluationJob(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
dataLabelingServiceClient.pauseEvaluationJob(formattedName);
}
name
- Required. Name of the evaluation job that is going to be paused. Format:
'projects/{project_id}/evaluationJobs/{evaluation_job_id}'com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void pauseEvaluationJob(PauseEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
PauseEvaluationJobRequest request = PauseEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.pauseEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<PauseEvaluationJobRequest,Empty> pauseEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
PauseEvaluationJobRequest request = PauseEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.pauseEvaluationJobCallable().futureCall(request);
// Do something
future.get();
}
public final void resumeEvaluationJob(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
dataLabelingServiceClient.resumeEvaluationJob(formattedName);
}
name
- Required. Name of the evaluation job that is going to be resumed. Format:
'projects/{project_id}/evaluationJobs/{evaluation_job_id}'com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void resumeEvaluationJob(ResumeEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
ResumeEvaluationJobRequest request = ResumeEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.resumeEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ResumeEvaluationJobRequest,Empty> resumeEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
ResumeEvaluationJobRequest request = ResumeEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.resumeEvaluationJobCallable().futureCall(request);
// Do something
future.get();
}
public final void deleteEvaluationJob(String name)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
dataLabelingServiceClient.deleteEvaluationJob(formattedName);
}
name
- Required. Name of the evaluation job that is going to be deleted. Format:
'projects/{project_id}/evaluationJobs/{evaluation_job_id}'com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void deleteEvaluationJob(DeleteEvaluationJobRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
DeleteEvaluationJobRequest request = DeleteEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
dataLabelingServiceClient.deleteEvaluationJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteEvaluationJobRequest,Empty> deleteEvaluationJobCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatEvaluationJobName("[PROJECT]", "[EVALUATION_JOB]");
DeleteEvaluationJobRequest request = DeleteEvaluationJobRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteEvaluationJobCallable().futureCall(request);
// Do something
future.get();
}
public final DataLabelingServiceClient.ListEvaluationJobsPagedResponse listEvaluationJobs(String parent, String filter)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (EvaluationJob element : dataLabelingServiceClient.listEvaluationJobs(formattedParent, filter).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. Evaluation resource parent. Format: "projects/{project_id}"filter
- Optional. Only support filter by model id and job state. Format:
"evaluation_job.model_id = {model_id} AND evaluation_job.state = {EvaluationJob::State}"com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingServiceClient.ListEvaluationJobsPagedResponse listEvaluationJobs(ListEvaluationJobsRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
for (EvaluationJob element : dataLabelingServiceClient.listEvaluationJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,DataLabelingServiceClient.ListEvaluationJobsPagedResponse> listEvaluationJobsPagedCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
ApiFuture<ListEvaluationJobsPagedResponse> future = dataLabelingServiceClient.listEvaluationJobsPagedCallable().futureCall(request);
// Do something
for (EvaluationJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,ListEvaluationJobsResponse> listEvaluationJobsCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder()
.setParent(formattedParent)
.setFilter(filter)
.build();
while (true) {
ListEvaluationJobsResponse response = dataLabelingServiceClient.listEvaluationJobsCallable().call(request);
for (EvaluationJob element : response.getEvaluationJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder().build();
dataLabelingServiceClient.deleteAnnotatedDataset(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteAnnotatedDatasetRequest,Empty> deleteAnnotatedDatasetCallable()
Sample code:
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder().build();
ApiFuture<Void> future = dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request);
// Do something
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.