Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#322)
Browse files Browse the repository at this point in the history
* docs(samples): add example tags to generated samples

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 11, 2021
1 parent e4e89c6 commit ac55cd4
Show file tree
Hide file tree
Showing 36 changed files with 3,152 additions and 977 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-datalabeling/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, annotationSpecSet) {
// [START datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. AnnotationSpecSet resource parent, format:
* projects/{project_id}
*/
// const parent = 'abc123'
/**
* 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.
*/
// const annotationSpecSet = {}

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callCreateAnnotationSpecSet() {
// Construct request
const request = {
parent,
annotationSpecSet,
};

// Run request
const response = await datalabelingClient.createAnnotationSpecSet(request);
console.log(response);
}

callCreateAnnotationSpecSet();
// [END datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, dataset) {
// [START datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Dataset resource parent, format:
* projects/{project_id}
*/
// const parent = 'abc123'
/**
* Required. The dataset to be created.
*/
// const dataset = {}

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callCreateDataset() {
// Construct request
const request = {
parent,
dataset,
};

// Run request
const response = await datalabelingClient.createDataset(request);
console.log(response);
}

callCreateDataset();
// [END datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, job) {
// [START datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Evaluation job resource parent. Format:
* "projects/<var>{project_id}</var>"
*/
// const parent = 'abc123'
/**
* Required. The evaluation job to create.
*/
// const job = {}

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callCreateEvaluationJob() {
// Construct request
const request = {
parent,
job,
};

// Run request
const response = await datalabelingClient.createEvaluationJob(request);
console.log(response);
}

callCreateEvaluationJob();
// [END datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, instruction) {
// [START datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Instruction resource parent, format:
* projects/{project_id}
*/
// const parent = 'abc123'
/**
* Required. Instruction of how to perform the labeling task.
*/
// const instruction = {}

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callCreateInstruction() {
// Construct request
const request = {
parent,
instruction,
};

// Run request
const [operation] = await datalabelingClient.createInstruction(request);
const [response] = await operation.promise();
console.log(response);
}

callCreateInstruction();
// [END datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the annotated dataset to delete, format:
* projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
* {annotated_dataset_id}
*/
// const name = 'abc123'

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callDeleteAnnotatedDataset() {
// Construct request
const request = {
name,
};

// Run request
const response = await datalabelingClient.deleteAnnotatedDataset(request);
console.log(response);
}

callDeleteAnnotatedDataset();
// [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. AnnotationSpec resource name, format:
* `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.
*/
// const name = 'abc123'

// Imports the Datalabeling library
const {DataLabelingServiceClient} =
require('@google-cloud/datalabeling').v1beta1;

// Instantiates a client
const datalabelingClient = new DataLabelingServiceClient();

async function callDeleteAnnotationSpecSet() {
// Construct request
const request = {
name,
};

// Run request
const response = await datalabelingClient.deleteAnnotationSpecSet(request);
console.log(response);
}

callDeleteAnnotationSpecSet();
// [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading

0 comments on commit ac55cd4

Please sign in to comment.