Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#579)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 10, 2021
1 parent f199b7b commit c395de8
Show file tree
Hide file tree
Showing 56 changed files with 1,809 additions and 1,833 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-tasks/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
Expand Up @@ -24,22 +24,22 @@ function main(parent, queue) {
* For example: `projects/PROJECT_ID/locations/LOCATION_ID`
* The list of allowed locations can be obtained by calling Cloud
* Tasks' implementation of
* [ListLocations][google.cloud.location.Locations.ListLocations].
* ListLocations google.cloud.location.Locations.ListLocations.
*/
// const parent = 'abc123'
/**
* Required. The queue to create.
* [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
* Queue's name google.cloud.tasks.v2.Queue.name cannot be the same as an existing queue.
*/
// const queue = ''
// const queue = {}

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

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

async function createQueue() {
async function callCreateQueue() {
// Construct request
const request = {
parent,
Expand All @@ -51,7 +51,7 @@ function main(parent, queue) {
console.log(response);
}

createQueue();
callCreateQueue();
// [END cloudtasks_v2_generated_CloudTasks_CreateQueue_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ function main(parent, task) {
* Required. The task to add.
* Task names have the following format:
* `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
* The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a
* The user can optionally specify a task name google.cloud.tasks.v2.Task.name. If a
* name is not specified then the system will generate a random
* unique task id, which will be set in the task returned in the
* [response][google.cloud.tasks.v2.Task.name].
* If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the
* response google.cloud.tasks.v2.Task.name.
* If schedule_time google.cloud.tasks.v2.Task.schedule_time is not set or is in the
* past then Cloud Tasks will set it to the current time.
* Task De-duplication:
* Explicitly specifying a task ID enables task de-duplication. If
* a task's ID is identical to that of an existing task or a task
* that was deleted or executed recently then the call will fail
* with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
* with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS.
* If the task's queue was created using Cloud Tasks, then another task with
* the same name can't be created for ~1hour after the original task was
* deleted or executed. If the task's queue was created using queue.yaml or
* queue.xml, then another task with the same name can't be created
* for ~9days after the original task was deleted or executed.
* Because there is an extra lookup cost to identify duplicate task
* names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly
* names, these CreateTask google.cloud.tasks.v2.CloudTasks.CreateTask calls have significantly
* increased latency. Using hashed strings for the task id or for
* the prefix of the task id is recommended. Choosing task ids that
* are sequential or have sequential prefixes, for example using a
Expand All @@ -55,28 +55,28 @@ function main(parent, task) {
* uniform distribution of task ids to store and serve tasks
* efficiently.
*/
// const task = ''
// const task = {}
/**
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
* returned.
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
* information is retrieved by default because some data, such as
* payloads, might be desirable to return only when needed because
* of its large size or because of the sensitivity of data that it
* contains.
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
* permission on the Task google.cloud.tasks.v2.Task resource.
*/
// const responseView = ''
// const responseView = {}

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

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

async function createTask() {
async function callCreateTask() {
// Construct request
const request = {
parent,
Expand All @@ -88,7 +88,7 @@ function main(parent, task) {
console.log(response);
}

createTask();
callCreateTask();
// [END cloudtasks_v2_generated_CloudTasks_CreateTask_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(name) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function deleteQueue() {
async function callDeleteQueue() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

deleteQueue();
callDeleteQueue();
// [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(name) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function deleteTask() {
async function callDeleteTask() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

deleteTask();
callDeleteTask();
// [END cloudtasks_v2_generated_CloudTasks_DeleteTask_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ function main(resource) {
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`. This field is only used by Cloud IAM.
*/
// const options = ''
// const options = {}

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

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

async function getIamPolicy() {
async function callGetIamPolicy() {
// Construct request
const request = {
resource,
Expand All @@ -47,7 +47,7 @@ function main(resource) {
console.log(response);
}

getIamPolicy();
callGetIamPolicy();
// [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(name) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function getQueue() {
async function callGetQueue() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

getQueue();
callGetQueue();
// [END cloudtasks_v2_generated_CloudTasks_GetQueue_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ function main(name) {
*/
// const name = 'abc123'
/**
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
* returned.
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
* information is retrieved by default because some data, such as
* payloads, might be desirable to return only when needed because
* of its large size or because of the sensitivity of data that it
* contains.
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
* permission on the Task google.cloud.tasks.v2.Task resource.
*/
// const responseView = ''
// const responseView = {}

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

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

async function getTask() {
async function callGetTask() {
// Construct request
const request = {
name,
Expand All @@ -55,7 +55,7 @@ function main(name) {
console.log(response);
}

getTask();
callGetTask();
// [END cloudtasks_v2_generated_CloudTasks_GetTask_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ function main(parent) {
*/
// const parent = 'abc123'
/**
* `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue]
* `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2.Queue
* field can be used as a filter and several operators as supported.
* For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
* described in
* [Stackdriver's Advanced Logs
* Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
* Stackdriver's Advanced Logs
* Filters (https://cloud.google.com/logging/docs/view/advanced_filters).
* Sample filter "state: PAUSED".
* Note that using filters might cause fewer queues than the
* requested page_size to be returned.
Expand All @@ -41,18 +41,18 @@ function main(parent) {
* The maximum page size is 9800. If unspecified, the page size will
* be the maximum. Fewer queues than requested might be returned,
* even if more queues exist; use the
* [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] in the
* next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token in the
* response to determine if more queues exist.
*/
// const pageSize = 1234
/**
* A token identifying the page of results to return.
* To request the first page results, page_token must be empty. To
* request the next page of results, page_token must be the value of
* [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] returned
* from the previous call to [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]
* next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token returned
* from the previous call to ListQueues google.cloud.tasks.v2.CloudTasks.ListQueues
* method. It is an error to switch the value of the
* [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating through pages.
* filter google.cloud.tasks.v2.ListQueuesRequest.filter while iterating through pages.
*/
// const pageToken = 'abc123'

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

async function listQueues() {
async function callListQueues() {
// Construct request
const request = {
parent,
Expand All @@ -75,7 +75,7 @@ function main(parent) {
}
}

listQueues();
callListQueues();
// [END cloudtasks_v2_generated_CloudTasks_ListQueues_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ function main(parent) {
*/
// const parent = 'abc123'
/**
* The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be
* The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be
* returned.
* By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all
* By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all
* information is retrieved by default because some data, such as
* payloads, might be desirable to return only when needed because
* of its large size or because of the sensitivity of data that it
* contains.
* Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires
* `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
* permission on the [Task][google.cloud.tasks.v2.Task] resource.
* Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires
* `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/)
* permission on the Task google.cloud.tasks.v2.Task resource.
*/
// const responseView = ''
// const responseView = {}
/**
* Maximum page size.
* Fewer tasks than requested might be returned, even if more tasks exist; use
* [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] in the response to
* next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token in the response to
* determine if more tasks exist.
* The maximum page size is 1000. If unspecified, the page size will be the
* maximum.
Expand All @@ -50,8 +50,8 @@ function main(parent) {
* A token identifying the page of results to return.
* To request the first page results, page_token must be empty. To
* request the next page of results, page_token must be the value of
* [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] returned
* from the previous call to [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]
* next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token returned
* from the previous call to ListTasks google.cloud.tasks.v2.CloudTasks.ListTasks
* method.
* The page token is valid for only 2 hours.
*/
Expand All @@ -63,7 +63,7 @@ function main(parent) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function listTasks() {
async function callListTasks() {
// Construct request
const request = {
parent,
Expand All @@ -76,7 +76,7 @@ function main(parent) {
}
}

listTasks();
callListTasks();
// [END cloudtasks_v2_generated_CloudTasks_ListTasks_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(name) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function pauseQueue() {
async function callPauseQueue() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

pauseQueue();
callPauseQueue();
// [END cloudtasks_v2_generated_CloudTasks_PauseQueue_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(name) {
// Instantiates a client
const tasksClient = new CloudTasksClient();

async function purgeQueue() {
async function callPurgeQueue() {
// Construct request
const request = {
name,
Expand All @@ -42,7 +42,7 @@ function main(name) {
console.log(response);
}

purgeQueue();
callPurgeQueue();
// [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_async]
}

Expand Down
Loading

0 comments on commit c395de8

Please sign in to comment.