@@ -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
0 commit comments