Skip to content

Commit

Permalink
fix: resource names helper functions; enum, bytes, and Long types now…
Browse files Browse the repository at this point in the history
… accept strings (#117)

* [CHANGE ME] Re-generated  to pick up changes in the API or client library generator.

* fix: update resource names

Co-authored-by: Alexander Fenster <[email protected]>
  • Loading branch information
yoshi-automation and alexander-fenster committed Jan 28, 2020
1 parent 1eaea24 commit eea7efa
Show file tree
Hide file tree
Showing 11 changed files with 29,776 additions and 28,047 deletions.
14,184 changes: 7,207 additions & 6,977 deletions packages/google-cloud-datalabeling/protos/protos.d.ts

Large diffs are not rendered by default.

39,129 changes: 19,894 additions & 19,235 deletions packages/google-cloud-datalabeling/protos/protos.js

Large diffs are not rendered by default.

4,073 changes: 2,283 additions & 1,790 deletions packages/google-cloud-datalabeling/protos/protos.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -4084,93 +4084,133 @@ export class DataLabelingServiceClient {
}

/**
* Return a fully-qualified annotateddataset resource name string.
* Return a fully-qualified annotatedDataset resource name string.
*
* @param {string} project
* @param {string} dataset
* @param {string} annotated_dataset
* @returns {string} Resource name string.
*/
annotatedDatasetPath(project: string, dataset: string) {
return this._pathTemplates.annotateddatasetPathTemplate.render({
annotatedDatasetPath(
project: string,
dataset: string,
annotatedDataset: string
) {
return this._pathTemplates.annotatedDatasetPathTemplate.render({
project,
dataset,
annotated_dataset: annotatedDataset,
});
}

/**
* Parse the project from AnnotatedDataset resource.
*
* @param {string} annotateddatasetName
* @param {string} annotatedDatasetName
* A fully-qualified path representing AnnotatedDataset resource.
* @returns {string} A string representing the project.
*/
matchProjectFromAnnotatedDatasetName(annotateddatasetName: string) {
return this._pathTemplates.annotateddatasetPathTemplate.match(
annotateddatasetName
matchProjectFromAnnotatedDatasetName(annotatedDatasetName: string) {
return this._pathTemplates.annotatedDatasetPathTemplate.match(
annotatedDatasetName
).project;
}

/**
* Parse the dataset from AnnotatedDataset resource.
*
* @param {string} annotateddatasetName
* @param {string} annotatedDatasetName
* A fully-qualified path representing AnnotatedDataset resource.
* @returns {string} A string representing the dataset.
*/
matchDatasetFromAnnotatedDatasetName(annotateddatasetName: string) {
return this._pathTemplates.annotateddatasetPathTemplate.match(
annotateddatasetName
matchDatasetFromAnnotatedDatasetName(annotatedDatasetName: string) {
return this._pathTemplates.annotatedDatasetPathTemplate.match(
annotatedDatasetName
).dataset;
}

/**
* Return a fully-qualified dataitem resource name string.
* Parse the annotated_dataset from AnnotatedDataset resource.
*
* @param {string} annotatedDatasetName
* A fully-qualified path representing AnnotatedDataset resource.
* @returns {string} A string representing the annotated_dataset.
*/
matchAnnotatedDatasetFromAnnotatedDatasetName(annotatedDatasetName: string) {
return this._pathTemplates.annotatedDatasetPathTemplate.match(
annotatedDatasetName
).annotated_dataset;
}

/**
* Return a fully-qualified dataItem resource name string.
*
* @param {string} project
* @param {string} dataset
* @param {string} data_item
* @returns {string} Resource name string.
*/
dataItemPath(project: string, dataset: string) {
return this._pathTemplates.dataitemPathTemplate.render({
dataItemPath(project: string, dataset: string, dataItem: string) {
return this._pathTemplates.dataItemPathTemplate.render({
project,
dataset,
data_item: dataItem,
});
}

/**
* Parse the project from DataItem resource.
*
* @param {string} dataitemName
* @param {string} dataItemName
* A fully-qualified path representing DataItem resource.
* @returns {string} A string representing the project.
*/
matchProjectFromDataItemName(dataitemName: string) {
return this._pathTemplates.dataitemPathTemplate.match(dataitemName).project;
matchProjectFromDataItemName(dataItemName: string) {
return this._pathTemplates.dataItemPathTemplate.match(dataItemName).project;
}

/**
* Parse the dataset from DataItem resource.
*
* @param {string} dataitemName
* @param {string} dataItemName
* A fully-qualified path representing DataItem resource.
* @returns {string} A string representing the dataset.
*/
matchDatasetFromDataItemName(dataitemName: string) {
return this._pathTemplates.dataitemPathTemplate.match(dataitemName).dataset;
matchDatasetFromDataItemName(dataItemName: string) {
return this._pathTemplates.dataItemPathTemplate.match(dataItemName).dataset;
}

/**
* Parse the data_item from DataItem resource.
*
* @param {string} dataItemName
* A fully-qualified path representing DataItem resource.
* @returns {string} A string representing the data_item.
*/
matchDataItemFromDataItemName(dataItemName: string) {
return this._pathTemplates.dataItemPathTemplate.match(dataItemName)
.data_item;
}

/**
* Return a fully-qualified example resource name string.
*
* @param {string} project
* @param {string} dataset
* @param {string} annotated_dataset
* @param {string} example
* @returns {string} Resource name string.
*/
examplePath(project: string, dataset: string, example: string) {
examplePath(
project: string,
dataset: string,
annotatedDataset: string,
example: string
) {
return this._pathTemplates.examplePathTemplate.render({
project,
dataset,
annotated_dataset: annotatedDataset,
example,
});
}
Expand All @@ -4197,6 +4237,18 @@ export class DataLabelingServiceClient {
return this._pathTemplates.examplePathTemplate.match(exampleName).dataset;
}

/**
* Parse the annotated_dataset from Example resource.
*
* @param {string} exampleName
* A fully-qualified path representing Example resource.
* @returns {string} A string representing the annotated_dataset.
*/
matchAnnotatedDatasetFromExampleName(exampleName: string) {
return this._pathTemplates.examplePathTemplate.match(exampleName)
.annotated_dataset;
}

/**
* Parse the example from Example resource.
*
Expand All @@ -4209,30 +4261,47 @@ export class DataLabelingServiceClient {
}

/**
* Return a fully-qualified annotationspecset resource name string.
* Return a fully-qualified annotationSpecSet resource name string.
*
* @param {string} project
* @param {string} annotation_spec_set
* @returns {string} Resource name string.
*/
annotationSpecSetPath(project: string) {
return this._pathTemplates.annotationspecsetPathTemplate.render({
annotationSpecSetPath(project: string, annotationSpecSet: string) {
return this._pathTemplates.annotationSpecSetPathTemplate.render({
project,
annotation_spec_set: annotationSpecSet,
});
}

/**
* Parse the project from AnnotationSpecSet resource.
*
* @param {string} annotationspecsetName
* @param {string} annotationSpecSetName
* A fully-qualified path representing AnnotationSpecSet resource.
* @returns {string} A string representing the project.
*/
matchProjectFromAnnotationSpecSetName(annotationspecsetName: string) {
return this._pathTemplates.annotationspecsetPathTemplate.match(
annotationspecsetName
matchProjectFromAnnotationSpecSetName(annotationSpecSetName: string) {
return this._pathTemplates.annotationSpecSetPathTemplate.match(
annotationSpecSetName
).project;
}

/**
* Parse the annotation_spec_set from AnnotationSpecSet resource.
*
* @param {string} annotationSpecSetName
* A fully-qualified path representing AnnotationSpecSet resource.
* @returns {string} A string representing the annotation_spec_set.
*/
matchAnnotationSpecSetFromAnnotationSpecSetName(
annotationSpecSetName: string
) {
return this._pathTemplates.annotationSpecSetPathTemplate.match(
annotationSpecSetName
).annotation_spec_set;
}

/**
* Return a fully-qualified instruction resource name string.
*
Expand Down Expand Up @@ -4324,30 +4393,45 @@ export class DataLabelingServiceClient {
}

/**
* Return a fully-qualified evaluationjob resource name string.
* Return a fully-qualified evaluationJob resource name string.
*
* @param {string} project
* @param {string} evaluation_job
* @returns {string} Resource name string.
*/
evaluationJobPath(project: string) {
return this._pathTemplates.evaluationjobPathTemplate.render({
evaluationJobPath(project: string, evaluationJob: string) {
return this._pathTemplates.evaluationJobPathTemplate.render({
project,
evaluation_job: evaluationJob,
});
}

/**
* Parse the project from EvaluationJob resource.
*
* @param {string} evaluationjobName
* @param {string} evaluationJobName
* A fully-qualified path representing EvaluationJob resource.
* @returns {string} A string representing the project.
*/
matchProjectFromEvaluationJobName(evaluationjobName: string) {
return this._pathTemplates.evaluationjobPathTemplate.match(
evaluationjobName
matchProjectFromEvaluationJobName(evaluationJobName: string) {
return this._pathTemplates.evaluationJobPathTemplate.match(
evaluationJobName
).project;
}

/**
* Parse the evaluation_job from EvaluationJob resource.
*
* @param {string} evaluationJobName
* A fully-qualified path representing EvaluationJob resource.
* @returns {string} A string representing the evaluation_job.
*/
matchEvaluationJobFromEvaluationJobName(evaluationJobName: string) {
return this._pathTemplates.evaluationJobPathTemplate.match(
evaluationJobName
).evaluation_job;
}

/**
* Terminate the GRPC channel and close the client.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-datalabeling/src/v1beta1/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit eea7efa

Please sign in to comment.