Class DataLabelingServiceClient
- java.lang.Object
-
- com.google.cloud.datalabeling.v1beta1.DataLabelingServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class DataLabelingServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service for the AI Platform Data Labeling API.This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); }
Note: close() needs to be called on the DataLabelingServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DataLabelingServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library DataLabelingServiceSettings dataLabelingServiceSettings = DataLabelingServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create(dataLabelingServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library DataLabelingServiceSettings dataLabelingServiceSettings = DataLabelingServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create(dataLabelingServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
DataLabelingServiceClient(DataLabelingServiceSettings settings)
Constructs an instance of DataLabelingServiceClient, using the given settings.protected
DataLabelingServiceClient(DataLabelingServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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(ProjectName parent, AnnotationSpecSet annotationSpecSet)
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(ProjectName parent, Dataset dataset)
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(ProjectName parent, EvaluationJob job)
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(ProjectName parent, Instruction instruction)
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,com.google.protobuf.Empty>
deleteAnnotatedDatasetCallable()
Deletes an annotated dataset by resource name.void
deleteAnnotationSpecSet(AnnotationSpecSetName name)
Deletes an annotation spec set 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,com.google.protobuf.Empty>
deleteAnnotationSpecSetCallable()
Deletes an annotation spec set by resource name.void
deleteDataset(DatasetName name)
Deletes a dataset 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,com.google.protobuf.Empty>
deleteDatasetCallable()
Deletes a dataset by resource name.void
deleteEvaluationJob(DeleteEvaluationJobRequest request)
Stops and deletes an evaluation job.void
deleteEvaluationJob(EvaluationJobName name)
Stops and deletes an evaluation job.void
deleteEvaluationJob(String name)
Stops and deletes an evaluation job.com.google.api.gax.rpc.UnaryCallable<DeleteEvaluationJobRequest,com.google.protobuf.Empty>
deleteEvaluationJobCallable()
Stops and deletes an evaluation job.void
deleteInstruction(DeleteInstructionRequest request)
Deletes an instruction object by resource name.void
deleteInstruction(InstructionName name)
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,com.google.protobuf.Empty>
deleteInstructionCallable()
Deletes an instruction object by resource name.com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>
exportDataAsync(DatasetName name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata>
exportDataAsync(DatasetName name, String annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.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, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)
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.AnnotatedDataset
getAnnotatedDataset(AnnotatedDatasetName name)
Gets an annotated dataset by resource name.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(AnnotationSpecSetName name)
Gets an annotation spec set 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(DataItemName name)
Gets a data item in a dataset 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(DatasetName name)
Gets 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(EvaluationName name)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Evaluation
getEvaluation(GetEvaluationRequest request)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Evaluation
getEvaluation(String name)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation>
getEvaluationCallable()
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).EvaluationJob
getEvaluationJob(EvaluationJobName name)
Gets an evaluation job 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(ExampleName name, String filter)
Gets an example by resource name, including both data and annotation.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(InstructionName name)
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(DatasetName name, InputConfig inputConfig)
Imports data into dataset based on source locations defined in request.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(DatasetName parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)
Starts a labeling task for image.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(DatasetName parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)
Starts a labeling task for text.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(DatasetName parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)
Starts a labeling task for video.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(DatasetName parent, String filter)
Lists annotated datasets for a dataset.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(ProjectName parent, String filter)
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(DatasetName parent, String filter)
Lists data items in a dataset.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(ProjectName parent, String filter)
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(ProjectName parent, String filter)
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(AnnotatedDatasetName parent, String filter)
Lists examples in an annotated dataset.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(ProjectName parent, String filter)
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.void
pauseEvaluationJob(EvaluationJobName name)
Pauses an evaluation job.void
pauseEvaluationJob(PauseEvaluationJobRequest request)
Pauses an evaluation job.void
pauseEvaluationJob(String name)
Pauses an evaluation job.com.google.api.gax.rpc.UnaryCallable<PauseEvaluationJobRequest,com.google.protobuf.Empty>
pauseEvaluationJobCallable()
Pauses an evaluation job.void
resumeEvaluationJob(EvaluationJobName name)
Resumes a paused 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,com.google.protobuf.Empty>
resumeEvaluationJobCallable()
Resumes a paused evaluation job.DataLabelingServiceClient.SearchEvaluationsPagedResponse
searchEvaluations(EvaluationName parent, String filter)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.DataLabelingServiceClient.SearchEvaluationsPagedResponse
searchEvaluations(SearchEvaluationsRequest request)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.DataLabelingServiceClient.SearchEvaluationsPagedResponse
searchEvaluations(String parent, String filter)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,SearchEvaluationsResponse>
searchEvaluationsCallable()
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,DataLabelingServiceClient.SearchEvaluationsPagedResponse>
searchEvaluationsPagedCallable()
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.DataLabelingServiceClient.SearchExampleComparisonsPagedResponse
searchExampleComparisons(EvaluationName parent)
Searches example comparisons from an evaluation.DataLabelingServiceClient.SearchExampleComparisonsPagedResponse
searchExampleComparisons(SearchExampleComparisonsRequest request)
Searches example comparisons from an evaluation.DataLabelingServiceClient.SearchExampleComparisonsPagedResponse
searchExampleComparisons(String parent)
Searches example comparisons from an evaluation.com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,SearchExampleComparisonsResponse>
searchExampleComparisonsCallable()
Searches example comparisons from an evaluation.com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,DataLabelingServiceClient.SearchExampleComparisonsPagedResponse>
searchExampleComparisonsPagedCallable()
Searches example comparisons from an evaluation.void
shutdown()
void
shutdownNow()
EvaluationJob
updateEvaluationJob(EvaluationJob evaluationJob, com.google.protobuf.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.
-
-
-
Constructor Detail
-
DataLabelingServiceClient
protected DataLabelingServiceClient(DataLabelingServiceSettings settings) throws IOException
Constructs an instance of DataLabelingServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
DataLabelingServiceClient
protected DataLabelingServiceClient(DataLabelingServiceStub stub)
-
-
Method Detail
-
create
public static final DataLabelingServiceClient create() throws IOException
Constructs an instance of DataLabelingServiceClient with default settings.- Throws:
IOException
-
create
public static final DataLabelingServiceClient create(DataLabelingServiceSettings settings) throws IOException
Constructs an instance of DataLabelingServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final DataLabelingServiceClient create(DataLabelingServiceStub stub)
Constructs an instance of DataLabelingServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataLabelingServiceSettings).
-
getSettings
public final DataLabelingServiceSettings getSettings()
-
getStub
public DataLabelingServiceStub getStub()
-
getOperationsClient
public final 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.
-
createDataset
public final Dataset createDataset(ProjectName parent, Dataset dataset)
Creates dataset. If success return a Dataset resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); }
- Parameters:
parent
- Required. Dataset resource parent, format: projects/{project_id}dataset
- Required. The dataset to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDataset
public final Dataset createDataset(String parent, Dataset dataset)
Creates dataset. If success return a Dataset resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); Dataset dataset = Dataset.newBuilder().build(); Dataset response = dataLabelingServiceClient.createDataset(parent, dataset); }
- Parameters:
parent
- Required. Dataset resource parent, format: projects/{project_id}dataset
- Required. The dataset to be created.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDataset
public final Dataset createDataset(CreateDatasetRequest request)
Creates dataset. If success return a Dataset resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); Dataset response = dataLabelingServiceClient.createDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateDatasetRequest,Dataset> createDatasetCallable()
Creates dataset. If success return a Dataset resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); ApiFuture<Dataset> future = dataLabelingServiceClient.createDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); }
-
getDataset
public final Dataset getDataset(DatasetName name)
Gets dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); Dataset response = dataLabelingServiceClient.getDataset(name); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataset
public final Dataset getDataset(String name)
Gets dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); Dataset response = dataLabelingServiceClient.getDataset(name); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataset
public final Dataset getDataset(GetDatasetRequest request)
Gets dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); Dataset response = dataLabelingServiceClient.getDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()
Gets dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); ApiFuture<Dataset> future = dataLabelingServiceClient.getDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); }
-
listDatasets
public final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(ProjectName parent, String filter)
Lists datasets under a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); String filter = "filter-1274492040"; for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Dataset resource parent, format: projects/{project_id}filter
- Optional. Filter on dataset is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasets
public final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(String parent, String filter)
Lists datasets under a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); String filter = "filter-1274492040"; for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Dataset resource parent, format: projects/{project_id}filter
- Optional. Filter on dataset is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasets
public final DataLabelingServiceClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)
Lists datasets under a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Dataset element : dataLabelingServiceClient.listDatasets(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDatasetsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,DataLabelingServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()
Lists datasets under a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Dataset> future = dataLabelingServiceClient.listDatasetsPagedCallable().futureCall(request); // Do something. for (Dataset element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listDatasetsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()
Lists datasets under a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
deleteDataset
public final void deleteDataset(DatasetName name)
Deletes a dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); dataLabelingServiceClient.deleteDataset(name); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDataset
public final void deleteDataset(String name)
Deletes a dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); dataLabelingServiceClient.deleteDataset(name); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDataset
public final void deleteDataset(DeleteDatasetRequest request)
Deletes a dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); dataLabelingServiceClient.deleteDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatasetRequest,com.google.protobuf.Empty> deleteDatasetCallable()
Deletes a dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.deleteDatasetCallable().futureCall(request); // Do something. future.get(); }
-
importDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> importDataAsync(DatasetName name, InputConfig inputConfig)
Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); InputConfig inputConfig = InputConfig.newBuilder().build(); ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(name, inputConfig).get(); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}inputConfig
- Required. Specify the input source of the data.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
importDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> importDataAsync(String name, InputConfig inputConfig)
Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); InputConfig inputConfig = InputConfig.newBuilder().build(); ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(name, inputConfig).get(); }
- Parameters:
name
- Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}inputConfig
- Required. Specify the input source of the data.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
importDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ImportDataOperationResponse,ImportDataOperationMetadata> importDataAsync(ImportDataRequest request)
Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); ImportDataOperationResponse response = dataLabelingServiceClient.importDataAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
importDataOperationCallable
public final com.google.api.gax.rpc.OperationCallable<ImportDataRequest,ImportDataOperationResponse,ImportDataOperationMetadata> importDataOperationCallable()
Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); OperationFuture<ImportDataOperationResponse, ImportDataOperationMetadata> future = dataLabelingServiceClient.importDataOperationCallable().futureCall(request); // Do something. ImportDataOperationResponse response = future.get(); }
-
importDataCallable
public final com.google.api.gax.rpc.UnaryCallable<ImportDataRequest,com.google.longrunning.Operation> importDataCallable()
Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); ApiFuture<Operation> future = dataLabelingServiceClient.importDataCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
exportDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); AnnotatedDatasetName annotatedDataset = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); String filter = "filter-1274492040"; OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportDataOperationResponse response = dataLabelingServiceClient .exportDataAsync(name, annotatedDataset, filter, outputConfig) .get(); }
- Parameters:
name
- 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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
exportDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, String annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); String annotatedDataset = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); String filter = "filter-1274492040"; OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportDataOperationResponse response = dataLabelingServiceClient .exportDataAsync(name, annotatedDataset, filter, outputConfig) .get(); }
- Parameters:
name
- 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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
exportDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(String name, AnnotatedDatasetName annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); AnnotatedDatasetName annotatedDataset = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); String filter = "filter-1274492040"; OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportDataOperationResponse response = dataLabelingServiceClient .exportDataAsync(name, annotatedDataset, filter, outputConfig) .get(); }
- Parameters:
name
- 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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
exportDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(String name, String annotatedDataset, String filter, OutputConfig outputConfig)
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); String annotatedDataset = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); String filter = "filter-1274492040"; OutputConfig outputConfig = OutputConfig.newBuilder().build(); ExportDataOperationResponse response = dataLabelingServiceClient .exportDataAsync(name, annotatedDataset, filter, outputConfig) .get(); }
- Parameters:
name
- 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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
exportDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ExportDataOperationResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request)
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setAnnotatedDataset( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setOutputConfig(OutputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); ExportDataOperationResponse response = dataLabelingServiceClient.exportDataAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
exportDataOperationCallable
public final com.google.api.gax.rpc.OperationCallable<ExportDataRequest,ExportDataOperationResponse,ExportDataOperationMetadata> exportDataOperationCallable()
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setAnnotatedDataset( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setOutputConfig(OutputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); OperationFuture<ExportDataOperationResponse, ExportDataOperationMetadata> future = dataLabelingServiceClient.exportDataOperationCallable().futureCall(request); // Do something. ExportDataOperationResponse response = future.get(); }
-
exportDataCallable
public final com.google.api.gax.rpc.UnaryCallable<ExportDataRequest,com.google.longrunning.Operation> exportDataCallable()
Exports data and annotations from dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setAnnotatedDataset( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setOutputConfig(OutputConfig.newBuilder().build()) .setUserEmailAddress("userEmailAddress-1844787165") .build(); ApiFuture<Operation> future = dataLabelingServiceClient.exportDataCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
getDataItem
public final DataItem getDataItem(DataItemName name)
Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DataItemName name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]"); DataItem response = dataLabelingServiceClient.getDataItem(name); }
- Parameters:
name
- Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataItem
public final DataItem getDataItem(String name)
Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString(); DataItem response = dataLabelingServiceClient.getDataItem(name); }
- Parameters:
name
- Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataItem
public final DataItem getDataItem(GetDataItemRequest request)
Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetDataItemRequest request = GetDataItemRequest.newBuilder() .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString()) .build(); DataItem response = dataLabelingServiceClient.getDataItem(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getDataItemCallable
public final com.google.api.gax.rpc.UnaryCallable<GetDataItemRequest,DataItem> getDataItemCallable()
Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetDataItemRequest request = GetDataItemRequest.newBuilder() .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString()) .build(); ApiFuture<DataItem> future = dataLabelingServiceClient.getDataItemCallable().futureCall(request); // Do something. DataItem response = future.get(); }
-
listDataItems
public final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(DatasetName parent, String filter)
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); String filter = "filter-1274492040"; for (DataItem element : dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDataItems
public final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(String parent, String filter)
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); String filter = "filter-1274492040"; for (DataItem element : dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDataItems
public final DataLabelingServiceClient.ListDataItemsPagedResponse listDataItems(ListDataItemsRequest request)
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDataItemsRequest request = ListDataItemsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (DataItem element : dataLabelingServiceClient.listDataItems(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listDataItemsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,DataLabelingServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDataItemsRequest request = ListDataItemsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<DataItem> future = dataLabelingServiceClient.listDataItemsPagedCallable().futureCall(request); // Do something. for (DataItem element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listDataItemsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> listDataItemsCallable()
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListDataItemsRequest request = ListDataItemsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
getAnnotatedDataset
public final AnnotatedDataset getAnnotatedDataset(AnnotatedDatasetName name)
Gets an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { AnnotatedDatasetName name = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name); }
- Parameters:
name
- Required. Name of the annotated dataset to get, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotatedDataset
public final AnnotatedDataset getAnnotatedDataset(String name)
Gets an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name); }
- Parameters:
name
- Required. Name of the annotated dataset to get, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotatedDataset
public final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest request)
Gets an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder() .setName( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .build(); AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotatedDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<GetAnnotatedDatasetRequest,AnnotatedDataset> getAnnotatedDatasetCallable()
Gets an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetAnnotatedDatasetRequest request = GetAnnotatedDatasetRequest.newBuilder() .setName( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .build(); ApiFuture<AnnotatedDataset> future = dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request); // Do something. AnnotatedDataset response = future.get(); }
-
listAnnotatedDatasets
public final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(DatasetName parent, String filter)
Lists annotated datasets for a dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); String filter = "filter-1274492040"; for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotatedDatasets
public final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(String parent, String filter)
Lists annotated datasets for a dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); String filter = "filter-1274492040"; for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotatedDatasets
public final DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets(ListAnnotatedDatasetsRequest request)
Lists annotated datasets for a dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (AnnotatedDataset element : dataLabelingServiceClient.listAnnotatedDatasets(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotatedDatasetsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,DataLabelingServiceClient.ListAnnotatedDatasetsPagedResponse> listAnnotatedDatasetsPagedCallable()
Lists annotated datasets for a dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<AnnotatedDataset> future = dataLabelingServiceClient.listAnnotatedDatasetsPagedCallable().futureCall(request); // Do something. for (AnnotatedDataset element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listAnnotatedDatasetsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotatedDatasetsRequest,ListAnnotatedDatasetsResponse> listAnnotatedDatasetsCallable()
Lists annotated datasets for a dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotatedDatasetsRequest request = ListAnnotatedDatasetsRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
deleteAnnotatedDataset
public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request)
Deletes an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder() .setName( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .build(); dataLabelingServiceClient.deleteAnnotatedDataset(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAnnotatedDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteAnnotatedDatasetRequest,com.google.protobuf.Empty> deleteAnnotatedDatasetCallable()
Deletes an annotated dataset by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteAnnotatedDatasetRequest request = DeleteAnnotatedDatasetRequest.newBuilder() .setName( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request); // Do something. future.get(); }
-
labelImageAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelImageAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)
Starts a labeling task for image. The type of image labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelImageAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelImageAsync(String parent, HumanAnnotationConfig basicConfig, LabelImageRequest.Feature feature)
Starts a labeling task for image. The type of image labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelImageAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelImageAsync(LabelImageRequest request)
Starts a labeling task for image. The type of image labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelImageRequest request = LabelImageRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelImageOperationCallable
public final com.google.api.gax.rpc.OperationCallable<LabelImageRequest,AnnotatedDataset,LabelOperationMetadata> labelImageOperationCallable()
Starts a labeling task for image. The type of image labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelImageRequest request = LabelImageRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelImageOperationCallable().futureCall(request); // Do something. AnnotatedDataset response = future.get(); }
-
labelImageCallable
public final com.google.api.gax.rpc.UnaryCallable<LabelImageRequest,com.google.longrunning.Operation> labelImageCallable()
Starts a labeling task for image. The type of image labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelImageRequest request = LabelImageRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = dataLabelingServiceClient.labelImageCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
labelVideoAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelVideoAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)
Starts a labeling task for video. The type of video labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelVideoAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelVideoAsync(String parent, HumanAnnotationConfig basicConfig, LabelVideoRequest.Feature feature)
Starts a labeling task for video. The type of video labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelVideoAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelVideoAsync(LabelVideoRequest request)
Starts a labeling task for video. The type of video labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelVideoRequest request = LabelVideoRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelVideoOperationCallable
public final com.google.api.gax.rpc.OperationCallable<LabelVideoRequest,AnnotatedDataset,LabelOperationMetadata> labelVideoOperationCallable()
Starts a labeling task for video. The type of video labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelVideoRequest request = LabelVideoRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelVideoOperationCallable().futureCall(request); // Do something. AnnotatedDataset response = future.get(); }
-
labelVideoCallable
public final com.google.api.gax.rpc.UnaryCallable<LabelVideoRequest,com.google.longrunning.Operation> labelVideoCallable()
Starts a labeling task for video. The type of video labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelVideoRequest request = LabelVideoRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = dataLabelingServiceClient.labelVideoCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
labelTextAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelTextAsync(DatasetName parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)
Starts a labeling task for text. The type of text labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]"); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelTextAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelTextAsync(String parent, HumanAnnotationConfig basicConfig, LabelTextRequest.Feature feature)
Starts a labeling task for text. The type of text labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString(); HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build(); LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0); AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelTextAsync
public final com.google.api.gax.longrunning.OperationFuture<AnnotatedDataset,LabelOperationMetadata> labelTextAsync(LabelTextRequest request)
Starts a labeling task for text. The type of text labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelTextRequest request = LabelTextRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
labelTextOperationCallable
public final com.google.api.gax.rpc.OperationCallable<LabelTextRequest,AnnotatedDataset,LabelOperationMetadata> labelTextOperationCallable()
Starts a labeling task for text. The type of text labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelTextRequest request = LabelTextRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); OperationFuture<AnnotatedDataset, LabelOperationMetadata> future = dataLabelingServiceClient.labelTextOperationCallable().futureCall(request); // Do something. AnnotatedDataset response = future.get(); }
-
labelTextCallable
public final com.google.api.gax.rpc.UnaryCallable<LabelTextRequest,com.google.longrunning.Operation> labelTextCallable()
Starts a labeling task for text. The type of text labeling task is configured by feature in the request.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { LabelTextRequest request = LabelTextRequest.newBuilder() .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString()) .setBasicConfig(HumanAnnotationConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = dataLabelingServiceClient.labelTextCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
getExample
public final Example getExample(ExampleName name, String filter)
Gets an example by resource name, including both data and annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ExampleName name = ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]"); String filter = "filter-1274492040"; Example response = dataLabelingServiceClient.getExample(name, filter); }
- Parameters:
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}"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getExample
public final Example getExample(String name, String filter)
Gets an example by resource name, including both data and annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]").toString(); String filter = "filter-1274492040"; Example response = dataLabelingServiceClient.getExample(name, filter); }
- Parameters:
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}"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getExample
public final Example getExample(GetExampleRequest request)
Gets an example by resource name, including both data and annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetExampleRequest request = GetExampleRequest.newBuilder() .setName( ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]") .toString()) .setFilter("filter-1274492040") .build(); Example response = dataLabelingServiceClient.getExample(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getExampleCallable
public final com.google.api.gax.rpc.UnaryCallable<GetExampleRequest,Example> getExampleCallable()
Gets an example by resource name, including both data and annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetExampleRequest request = GetExampleRequest.newBuilder() .setName( ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]") .toString()) .setFilter("filter-1274492040") .build(); ApiFuture<Example> future = dataLabelingServiceClient.getExampleCallable().futureCall(request); // Do something. Example response = future.get(); }
-
listExamples
public final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(AnnotatedDatasetName parent, String filter)
Lists examples in an annotated dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { AnnotatedDatasetName parent = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]"); String filter = "filter-1274492040"; for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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}"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listExamples
public final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(String parent, String filter)
Lists examples in an annotated dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString(); String filter = "filter-1274492040"; for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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}"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listExamples
public final DataLabelingServiceClient.ListExamplesPagedResponse listExamples(ListExamplesRequest request)
Lists examples in an annotated dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListExamplesRequest request = ListExamplesRequest.newBuilder() .setParent( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Example element : dataLabelingServiceClient.listExamples(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listExamplesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,DataLabelingServiceClient.ListExamplesPagedResponse> listExamplesPagedCallable()
Lists examples in an annotated dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListExamplesRequest request = ListExamplesRequest.newBuilder() .setParent( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Example> future = dataLabelingServiceClient.listExamplesPagedCallable().futureCall(request); // Do something. for (Example element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listExamplesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListExamplesRequest,ListExamplesResponse> listExamplesCallable()
Lists examples in an annotated dataset. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListExamplesRequest request = ListExamplesRequest.newBuilder() .setParent( AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]") .toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
createAnnotationSpecSet
public final AnnotationSpecSet createAnnotationSpecSet(ProjectName parent, AnnotationSpecSet annotationSpecSet)
Creates an annotation spec set by providing a set of labels.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build(); AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createAnnotationSpecSet
public final AnnotationSpecSet createAnnotationSpecSet(String parent, AnnotationSpecSet annotationSpecSet)
Creates an annotation spec set by providing a set of labels.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build(); AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createAnnotationSpecSet
public final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRequest request)
Creates an annotation spec set by providing a set of labels.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build()) .build(); AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createAnnotationSpecSetCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateAnnotationSpecSetRequest,AnnotationSpecSet> createAnnotationSpecSetCallable()
Creates an annotation spec set by providing a set of labels.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateAnnotationSpecSetRequest request = CreateAnnotationSpecSetRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build()) .build(); ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request); // Do something. AnnotationSpecSet response = future.get(); }
-
getAnnotationSpecSet
public final AnnotationSpecSet getAnnotationSpecSet(AnnotationSpecSetName name)
Gets an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]"); AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name); }
- Parameters:
name
- Required. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotationSpecSet
public final AnnotationSpecSet getAnnotationSpecSet(String name)
Gets an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString(); AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name); }
- Parameters:
name
- Required. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotationSpecSet
public final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest request)
Gets an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder() .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) .build(); AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getAnnotationSpecSetCallable
public final com.google.api.gax.rpc.UnaryCallable<GetAnnotationSpecSetRequest,AnnotationSpecSet> getAnnotationSpecSetCallable()
Gets an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetAnnotationSpecSetRequest request = GetAnnotationSpecSetRequest.newBuilder() .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) .build(); ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request); // Do something. AnnotationSpecSet response = future.get(); }
-
listAnnotationSpecSets
public final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(ProjectName parent, String filter)
Lists annotation spec sets for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); String filter = "filter-1274492040"; for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotationSpecSets
public final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(String parent, String filter)
Lists annotation spec sets for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); String filter = "filter-1274492040"; for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotationSpecSets
public final DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets(ListAnnotationSpecSetsRequest request)
Lists annotation spec sets for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (AnnotationSpecSet element : dataLabelingServiceClient.listAnnotationSpecSets(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listAnnotationSpecSetsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,DataLabelingServiceClient.ListAnnotationSpecSetsPagedResponse> listAnnotationSpecSetsPagedCallable()
Lists annotation spec sets for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<AnnotationSpecSet> future = dataLabelingServiceClient.listAnnotationSpecSetsPagedCallable().futureCall(request); // Do something. for (AnnotationSpecSet element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listAnnotationSpecSetsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListAnnotationSpecSetsRequest,ListAnnotationSpecSetsResponse> listAnnotationSpecSetsCallable()
Lists annotation spec sets for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListAnnotationSpecSetsRequest request = ListAnnotationSpecSetsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
deleteAnnotationSpecSet
public final void deleteAnnotationSpecSet(AnnotationSpecSetName name)
Deletes an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]"); dataLabelingServiceClient.deleteAnnotationSpecSet(name); }
- Parameters:
name
- Required. AnnotationSpec resource name, format: `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAnnotationSpecSet
public final void deleteAnnotationSpecSet(String name)
Deletes an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString(); dataLabelingServiceClient.deleteAnnotationSpecSet(name); }
- Parameters:
name
- Required. AnnotationSpec resource name, format: `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAnnotationSpecSet
public final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request)
Deletes an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder() .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) .build(); dataLabelingServiceClient.deleteAnnotationSpecSet(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAnnotationSpecSetCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteAnnotationSpecSetRequest,com.google.protobuf.Empty> deleteAnnotationSpecSetCallable()
Deletes an annotation spec set by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteAnnotationSpecSetRequest request = DeleteAnnotationSpecSetRequest.newBuilder() .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request); // Do something. future.get(); }
-
createInstructionAsync
public final com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(ProjectName parent, Instruction instruction)
Creates an instruction for how data should be labeled.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); Instruction instruction = Instruction.newBuilder().build(); Instruction response = dataLabelingServiceClient.createInstructionAsync(parent, instruction).get(); }
- Parameters:
parent
- Required. Instruction resource parent, format: projects/{project_id}instruction
- Required. Instruction of how to perform the labeling task.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createInstructionAsync
public final com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(String parent, Instruction instruction)
Creates an instruction for how data should be labeled.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); Instruction instruction = Instruction.newBuilder().build(); Instruction response = dataLabelingServiceClient.createInstructionAsync(parent, instruction).get(); }
- Parameters:
parent
- Required. Instruction resource parent, format: projects/{project_id}instruction
- Required. Instruction of how to perform the labeling task.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createInstructionAsync
public final com.google.api.gax.longrunning.OperationFuture<Instruction,CreateInstructionMetadata> createInstructionAsync(CreateInstructionRequest request)
Creates an instruction for how data should be labeled.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateInstructionRequest request = CreateInstructionRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setInstruction(Instruction.newBuilder().build()) .build(); Instruction response = dataLabelingServiceClient.createInstructionAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createInstructionOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateInstructionRequest,Instruction,CreateInstructionMetadata> createInstructionOperationCallable()
Creates an instruction for how data should be labeled.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateInstructionRequest request = CreateInstructionRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setInstruction(Instruction.newBuilder().build()) .build(); OperationFuture<Instruction, CreateInstructionMetadata> future = dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request); // Do something. Instruction response = future.get(); }
-
createInstructionCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateInstructionRequest,com.google.longrunning.Operation> createInstructionCallable()
Creates an instruction for how data should be labeled.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateInstructionRequest request = CreateInstructionRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setInstruction(Instruction.newBuilder().build()) .build(); ApiFuture<Operation> future = dataLabelingServiceClient.createInstructionCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
getInstruction
public final Instruction getInstruction(InstructionName name)
Gets an instruction by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]"); Instruction response = dataLabelingServiceClient.getInstruction(name); }
- Parameters:
name
- Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstruction
public final Instruction getInstruction(String name)
Gets an instruction by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString(); Instruction response = dataLabelingServiceClient.getInstruction(name); }
- Parameters:
name
- Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstruction
public final Instruction getInstruction(GetInstructionRequest request)
Gets an instruction by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetInstructionRequest request = GetInstructionRequest.newBuilder() .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) .build(); Instruction response = dataLabelingServiceClient.getInstruction(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstructionCallable
public final com.google.api.gax.rpc.UnaryCallable<GetInstructionRequest,Instruction> getInstructionCallable()
Gets an instruction by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetInstructionRequest request = GetInstructionRequest.newBuilder() .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) .build(); ApiFuture<Instruction> future = dataLabelingServiceClient.getInstructionCallable().futureCall(request); // Do something. Instruction response = future.get(); }
-
listInstructions
public final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(ProjectName parent, String filter)
Lists instructions for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); String filter = "filter-1274492040"; for (Instruction element : dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Instruction resource parent, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstructions
public final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(String parent, String filter)
Lists instructions for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); String filter = "filter-1274492040"; for (Instruction element : dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Instruction resource parent, format: projects/{project_id}filter
- Optional. Filter is not supported at this moment.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstructions
public final DataLabelingServiceClient.ListInstructionsPagedResponse listInstructions(ListInstructionsRequest request)
Lists instructions for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListInstructionsRequest request = ListInstructionsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Instruction element : dataLabelingServiceClient.listInstructions(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstructionsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,DataLabelingServiceClient.ListInstructionsPagedResponse> listInstructionsPagedCallable()
Lists instructions for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListInstructionsRequest request = ListInstructionsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Instruction> future = dataLabelingServiceClient.listInstructionsPagedCallable().futureCall(request); // Do something. for (Instruction element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listInstructionsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListInstructionsRequest,ListInstructionsResponse> listInstructionsCallable()
Lists instructions for a project. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListInstructionsRequest request = ListInstructionsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
deleteInstruction
public final void deleteInstruction(InstructionName name)
Deletes an instruction object by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]"); dataLabelingServiceClient.deleteInstruction(name); }
- Parameters:
name
- Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteInstruction
public final void deleteInstruction(String name)
Deletes an instruction object by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString(); dataLabelingServiceClient.deleteInstruction(name); }
- Parameters:
name
- Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteInstruction
public final void deleteInstruction(DeleteInstructionRequest request)
Deletes an instruction object by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder() .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) .build(); dataLabelingServiceClient.deleteInstruction(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteInstructionCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteInstructionRequest,com.google.protobuf.Empty> deleteInstructionCallable()
Deletes an instruction object by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteInstructionRequest request = DeleteInstructionRequest.newBuilder() .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.deleteInstructionCallable().futureCall(request); // Do something. future.get(); }
-
getEvaluation
public final Evaluation getEvaluation(EvaluationName name)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationName name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); Evaluation response = dataLabelingServiceClient.getEvaluation(name); }
- Parameters:
name
- Required. Name of the evaluation. Format:"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>'
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluation
public final Evaluation getEvaluation(String name)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); Evaluation response = dataLabelingServiceClient.getEvaluation(name); }
- Parameters:
name
- Required. Name of the evaluation. Format:"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>'
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluation
public final Evaluation getEvaluation(GetEvaluationRequest request)
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetEvaluationRequest request = GetEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .build(); Evaluation response = dataLabelingServiceClient.getEvaluation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluationCallable
public final com.google.api.gax.rpc.UnaryCallable<GetEvaluationRequest,Evaluation> getEvaluationCallable()
Gets an evaluation by resource name (to search, use [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetEvaluationRequest request = GetEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .build(); ApiFuture<Evaluation> future = dataLabelingServiceClient.getEvaluationCallable().futureCall(request); // Do something. Evaluation response = future.get(); }
-
searchEvaluations
public final DataLabelingServiceClient.SearchEvaluationsPagedResponse searchEvaluations(EvaluationName parent, String filter)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); String filter = "filter-1274492040"; for (Evaluation element : dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Evaluation search parent (project ID). Format: "projects/<var>{project_id}</var>"filter
- Optional. To search evaluations, you can filter by the following:- evaluation<span>_</span>job.evaluation_job_id (the last part of [EvaluationJob.name][google.cloud.datalabeling.v1beta1.EvaluationJob.name])
- evaluation<span>_</span>job.model_id (the <var>{model_name}</var> portion of [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version])
- evaluation<span>_</span>job.evaluation_job_run_time_start (Minimum threshold for the [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created the evaluation)
- evaluation<span>_</span>job.evaluation_job_run_time_end (Maximum threshold for the [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created the evaluation)
- evaluation<span>_</span>job.job_state ([EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state])
- annotation<span>_</span>spec.display_name (the Evaluation contains a metric for the annotation spec with this [displayName][google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name])
To filter by multiple critiera, use the `AND` operator or the `OR` operator. The following examples shows a string that filters by several critiera:
"evaluation<span>_</span>job.evaluation_job_id = <var>{evaluation_job_id}</var> AND evaluation<span>_</span>job.model_id = <var>{model_name}</var> AND evaluation<span>_</span>job.evaluation_job_run_time_start = <var>{timestamp_1}</var> AND evaluation<span>_</span>job.evaluation_job_run_time_end = <var>{timestamp_2}</var> AND annotation<span>_</span>spec.display_name = <var>{display_name}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchEvaluations
public final DataLabelingServiceClient.SearchEvaluationsPagedResponse searchEvaluations(String parent, String filter)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); String filter = "filter-1274492040"; for (Evaluation element : dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Evaluation search parent (project ID). Format: "projects/<var>{project_id}</var>"filter
- Optional. To search evaluations, you can filter by the following:- evaluation<span>_</span>job.evaluation_job_id (the last part of [EvaluationJob.name][google.cloud.datalabeling.v1beta1.EvaluationJob.name])
- evaluation<span>_</span>job.model_id (the <var>{model_name}</var> portion of [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version])
- evaluation<span>_</span>job.evaluation_job_run_time_start (Minimum threshold for the [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created the evaluation)
- evaluation<span>_</span>job.evaluation_job_run_time_end (Maximum threshold for the [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created the evaluation)
- evaluation<span>_</span>job.job_state ([EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state])
- annotation<span>_</span>spec.display_name (the Evaluation contains a metric for the annotation spec with this [displayName][google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name])
To filter by multiple critiera, use the `AND` operator or the `OR` operator. The following examples shows a string that filters by several critiera:
"evaluation<span>_</span>job.evaluation_job_id = <var>{evaluation_job_id}</var> AND evaluation<span>_</span>job.model_id = <var>{model_name}</var> AND evaluation<span>_</span>job.evaluation_job_run_time_start = <var>{timestamp_1}</var> AND evaluation<span>_</span>job.evaluation_job_run_time_end = <var>{timestamp_2}</var> AND annotation<span>_</span>spec.display_name = <var>{display_name}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchEvaluations
public final DataLabelingServiceClient.SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsRequest request)
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Evaluation element : dataLabelingServiceClient.searchEvaluations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchEvaluationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,DataLabelingServiceClient.SearchEvaluationsPagedResponse> searchEvaluationsPagedCallable()
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Evaluation> future = dataLabelingServiceClient.searchEvaluationsPagedCallable().futureCall(request); // Do something. for (Evaluation element : future.get().iterateAll()) { // doThingsWith(element); } }
-
searchEvaluationsCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchEvaluationsRequest,SearchEvaluationsResponse> searchEvaluationsCallable()
Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchEvaluationsRequest request = SearchEvaluationsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
searchExampleComparisons
public final DataLabelingServiceClient.SearchExampleComparisonsPagedResponse searchExampleComparisons(EvaluationName parent)
Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]"); for (SearchExampleComparisonsResponse.ExampleComparison element : dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] resource to search for example comparisons from. Format:"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchExampleComparisons
public final DataLabelingServiceClient.SearchExampleComparisonsPagedResponse searchExampleComparisons(String parent)
Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString(); for (SearchExampleComparisonsResponse.ExampleComparison element : dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] resource to search for example comparisons from. Format:"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchExampleComparisons
public final DataLabelingServiceClient.SearchExampleComparisonsPagedResponse searchExampleComparisons(SearchExampleComparisonsRequest request)
Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SearchExampleComparisonsResponse.ExampleComparison element : dataLabelingServiceClient.searchExampleComparisons(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
searchExampleComparisonsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,DataLabelingServiceClient.SearchExampleComparisonsPagedResponse> searchExampleComparisonsPagedCallable()
Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SearchExampleComparisonsResponse.ExampleComparison> future = dataLabelingServiceClient.searchExampleComparisonsPagedCallable().futureCall(request); // Do something. for (SearchExampleComparisonsResponse.ExampleComparison element : future.get().iterateAll()) { // doThingsWith(element); } }
-
searchExampleComparisonsCallable
public final com.google.api.gax.rpc.UnaryCallable<SearchExampleComparisonsRequest,SearchExampleComparisonsResponse> searchExampleComparisonsCallable()
Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { SearchExampleComparisonsRequest request = SearchExampleComparisonsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
createEvaluationJob
public final EvaluationJob createEvaluationJob(ProjectName parent, EvaluationJob job)
Creates an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); EvaluationJob job = EvaluationJob.newBuilder().build(); EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job); }
- Parameters:
parent
- Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"job
- Required. The evaluation job to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEvaluationJob
public final EvaluationJob createEvaluationJob(String parent, EvaluationJob job)
Creates an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); EvaluationJob job = EvaluationJob.newBuilder().build(); EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job); }
- Parameters:
parent
- Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"job
- Required. The evaluation job to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEvaluationJob
public final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest request)
Creates an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateEvaluationJobRequest request = CreateEvaluationJobRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setJob(EvaluationJob.newBuilder().build()) .build(); EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateEvaluationJobRequest,EvaluationJob> createEvaluationJobCallable()
Creates an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { CreateEvaluationJobRequest request = CreateEvaluationJobRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setJob(EvaluationJob.newBuilder().build()) .build(); ApiFuture<EvaluationJob> future = dataLabelingServiceClient.createEvaluationJobCallable().futureCall(request); // Do something. EvaluationJob response = future.get(); }
-
updateEvaluationJob
public final EvaluationJob updateEvaluationJob(EvaluationJob evaluationJob, com.google.protobuf.FieldMask updateMask)
Updates an evaluation job. You can only update certain fields of the job's [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, `exampleCount`, and `exampleSamplePercentage`.If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationJob evaluationJob = EvaluationJob.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(evaluationJob, updateMask); }
- Parameters:
evaluationJob
- Required. Evaluation job that is going to be updated.updateMask
- Optional. Mask for which fields to update. You can only provide the following fields:- `evaluationJobConfig.humanAnnotationConfig.instruction`
- `evaluationJobConfig.exampleCount`
- `evaluationJobConfig.exampleSamplePercentage`
You can provide more than one of these fields by separating them with commas.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateEvaluationJob
public final EvaluationJob updateEvaluationJob(UpdateEvaluationJobRequest request)
Updates an evaluation job. You can only update certain fields of the job's [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, `exampleCount`, and `exampleSamplePercentage`.If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { UpdateEvaluationJobRequest request = UpdateEvaluationJobRequest.newBuilder() .setEvaluationJob(EvaluationJob.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateEvaluationJobRequest,EvaluationJob> updateEvaluationJobCallable()
Updates an evaluation job. You can only update certain fields of the job's [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, `exampleCount`, and `exampleSamplePercentage`.If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { UpdateEvaluationJobRequest request = UpdateEvaluationJobRequest.newBuilder() .setEvaluationJob(EvaluationJob.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<EvaluationJob> future = dataLabelingServiceClient.updateEvaluationJobCallable().futureCall(request); // Do something. EvaluationJob response = future.get(); }
-
getEvaluationJob
public final EvaluationJob getEvaluationJob(EvaluationJobName name)
Gets an evaluation job by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluationJob
public final EvaluationJob getEvaluationJob(String name)
Gets an evaluation job by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluationJob
public final EvaluationJob getEvaluationJob(GetEvaluationJobRequest request)
Gets an evaluation job by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetEvaluationJobRequest request = GetEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<GetEvaluationJobRequest,EvaluationJob> getEvaluationJobCallable()
Gets an evaluation job by resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { GetEvaluationJobRequest request = GetEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); ApiFuture<EvaluationJob> future = dataLabelingServiceClient.getEvaluationJobCallable().futureCall(request); // Do something. EvaluationJob response = future.get(); }
-
pauseEvaluationJob
public final void pauseEvaluationJob(EvaluationJobName name)
Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); dataLabelingServiceClient.pauseEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be paused. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
pauseEvaluationJob
public final void pauseEvaluationJob(String name)
Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); dataLabelingServiceClient.pauseEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be paused. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
pauseEvaluationJob
public final void pauseEvaluationJob(PauseEvaluationJobRequest request)
Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { PauseEvaluationJobRequest request = PauseEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); dataLabelingServiceClient.pauseEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
pauseEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<PauseEvaluationJobRequest,com.google.protobuf.Empty> pauseEvaluationJobCallable()
Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { PauseEvaluationJobRequest request = PauseEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.pauseEvaluationJobCallable().futureCall(request); // Do something. future.get(); }
-
resumeEvaluationJob
public final void resumeEvaluationJob(EvaluationJobName name)
Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); dataLabelingServiceClient.resumeEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be resumed. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resumeEvaluationJob
public final void resumeEvaluationJob(String name)
Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); dataLabelingServiceClient.resumeEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be resumed. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resumeEvaluationJob
public final void resumeEvaluationJob(ResumeEvaluationJobRequest request)
Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ResumeEvaluationJobRequest request = ResumeEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); dataLabelingServiceClient.resumeEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resumeEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<ResumeEvaluationJobRequest,com.google.protobuf.Empty> resumeEvaluationJobCallable()
Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ResumeEvaluationJobRequest request = ResumeEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.resumeEvaluationJobCallable().futureCall(request); // Do something. future.get(); }
-
deleteEvaluationJob
public final void deleteEvaluationJob(EvaluationJobName name)
Stops and deletes an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]"); dataLabelingServiceClient.deleteEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be deleted. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEvaluationJob
public final void deleteEvaluationJob(String name)
Stops and deletes an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString(); dataLabelingServiceClient.deleteEvaluationJob(name); }
- Parameters:
name
- Required. Name of the evaluation job that is going to be deleted. Format:"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>"
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEvaluationJob
public final void deleteEvaluationJob(DeleteEvaluationJobRequest request)
Stops and deletes an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteEvaluationJobRequest request = DeleteEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); dataLabelingServiceClient.deleteEvaluationJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEvaluationJobCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteEvaluationJobRequest,com.google.protobuf.Empty> deleteEvaluationJobCallable()
Stops and deletes an evaluation job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { DeleteEvaluationJobRequest request = DeleteEvaluationJobRequest.newBuilder() .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString()) .build(); ApiFuture<Empty> future = dataLabelingServiceClient.deleteEvaluationJobCallable().futureCall(request); // Do something. future.get(); }
-
listEvaluationJobs
public final DataLabelingServiceClient.ListEvaluationJobsPagedResponse listEvaluationJobs(ProjectName parent, String filter)
Lists all evaluation jobs within a project with possible filters. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); String filter = "filter-1274492040"; for (EvaluationJob element : dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"filter
- Optional. You can filter the jobs to list by model_id (also known as model_name, as described in [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) or by evaluation job state (as described in [EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]). To filter by both criteria, use the `AND` operator or the `OR` operator. For example, you can use the following string for your filter: "evaluation<span>_</span>job.model_id = <var>{model_name}</var> AND evaluation<span>_</span>job.state = <var>{evaluation_job_state}</var>"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEvaluationJobs
public final DataLabelingServiceClient.ListEvaluationJobsPagedResponse listEvaluationJobs(String parent, String filter)
Lists all evaluation jobs within a project with possible filters. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); String filter = "filter-1274492040"; for (EvaluationJob element : dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Evaluation job resource parent. Format: "projects/<var>{project_id}</var>"filter
- Optional. You can filter the jobs to list by model_id (also known as model_name, as described in [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) or by evaluation job state (as described in [EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]). To filter by both criteria, use the `AND` operator or the `OR` operator. For example, you can use the following string for your filter: "evaluation<span>_</span>job.model_id = <var>{model_name}</var> AND evaluation<span>_</span>job.state = <var>{evaluation_job_state}</var>"- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEvaluationJobs
public final DataLabelingServiceClient.ListEvaluationJobsPagedResponse listEvaluationJobs(ListEvaluationJobsRequest request)
Lists all evaluation jobs within a project with possible filters. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (EvaluationJob element : dataLabelingServiceClient.listEvaluationJobs(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEvaluationJobsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,DataLabelingServiceClient.ListEvaluationJobsPagedResponse> listEvaluationJobsPagedCallable()
Lists all evaluation jobs within a project with possible filters. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<EvaluationJob> future = dataLabelingServiceClient.listEvaluationJobsPagedCallable().futureCall(request); // Do something. for (EvaluationJob element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listEvaluationJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEvaluationJobsRequest,ListEvaluationJobsResponse> listEvaluationJobsCallable()
Lists all evaluation jobs within a project with possible filters. Pagination is supported.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) { ListEvaluationJobsRequest request = ListEvaluationJobsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-