Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit aad008a

Browse files
docs(samples): add example tags to generated samples (#579)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: googleapis/googleapis@b9f6184 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
1 parent 196aa6b commit aad008a

56 files changed

Lines changed: 1809 additions & 1833 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

linkinator.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"img.shields.io"
77
],
88
"silent": true,
9-
"concurrency": 10
9+
"concurrency": 5
1010
}

samples/generated/v2/cloud_tasks.create_queue.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ function main(parent, queue) {
2424
* For example: `projects/PROJECT_ID/locations/LOCATION_ID`
2525
* The list of allowed locations can be obtained by calling Cloud
2626
* Tasks' implementation of
27-
* [ListLocations][google.cloud.location.Locations.ListLocations].
27+
* ListLocations google.cloud.location.Locations.ListLocations.
2828
*/
2929
// const parent = 'abc123'
3030
/**
3131
* Required. The queue to create.
32-
* [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
32+
* Queue's name google.cloud.tasks.v2.Queue.name cannot be the same as an existing queue.
3333
*/
34-
// const queue = ''
34+
// const queue = {}
3535

3636
// Imports the Tasks library
3737
const {CloudTasksClient} = require('@google-cloud/tasks').v2;
3838

3939
// Instantiates a client
4040
const tasksClient = new CloudTasksClient();
4141

42-
async function createQueue() {
42+
async function callCreateQueue() {
4343
// Construct request
4444
const request = {
4545
parent,
@@ -51,7 +51,7 @@ function main(parent, queue) {
5151
console.log(response);
5252
}
5353

54-
createQueue();
54+
callCreateQueue();
5555
// [END cloudtasks_v2_generated_CloudTasks_CreateQueue_async]
5656
}
5757

samples/generated/v2/cloud_tasks.create_task.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ function main(parent, task) {
2929
* Required. The task to add.
3030
* Task names have the following format:
3131
* `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
32-
* The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
32+
* The user can optionally specify a task name google.cloud.tasks.v2.Task.name. If a
3333
* name is not specified then the system will generate a random
3434
* unique task id, which will be set in the task returned in the
35-
* [response][google.cloud.tasks.v2.Task.name].
36-
* If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
35+
* response google.cloud.tasks.v2.Task.name.
36+
* If schedule_time google.cloud.tasks.v2.Task.schedule_time is not set or is in the
3737
* past then Cloud Tasks will set it to the current time.
3838
* Task De-duplication:
3939
* Explicitly specifying a task ID enables task de-duplication. If
4040
* a task's ID is identical to that of an existing task or a task
4141
* that was deleted or executed recently then the call will fail
42-
* with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
42+
* with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS.
4343
* If the task's queue was created using Cloud Tasks, then another task with
4444
* the same name can't be created for ~1hour after the original task was
4545
* deleted or executed. If the task's queue was created using queue.yaml or
4646
* queue.xml, then another task with the same name can't be created
4747
* for ~9days after the original task was deleted or executed.
4848
* Because there is an extra lookup cost to identify duplicate task
49-
* names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
49+
* names, these CreateTask google.cloud.tasks.v2.CloudTasks.CreateTask calls have significantly
5050
* increased latency. Using hashed strings for the task id or for
5151
* the prefix of the task id is recommended. Choosing task ids that
5252
* are sequential or have sequential prefixes, for example using a
@@ -55,28 +55,28 @@ function main(parent, task) {
5555
* uniform distribution of task ids to store and serve tasks
5656
* efficiently.
5757
*/
58-
// const task = ''
58+
// const task = {}
5959
/**
60-
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
60+
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
6161
* returned.
62-
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
62+
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
6363
* information is retrieved by default because some data, such as
6464
* payloads, might be desirable to return only when needed because
6565
* of its large size or because of the sensitivity of data that it
6666
* contains.
67-
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
68-
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
69-
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
67+
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
68+
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
69+
* permission on the Task google.cloud.tasks.v2.Task resource.
7070
*/
71-
// const responseView = ''
71+
// const responseView = {}
7272

7373
// Imports the Tasks library
7474
const {CloudTasksClient} = require('@google-cloud/tasks').v2;
7575

7676
// Instantiates a client
7777
const tasksClient = new CloudTasksClient();
7878

79-
async function createTask() {
79+
async function callCreateTask() {
8080
// Construct request
8181
const request = {
8282
parent,
@@ -88,7 +88,7 @@ function main(parent, task) {
8888
console.log(response);
8989
}
9090

91-
createTask();
91+
callCreateTask();
9292
// [END cloudtasks_v2_generated_CloudTasks_CreateTask_async]
9393
}
9494

samples/generated/v2/cloud_tasks.delete_queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function main(name) {
3131
// Instantiates a client
3232
const tasksClient = new CloudTasksClient();
3333

34-
async function deleteQueue() {
34+
async function callDeleteQueue() {
3535
// Construct request
3636
const request = {
3737
name,
@@ -42,7 +42,7 @@ function main(name) {
4242
console.log(response);
4343
}
4444

45-
deleteQueue();
45+
callDeleteQueue();
4646
// [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_async]
4747
}
4848

samples/generated/v2/cloud_tasks.delete_task.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function main(name) {
3131
// Instantiates a client
3232
const tasksClient = new CloudTasksClient();
3333

34-
async function deleteTask() {
34+
async function callDeleteTask() {
3535
// Construct request
3636
const request = {
3737
name,
@@ -42,7 +42,7 @@ function main(name) {
4242
console.log(response);
4343
}
4444

45-
deleteTask();
45+
callDeleteTask();
4646
// [END cloudtasks_v2_generated_CloudTasks_DeleteTask_async]
4747
}
4848

samples/generated/v2/cloud_tasks.get_iam_policy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ function main(resource) {
2828
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
2929
* `GetIamPolicy`. This field is only used by Cloud IAM.
3030
*/
31-
// const options = ''
31+
// const options = {}
3232

3333
// Imports the Tasks library
3434
const {CloudTasksClient} = require('@google-cloud/tasks').v2;
3535

3636
// Instantiates a client
3737
const tasksClient = new CloudTasksClient();
3838

39-
async function getIamPolicy() {
39+
async function callGetIamPolicy() {
4040
// Construct request
4141
const request = {
4242
resource,
@@ -47,7 +47,7 @@ function main(resource) {
4747
console.log(response);
4848
}
4949

50-
getIamPolicy();
50+
callGetIamPolicy();
5151
// [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async]
5252
}
5353

samples/generated/v2/cloud_tasks.get_queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function main(name) {
3131
// Instantiates a client
3232
const tasksClient = new CloudTasksClient();
3333

34-
async function getQueue() {
34+
async function callGetQueue() {
3535
// Construct request
3636
const request = {
3737
name,
@@ -42,7 +42,7 @@ function main(name) {
4242
console.log(response);
4343
}
4444

45-
getQueue();
45+
callGetQueue();
4646
// [END cloudtasks_v2_generated_CloudTasks_GetQueue_async]
4747
}
4848

samples/generated/v2/cloud_tasks.get_task.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ function main(name) {
2525
*/
2626
// const name = 'abc123'
2727
/**
28-
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
28+
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
2929
* returned.
30-
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
30+
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
3131
* information is retrieved by default because some data, such as
3232
* payloads, might be desirable to return only when needed because
3333
* of its large size or because of the sensitivity of data that it
3434
* contains.
35-
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
36-
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
37-
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
35+
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
36+
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
37+
* permission on the Task google.cloud.tasks.v2.Task resource.
3838
*/
39-
// const responseView = ''
39+
// const responseView = {}
4040

4141
// Imports the Tasks library
4242
const {CloudTasksClient} = require('@google-cloud/tasks').v2;
4343

4444
// Instantiates a client
4545
const tasksClient = new CloudTasksClient();
4646

47-
async function getTask() {
47+
async function callGetTask() {
4848
// Construct request
4949
const request = {
5050
name,
@@ -55,7 +55,7 @@ function main(name) {
5555
console.log(response);
5656
}
5757

58-
getTask();
58+
callGetTask();
5959
// [END cloudtasks_v2_generated_CloudTasks_GetTask_async]
6060
}
6161

samples/generated/v2/cloud_tasks.list_queues.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ function main(parent) {
2525
*/
2626
// const parent = 'abc123'
2727
/**
28-
* `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue]
28+
* `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2.Queue
2929
* field can be used as a filter and several operators as supported.
3030
* For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
3131
* described in
32-
* [Stackdriver's Advanced Logs
33-
* Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
32+
* Stackdriver's Advanced Logs
33+
* Filters (https://cloud.google.com/logging/docs/view/advanced_filters).
3434
* Sample filter "state: PAUSED".
3535
* Note that using filters might cause fewer queues than the
3636
* requested page_size to be returned.
@@ -41,18 +41,18 @@ function main(parent) {
4141
* The maximum page size is 9800. If unspecified, the page size will
4242
* be the maximum. Fewer queues than requested might be returned,
4343
* even if more queues exist; use the
44-
* [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] in the
44+
* next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token in the
4545
* response to determine if more queues exist.
4646
*/
4747
// const pageSize = 1234
4848
/**
4949
* A token identifying the page of results to return.
5050
* To request the first page results, page_token must be empty. To
5151
* request the next page of results, page_token must be the value of
52-
* [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] returned
53-
* from the previous call to [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]
52+
* next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token returned
53+
* from the previous call to ListQueues google.cloud.tasks.v2.CloudTasks.ListQueues
5454
* method. It is an error to switch the value of the
55-
* [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating through pages.
55+
* filter google.cloud.tasks.v2.ListQueuesRequest.filter while iterating through pages.
5656
*/
5757
// const pageToken = 'abc123'
5858

@@ -62,7 +62,7 @@ function main(parent) {
6262
// Instantiates a client
6363
const tasksClient = new CloudTasksClient();
6464

65-
async function listQueues() {
65+
async function callListQueues() {
6666
// Construct request
6767
const request = {
6868
parent,
@@ -75,7 +75,7 @@ function main(parent) {
7575
}
7676
}
7777

78-
listQueues();
78+
callListQueues();
7979
// [END cloudtasks_v2_generated_CloudTasks_ListQueues_async]
8080
}
8181

samples/generated/v2/cloud_tasks.list_tasks.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ function main(parent) {
2525
*/
2626
// const parent = 'abc123'
2727
/**
28-
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
28+
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
2929
* returned.
30-
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
30+
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
3131
* information is retrieved by default because some data, such as
3232
* payloads, might be desirable to return only when needed because
3333
* of its large size or because of the sensitivity of data that it
3434
* contains.
35-
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
36-
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
37-
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
35+
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
36+
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
37+
* permission on the Task google.cloud.tasks.v2.Task resource.
3838
*/
39-
// const responseView = ''
39+
// const responseView = {}
4040
/**
4141
* Maximum page size.
4242
* Fewer tasks than requested might be returned, even if more tasks exist; use
43-
* [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] in the response to
43+
* next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token in the response to
4444
* determine if more tasks exist.
4545
* The maximum page size is 1000. If unspecified, the page size will be the
4646
* maximum.
@@ -50,8 +50,8 @@ function main(parent) {
5050
* A token identifying the page of results to return.
5151
* To request the first page results, page_token must be empty. To
5252
* request the next page of results, page_token must be the value of
53-
* [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] returned
54-
* from the previous call to [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]
53+
* next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token returned
54+
* from the previous call to ListTasks google.cloud.tasks.v2.CloudTasks.ListTasks
5555
* method.
5656
* The page token is valid for only 2 hours.
5757
*/
@@ -63,7 +63,7 @@ function main(parent) {
6363
// Instantiates a client
6464
const tasksClient = new CloudTasksClient();
6565

66-
async function listTasks() {
66+
async function callListTasks() {
6767
// Construct request
6868
const request = {
6969
parent,
@@ -76,7 +76,7 @@ function main(parent) {
7676
}
7777
}
7878

79-
listTasks();
79+
callListTasks();
8080
// [END cloudtasks_v2_generated_CloudTasks_ListTasks_async]
8181
}
8282

0 commit comments

Comments
 (0)