Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,39 +114,43 @@ public class DataLabelingServiceClient implements BackgroundResource {
private final DataLabelingServiceStub stub;
private final OperationsClient operationsClient;

private static final PathTemplate PROJECT_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding("projects/{project}");
private static final PathTemplate ANNOTATED_DATASET_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}");

private static final PathTemplate ANNOTATION_SPEC_SET_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/annotationSpecSets/{annotation_spec_set}");

private static final PathTemplate DATA_ITEM_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/datasets/{dataset}/dataItems/{data_item}");

private static final PathTemplate DATASET_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding("projects/{project}/datasets/{dataset}");

private static final PathTemplate ANNOTATED_DATASET_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}");

private static final PathTemplate EXAMPLE_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}");

private static final PathTemplate DATA_ITEM_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding(
"projects/{project}/datasets/{dataset}/dataItems/{data_item}");

private static final PathTemplate INSTRUCTION_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding("projects/{project}/instructions/{instruction}");

private static final PathTemplate PROJECT_PATH_TEMPLATE =
PathTemplate.createWithoutUrlEncoding("projects/{project}");

/**
* Formats a string containing the fully-qualified path to represent a project resource.
* Formats a string containing the fully-qualified path to represent a annotated_dataset resource.
*
* @deprecated Use the {@link ProjectName} class instead.
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
*/
@Deprecated
public static final String formatProjectName(String project) {
return PROJECT_PATH_TEMPLATE.instantiate("project", project);
public static final String formatAnnotatedDatasetName(
String project, String dataset, String annotatedDataset) {
return ANNOTATED_DATASET_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset,
"annotated_dataset", annotatedDataset);
}

/**
Expand All @@ -163,29 +167,28 @@ public static final String formatAnnotationSpecSetName(String project, String an
}

/**
* Formats a string containing the fully-qualified path to represent a dataset resource.
* Formats a string containing the fully-qualified path to represent a data_item resource.
*
* @deprecated Use the {@link DatasetName} class instead.
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String formatDatasetName(String project, String dataset) {
return DATASET_PATH_TEMPLATE.instantiate(
public static final String formatDataItemName(String project, String dataset, String dataItem) {
return DATA_ITEM_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset);
"dataset", dataset,
"data_item", dataItem);
}

/**
* Formats a string containing the fully-qualified path to represent a annotated_dataset resource.
* Formats a string containing the fully-qualified path to represent a dataset resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
* @deprecated Use the {@link DatasetName} class instead.
*/
@Deprecated
public static final String formatAnnotatedDatasetName(
String project, String dataset, String annotatedDataset) {
return ANNOTATED_DATASET_PATH_TEMPLATE.instantiate(
public static final String formatDatasetName(String project, String dataset) {
return DATASET_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset,
"annotated_dataset", annotatedDataset);
"dataset", dataset);
}

/**
Expand All @@ -203,19 +206,6 @@ public static final String formatExampleName(
"example", example);
}

/**
* Formats a string containing the fully-qualified path to represent a data_item resource.
*
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String formatDataItemName(String project, String dataset, String dataItem) {
return DATA_ITEM_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset,
"data_item", dataItem);
}

/**
* Formats a string containing the fully-qualified path to represent a instruction resource.
*
Expand All @@ -229,13 +219,47 @@ public static final String formatInstructionName(String project, String instruct
}

/**
* Parses the project from the given fully-qualified path which represents a project resource.
* Formats a string containing the fully-qualified path to represent a project resource.
*
* @deprecated Use the {@link ProjectName} class instead.
*/
@Deprecated
public static final String parseProjectFromProjectName(String projectName) {
return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");
public static final String formatProjectName(String project) {
return PROJECT_PATH_TEMPLATE.instantiate("project", project);
}

/**
* Parses the project from the given fully-qualified path which represents a annotated_dataset
* resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
*/
@Deprecated
public static final String parseProjectFromAnnotatedDatasetName(String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("project");
}

/**
* Parses the dataset from the given fully-qualified path which represents a annotated_dataset
* resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
*/
@Deprecated
public static final String parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("dataset");
}

/**
* Parses the annotated_dataset from the given fully-qualified path which represents a
* annotated_dataset resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
*/
@Deprecated
public static final String parseAnnotatedDatasetFromAnnotatedDatasetName(
String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("annotated_dataset");
}

/**
Expand Down Expand Up @@ -264,57 +288,53 @@ public static final String parseAnnotationSpecSetFromAnnotationSpecSetName(
}

/**
* Parses the project from the given fully-qualified path which represents a dataset resource.
* Parses the project from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link DatasetName} class instead.
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseProjectFromDatasetName(String datasetName) {
return DATASET_PATH_TEMPLATE.parse(datasetName).get("project");
public static final String parseProjectFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("project");
}

/**
* Parses the dataset from the given fully-qualified path which represents a dataset resource.
* Parses the dataset from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link DatasetName} class instead.
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseDatasetFromDatasetName(String datasetName) {
return DATASET_PATH_TEMPLATE.parse(datasetName).get("dataset");
public static final String parseDatasetFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("dataset");
}

/**
* Parses the project from the given fully-qualified path which represents a annotated_dataset
* resource.
* Parses the data_item from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseProjectFromAnnotatedDatasetName(String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("project");
public static final String parseDataItemFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("data_item");
}

/**
* Parses the dataset from the given fully-qualified path which represents a annotated_dataset
* resource.
* Parses the project from the given fully-qualified path which represents a dataset resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
* @deprecated Use the {@link DatasetName} class instead.
*/
@Deprecated
public static final String parseDatasetFromAnnotatedDatasetName(String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("dataset");
public static final String parseProjectFromDatasetName(String datasetName) {
return DATASET_PATH_TEMPLATE.parse(datasetName).get("project");
}

/**
* Parses the annotated_dataset from the given fully-qualified path which represents a
* annotated_dataset resource.
* Parses the dataset from the given fully-qualified path which represents a dataset resource.
*
* @deprecated Use the {@link AnnotatedDatasetName} class instead.
* @deprecated Use the {@link DatasetName} class instead.
*/
@Deprecated
public static final String parseAnnotatedDatasetFromAnnotatedDatasetName(
String annotatedDatasetName) {
return ANNOTATED_DATASET_PATH_TEMPLATE.parse(annotatedDatasetName).get("annotated_dataset");
public static final String parseDatasetFromDatasetName(String datasetName) {
return DATASET_PATH_TEMPLATE.parse(datasetName).get("dataset");
}

/**
Expand Down Expand Up @@ -358,36 +378,6 @@ public static final String parseExampleFromExampleName(String exampleName) {
return EXAMPLE_PATH_TEMPLATE.parse(exampleName).get("example");
}

/**
* Parses the project from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseProjectFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("project");
}

/**
* Parses the dataset from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseDatasetFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("dataset");
}

/**
* Parses the data_item from the given fully-qualified path which represents a data_item resource.
*
* @deprecated Use the {@link DataItemName} class instead.
*/
@Deprecated
public static final String parseDataItemFromDataItemName(String dataItemName) {
return DATA_ITEM_PATH_TEMPLATE.parse(dataItemName).get("data_item");
}

/**
* Parses the project from the given fully-qualified path which represents a instruction resource.
*
Expand All @@ -409,6 +399,16 @@ public static final String parseInstructionFromInstructionName(String instructio
return INSTRUCTION_PATH_TEMPLATE.parse(instructionName).get("instruction");
}

/**
* Parses the project from the given fully-qualified path which represents a project resource.
*
* @deprecated Use the {@link ProjectName} class instead.
*/
@Deprecated
public static final String parseProjectFromProjectName(String projectName) {
return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");
}

/** Constructs an instance of DataLabelingServiceClient with default settings. */
public static final DataLabelingServiceClient create() throws IOException {
return create(DataLabelingServiceSettings.newBuilder().build());
Expand Down
10 changes: 5 additions & 5 deletions google-cloud-clients/google-cloud-datalabeling/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-04-03T07:39:57.719728Z",
"updateTime": "2019-04-23T07:39:35.286852Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.22",
"dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320"
"version": "0.17.0",
"dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "8dab717b2851750c829530669fe5cebafef22fb8",
"internalRef": "241646671"
"sha": "547e19e7df398e9290e8e3674d7351efc500f9b0",
"internalRef": "244712781"
}
}
],
Expand Down