diff --git a/packages/google-cloud-tasks/.repo-metadata.json b/packages/google-cloud-tasks/.repo-metadata.json
new file mode 100644
index 00000000000..0a107e35682
--- /dev/null
+++ b/packages/google-cloud-tasks/.repo-metadata.json
@@ -0,0 +1,13 @@
+{
+ "name": "tasks",
+ "name_pretty": "Cloud Tasks",
+ "product_documentation": "https://cloud.google.com/tasks/docs/",
+ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/tasks/latest/",
+ "issue_tracker": "https://issuetracker.google.com/savedsearches/5433985",
+ "release_level": "ga",
+ "language": "nodejs",
+ "repo": "googleapis/nodejs-tasks",
+ "distribution_name": "@google-cloud/tasks",
+ "api_id": "tasks.googleapis.com",
+ "requires_billing": true
+}
diff --git a/packages/google-cloud-tasks/README.md b/packages/google-cloud-tasks/README.md
index 806f22c3da4..fb2b9caf32d 100644
--- a/packages/google-cloud-tasks/README.md
+++ b/packages/google-cloud-tasks/README.md
@@ -1,21 +1,22 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
-[//]: # "To regenerate it, use `npm run generate-scaffolding`."
+[//]: # "To regenerate it, use `python -m synthtool`."
-# [Google Cloud Tasks: Node.js Client](https://github.com/googleapis/nodejs-tasks)
+# [Cloud Tasks: Node.js Client](https://github.com/googleapis/nodejs-tasks)
-[](https://cloud.google.com/terms/launch-stages)
+[](https://cloud.google.com/terms/launch-stages)
[](https://www.npmjs.org/package/@google-cloud/tasks)
[](https://codecov.io/gh/googleapis/nodejs-tasks)
-> Node.js idiomatic client for [Cloud Tasks][product-docs].
-Manages the execution of large numbers of distributed requests.
+
+
+Cloud Tasks API client for Node.js
* [Cloud Tasks Node.js Client API Reference][client-docs]
-* [github.com/googleapis/nodejs-tasks](https://github.com/googleapis/nodejs-tasks)
* [Cloud Tasks Documentation][product-docs]
+* [github.com/googleapis/nodejs-tasks](https://github.com/googleapis/nodejs-tasks)
Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].
@@ -24,60 +25,85 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
**Table of contents:**
-* [Using the client library](#using-the-client-library)
+
+* [Quickstart](#quickstart)
+ * [Before you begin](#before-you-begin)
+ * [Installing the client library](#installing-the-client-library)
+ * [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
-## Using the client library
+## Quickstart
-1. [Select or create a Cloud Platform project][projects].
+### Before you begin
+1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].
-
-1. [Enable the Google Cloud Tasks API][enable_api].
-
+1. [Enable the Cloud Tasks API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.
-1. Install the client library:
+### Installing the client library
+
+```bash
+npm install @google-cloud/tasks
+```
- npm install --save @google-cloud/tasks
-1. Try an example:
+### Using the client library
-```js
-// Imports the Google Cloud client library
-const {CloudTasksClient} = require('@google-cloud/tasks');
+```javascript
+ // Imports the Google Cloud Tasks library.
+ const {CloudTasksClient} = require('@google-cloud/tasks');
-async function quickstart(
- projectId = 'your-project-id', // Your Google Cloud Platform project ID
- queue = 'my-appengine-queue', // Name of the Queue to create
- location = 'us-central-1' // The region in which to create the queue
-) {
- // Instantiates a client
+ // Instantiates a client.
const client = new CloudTasksClient();
- // Send create queue request.
- const [response] = await client.createQueue({
- // The fully qualified path to the location where the queue is created
- parent: client.locationPath(projectId, location),
- queue: {
- // The fully qualified path to the queue
- name: client.queuePath(projectId, location, queue),
- appEngineHttpQueue: {
- appEngineRoutingOverride: {
- // The App Engine service that will receive the tasks.
- service: 'default',
- },
- },
+ // TODO(developer): Uncomment these lines and replace with your values.
+ // const project = 'my-project-id';
+ // const queue = 'my-appengine-queue';
+ // const location = 'us-central1';
+ // const options = {payload: 'hello'};
+
+ // Construct the fully qualified queue name.
+ const parent = client.queuePath(project, location, queue);
+
+ const task = {
+ appEngineHttpRequest: {
+ httpMethod: 'POST',
+ relativeUri: '/log_payload',
},
- });
- console.log(`Created queue ${response.name}`);
-}
+ };
+
+ if (payload) {
+ task.appEngineHttpRequest.body = Buffer.from(payload).toString('base64');
+ }
+
+ if (inSeconds) {
+ task.scheduleTime = {
+ seconds: inSeconds + Date.now() / 1000,
+ };
+ }
+
+ const request = {
+ parent: parent,
+ task: task,
+ };
+
+ console.log('Sending task:');
+ console.log(task);
+ // Send create task request.
+ const [response] = await client.createTask(request);
+ const name = response.name;
+ console.log(`Created task ${name}`);
+
+
```
+
+
## Samples
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-tasks/tree/master/samples) directory. The samples' `README.md`
@@ -85,8 +111,16 @@ has instructions for running the samples.
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
-| Queues | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createQueue.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createQueue.js,samples/README.md) |
-| Tasks | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createTask.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createTask.js,samples/README.md) |
+| Create Http Task | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createHttpTask.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTask.js,samples/README.md) |
+| Create Http Task With Token | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createHttpTaskWithToken.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTaskWithToken.js,samples/README.md) |
+| Create Queue | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createQueue.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createQueue.js,samples/README.md) |
+| Create Task | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createTask.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createTask.js,samples/README.md) |
+| Delete Queue | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/deleteQueue.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/deleteQueue.js,samples/README.md) |
+| List Queues | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/listQueues.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/listQueues.js,samples/README.md) |
+| Quickstart | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
+| Server | [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/server.js,samples/README.md) |
+
+
The [Cloud Tasks Node.js Client API Reference][client-docs] documentation
also contains samples.
@@ -95,9 +129,16 @@ also contains samples.
This library follows [Semantic Versioning](http://semver.org/).
-This library is considered to be in **alpha**. This means it is still a
-work-in-progress and under active development. Any release is subject to
-backwards-incompatible changes at any time.
+
+This library is considered to be **General Availability (GA)**. This means it
+is stable; the code surface will not change in backwards-incompatible ways
+unless absolutely necessary (e.g. because of critical security issues) or with
+an extensive deprecation period. Issues and requests against **GA** libraries
+are addressed with the highest priority.
+
+
+
+
More Information: [Google Cloud Platform Launch Stages][launch_stages]
@@ -119,4 +160,4 @@ See [LICENSE](https://github.com/googleapis/nodejs-tasks/blob/master/LICENSE)
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=tasks.googleapis.com
-[auth]: https://cloud.google.com/docs/authentication/getting-started
+[auth]: https://cloud.google.com/docs/authentication/getting-started
\ No newline at end of file
diff --git a/packages/google-cloud-tasks/package.json b/packages/google-cloud-tasks/package.json
index 69f9ae445f9..43bdc696db3 100644
--- a/packages/google-cloud-tasks/package.json
+++ b/packages/google-cloud-tasks/package.json
@@ -39,7 +39,7 @@
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha system-test/ smoke-test/ --timeout 600000",
"fix": "eslint '**/*.js' --fix",
- "docs-test": "linkinator docs -r --skip www.googleapis.com",
+ "docs-test": "linkinator docs -r --skip 'www.googleapis.com|github.com/googleapis/nodejs-tasks/blob/master/samples/quickstart.js'",
"predocs-test": "npm run docs"
},
"dependencies": {
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/cloudtasks.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/cloudtasks.proto
index dfad1f91e04..e287880c37b 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/cloudtasks.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/cloudtasks.proto
@@ -19,12 +19,12 @@ package google.cloud.tasks.v2;
import "google/api/annotations.proto";
import "google/api/resource.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "google/cloud/tasks/v2/task.proto";
import "google/cloud/tasks/v2/queue.proto";
+import "google/cloud/tasks/v2/task.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
+import "google/protobuf/empty.proto";
+import "google/protobuf/field_mask.proto";
import "google/rpc/code.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks";
@@ -33,7 +33,6 @@ option java_outer_classname = "CloudTasksProto";
option java_package = "com.google.cloud.tasks.v2";
option objc_class_prefix = "TASKS";
-
// Cloud Tasks allows developers to manage the execution of background
// work in their applications.
service CloudTasks {
@@ -62,8 +61,9 @@ service CloudTasks {
// WARNING: Using this method may have unintended side effects if you are
// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
// Read
- // [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- // before using this method.
+ // [Overview of Queue Management and
+ // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ // this method.
rpc CreateQueue(CreateQueueRequest) returns (Queue) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/locations/*}/queues"
@@ -83,8 +83,9 @@ service CloudTasks {
// WARNING: Using this method may have unintended side effects if you are
// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
// Read
- // [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- // before using this method.
+ // [Overview of Queue Management and
+ // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ // this method.
rpc UpdateQueue(UpdateQueueRequest) returns (Queue) {
option (google.api.http) = {
patch: "/v2/{queue.name=projects/*/locations/*/queues/*}"
@@ -102,8 +103,9 @@ service CloudTasks {
// WARNING: Using this method may have unintended side effects if you are
// using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
// Read
- // [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- // before using this method.
+ // [Overview of Queue Management and
+ // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ // this method.
rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/locations/*/queues/*}"
@@ -148,7 +150,8 @@ service CloudTasks {
// WARNING: Resuming many high-QPS queues at the same time can
// lead to target overloading. If you are resuming high-QPS
// queues, follow the 500/50/5 pattern described in
- // [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
+ // [Managing Cloud Tasks Scaling
+ // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
rpc ResumeQueue(ResumeQueueRequest) returns (Queue) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/queues/*}:resume"
@@ -230,8 +233,7 @@ service CloudTasks {
//
// Tasks cannot be updated after creation; there is no UpdateTask command.
//
- // * For [App Engine queues][google.cloud.tasks.v2.AppEngineHttpQueue], the maximum task size is
- // 100KB.
+ // * The maximum task size is 100KB.
rpc CreateTask(CreateTaskRequest) returns (Task) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/locations/*/queues/*}/tasks"
@@ -294,7 +296,8 @@ message ListQueuesRequest {
// 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".
//
@@ -445,13 +448,14 @@ message ListTasksRequest {
// permission on the [Task][google.cloud.tasks.v2.Task] resource.
Task.View response_view = 2;
- // Requested page size. Fewer tasks than requested might be returned.
+ // 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
+ // determine if more tasks exist.
//
- // The maximum page size is 1000. If unspecified, the page size will
- // be the maximum. 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 determine if more tasks exist.
+ // The maximum page size is 1000. If unspecified, the page size will be the
+ // maximum.
int32 page_size = 3;
// A token identifying the page of results to return.
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/queue.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/queue.proto
index b38b6141516..05dd03d07fe 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/queue.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/queue.proto
@@ -28,7 +28,6 @@ option java_multiple_files = true;
option java_outer_classname = "QueueProto";
option java_package = "com.google.cloud.tasks.v2";
-
// A queue is a container of related tasks. Queues are configured to manage
// how those tasks are dispatched. Configurable properties include rate limits,
// retry options, queue types, and others.
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/target.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/target.proto
index 8cf991e97bf..2943a40587e 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/target.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/target.proto
@@ -24,15 +24,11 @@ option java_multiple_files = true;
option java_outer_classname = "TargetProto";
option java_package = "com.google.cloud.tasks.v2";
-
// App Engine HTTP request.
//
// The message defines the HTTP request that is sent to an App Engine app when
// the task is dispatched.
//
-// This proto can only be used for tasks in a queue which has
-// [app_engine_http_queue][Queue.app_engine_http_queue] set.
-//
// Using [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] requires
// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
// Google IAM permission for the project
@@ -78,13 +74,17 @@ option java_package = "com.google.cloud.tasks.v2";
// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
// Task dispatches also do not follow redirects.
//
-// The task attempt has succeeded if the app's request handler returns
-// an HTTP response code in the range [`200` - `299`]. `503` is
-// considered an App Engine system error instead of an application
-// error. Requests returning error `503` will be retried regardless of
-// retry configuration and not counted against retry counts.
-// Any other response code or a failure to receive a response before the
-// deadline is a failed attempt.
+// The task attempt has succeeded if the app's request handler returns an HTTP
+// response code in the range [`200` - `299`]. The task attempt has failed if
+// the app's handler returns a non-2xx response code or Cloud Tasks does
+// not receive response before the [deadline][google.cloud.tasks.v2.Task.dispatch_deadline]. Failed
+// tasks will be retried according to the
+// [retry configuration][Queue.RetryConfig]. `503` (Service Unavailable) is
+// considered an App Engine system error instead of an application error and
+// will cause Cloud Tasks' traffic congestion control to temporarily throttle
+// the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
+// Requests) response from an app handler does not cause traffic congestion
+// control to throttle the queue.
message AppEngineHttpRequest {
// The HTTP method to use for the request. The default is POST.
//
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/task.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/task.proto
index 11be05c46d3..eefcb378c87 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/task.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2/task.proto
@@ -29,7 +29,6 @@ option java_multiple_files = true;
option java_outer_classname = "TaskProto";
option java_package = "com.google.cloud.tasks.v2";
-
// A unit of scheduled work.
message Task {
// The view specifies a subset of [Task][google.cloud.tasks.v2.Task] data.
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/cloudtasks.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/cloudtasks.proto
index bfed3995f7e..66971c3e6b2 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/cloudtasks.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/cloudtasks.proto
@@ -233,8 +233,7 @@ service CloudTasks {
//
// Tasks cannot be updated after creation; there is no UpdateTask command.
//
- // * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], the maximum task size is
- // 100KB.
+ // * The maximum task size is 100KB.
rpc CreateTask(CreateTaskRequest) returns (Task) {
option (google.api.http) = {
post: "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks"
diff --git a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/target.proto b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/target.proto
index 70e9c7153ac..48d7df55f11 100644
--- a/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/target.proto
+++ b/packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta3/target.proto
@@ -26,10 +26,6 @@ option java_package = "com.google.cloud.tasks.v2beta3";
// HTTP request.
//
-// Warning: This is an [alpha](https://cloud.google.com/terms/launch-stages)
-// feature. If you haven't already joined, you can [use this form to sign
-// up](https://docs.google.com/forms/d/e/1FAIpQLSfc4uEy9CBHKYUSdnY1hdhKDCX7julVZHy3imOiR-XrU7bUNQ/viewform).
-//
// The task will be pushed to the worker as an HTTP request. If the worker
// or the redirected worker acknowledges the task by returning a successful HTTP
// response code ([`200` - `299`]), the task will removed from the queue. If
@@ -118,8 +114,8 @@ message HttpRequest {
// will be generated and attached as an `Authorization` header in the HTTP
// request.
//
- // This type of authorization should be used when sending requests to a GCP
- // endpoint.
+ // This type of authorization should generally only be used when calling
+ // Google APIs hosted on *.googleapis.com.
OAuthToken oauth_token = 5;
// If specified, an
@@ -127,8 +123,9 @@ message HttpRequest {
// token will be generated and attached as an `Authorization` header in the
// HTTP request.
//
- // This type of authorization should be used when sending requests to third
- // party endpoints or Cloud Run.
+ // This type of authorization can be used for many scenarios, including
+ // calling Cloud Run, or endpoints where you intend to validate the token
+ // yourself.
OidcToken oidc_token = 6;
}
}
@@ -206,13 +203,17 @@ message AppEngineHttpQueue {
// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
// Task dispatches also do not follow redirects.
//
-// The task attempt has succeeded if the app's request handler returns
-// an HTTP response code in the range [`200` - `299`]. `503` is
-// considered an App Engine system error instead of an application
-// error. Requests returning error `503` will be retried regardless of
-// retry configuration and not counted against retry counts.
-// Any other response code or a failure to receive a response before the
-// deadline is a failed attempt.
+// The task attempt has succeeded if the app's request handler returns an HTTP
+// response code in the range [`200` - `299`]. The task attempt has failed if
+// the app's handler returns a non-2xx response code or Cloud Tasks does
+// not receive response before the [deadline][google.cloud.tasks.v2beta3.Task.dispatch_deadline]. Failed
+// tasks will be retried according to the
+// [retry configuration][Queue.RetryConfig]. `503` (Service Unavailable) is
+// considered an App Engine system error instead of an application error and
+// will cause Cloud Tasks' traffic congestion control to temporarily throttle
+// the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
+// Requests) response from an app handler does not cause traffic congestion
+// control to throttle the queue.
message AppEngineHttpRequest {
// The HTTP method to use for the request. The default is POST.
//
@@ -403,8 +404,8 @@ enum HttpMethod {
// Contains information needed for generating an
// [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
-// This type of authorization should be used when sending requests to a GCP
-// endpoint.
+// This type of authorization should generally only be used when calling Google
+// APIs hosted on *.googleapis.com.
message OAuthToken {
// [Service account email](https://cloud.google.com/iam/docs/service-accounts)
// to be used for generating OAuth token.
@@ -421,9 +422,10 @@ message OAuthToken {
// Contains information needed for generating an
// [OpenID Connect
-// token](https://developers.google.com/identity/protocols/OpenIDConnect). This
-// type of authorization should be used when sending requests to third party
-// endpoints or Cloud Run.
+// token](https://developers.google.com/identity/protocols/OpenIDConnect).
+// This type of authorization can be used for many scenarios, including
+// calling Cloud Run, or endpoints where you intend to validate the token
+// yourself.
message OidcToken {
// [Service account email](https://cloud.google.com/iam/docs/service-accounts)
// to be used for generating OIDC token.
diff --git a/packages/google-cloud-tasks/samples/README.md b/packages/google-cloud-tasks/samples/README.md
index 213e4f681f6..efe1ccf4361 100644
--- a/packages/google-cloud-tasks/samples/README.md
+++ b/packages/google-cloud-tasks/samples/README.md
@@ -1,147 +1,170 @@
-# Node.js Google Cloud Tasks sample for Google App Engine
+[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
+[//]: # "To regenerate it, use `python -m synthtool`."
+
-This sample application shows how to use [Google Cloud Tasks](https://cloud.google.com/cloud-tasks/)
-on [Google App Engine][appengine].
+# [Cloud Tasks: Node.js Samples](https://github.com/googleapis/nodejs-tasks)
-This directory
-contains both the App Engine app to deploy, as well as the snippets to run
-locally to push tasks to it, which could also be called on App Engine.
+[![Open in Cloud Shell][shell_img]][shell_link]
-`createTask.js` is a simple command-line program to create tasks to be pushed to
-the App Engine app.
-`createHttpTask.js` is a simple command-line program to create tasks to be pushed to
-a HTTP endpoint.
-`server.js` is the main App Engine app. This app serves as an endpoint to
-receive App Engine task attempts.
+## Table of Contents
-* [Setup](#setup)
-* [Running locally](#running-locally)
-* [Deploying to App Engine](#deploying-to-app-engine)
-* [Running the tests](#running-the-tests)
+* [Before you begin](#before-you-begin)
+* [Samples](#samples)
+ * [Create Http Task](#create-http-task)
+ * [Create Http Task With Token](#create-http-task-with-token)
+ * [Create Queue](#create-queue)
+ * [Create Task](#create-task)
+ * [Delete Queue](#delete-queue)
+ * [List Queues](#list-queues)
+ * [Quickstart](#quickstart)
+ * [Server](#server)
-## Setup
+## Before you begin
-Before you can run or deploy the sample, you need to do the following:
+Before running the samples, make sure you've followed the steps outlined in
+[Using the client library](https://github.com/googleapis/nodejs-tasks#using-the-client-library).
-1. Refer to the [appengine/README.md][readme] file for instructions on
- running and deploying.
-1. Enable the Cloud Tasks API in the [Google Cloud Console](https://console.cloud.google.com/apis/api/tasks.googleapis.com).
-1. Set up [Google Application Credentials](https://cloud.google.com/docs/authentication/getting-started).
-1. Install dependencies:
+## Samples
- With `npm`:
- npm install
- or with `yarn`:
+### Create Http Task
- yarn install
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createHttpTask.js).
-## Creating a queue
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTask.js,samples/README.md)
-To create a queue using the Cloud SDK, use the following gcloud command:
+__Usage:__
- gcloud beta tasks queues create-app-engine-queue my-appengine-queue
-Note: A newly created queue will route to the default App Engine service and
-version unless configured to do otherwise.
+`node createHttpTask.js`
-## Deploying the app to App Engine
-Deploy to App Engine Standard environment with gcloud:
+-----
- gcloud app deploy
-Verify the index page is serving:
- gcloud app browse
-## Run the Sample Using the Command Line
+### Create Http Task With Token
-Set environment variables:
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createHttpTaskWithToken.js).
-First, your project ID:
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTaskWithToken.js,samples/README.md)
-```
-export PROJECT_ID=my-project-id
-```
+__Usage:__
-Then the queue ID, as specified at queue creation time. Queue IDs already
-created can be listed with `gcloud beta tasks queues list`.
-```
-export QUEUE_ID=my-appengine-queue
-```
+`node createHttpTaskWithToken.js`
-And finally the location ID, which can be discovered with
-`gcloud beta tasks queues describe $QUEUE_ID`, with the location embedded in
-the "name" value (for instance, if the name is
-"projects/my-project/locations/us-central1/queues/my-appengine-queue", then the
-location is "us-central1").
-```
-export LOCATION_ID=us-central1
-```
+-----
-### Using App Engine Queues
-Running the sample will create a task, targeted at the `/log_payload`
-endpoint, with a payload specified:
-```
-node createTask.js $PROJECT_ID $LOCATION_ID $QUEUE_ID hello
-```
-The App Engine app serves as a target for the push requests. It has an
-endpoint `/log_payload` that reads the payload (i.e., the request body) of the
-HTTP POST request and logs it. The log output can be viewed with:
- gcloud app logs read
+### Create Queue
-Create a task that will be scheduled for a time in the future using the
-`--in_seconds` flag:
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createQueue.js).
-```
-node createTask.js $PROJECT_ID $LOCATION_ID $QUEUE_ID hello 30
-```
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createQueue.js,samples/README.md)
-### Using HTTP Push Queues
+__Usage:__
-Set an environment variable for the endpoint to your task handler. This is an
-example url to send requests to the App Engine task handler:
-```
-export URL=https://.appspot.com/log_payload
-```
-Running the sample will create a task and send the task to the specific URL
-endpoint, with a payload specified:
+`node createQueue.js`
-```
-node createHttpTask $PROJECT_ID $LOCATION_ID $QUEUE_ID $URL hello
-```
-## More Info
+-----
-To get usage information: `node createTask.js --help`
-Which prints:
-```
-Options:
- --version Show version number [boolean]
- --location, -l Location of the queue to add the task to. [string] [required]
- --queue, -q ID (short name) of the queue to add the task to. [string] [required]
- --project, -p Project of the queue to add the task to. [string] [required]
- --payload, -d (Optional) Payload to attach to the push queue. [string]
- --inSeconds, -s (Optional) The number of seconds from now to schedule task attempt. [number]
- --help Show help [boolean]
-Examples:
- node createTask.js --project my-project-id
+### Create Task
-For more information, see https://cloud.google.com/cloud-tasks
-```
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/createTask.js).
-[appengine]: https://cloud.google.com/appengine/docs/nodejs
-[appengine-std]: https://cloud.google.com/appengine/docs/standard/nodejs
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createTask.js,samples/README.md)
+
+__Usage:__
+
+
+`node createTask.js`
+
+
+-----
+
+
+
+
+### Delete Queue
+
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/deleteQueue.js).
+
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/deleteQueue.js,samples/README.md)
+
+__Usage:__
+
+
+`node deleteQueue.js`
+
+
+-----
+
+
+
+
+### List Queues
+
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/listQueues.js).
+
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/listQueues.js,samples/README.md)
+
+__Usage:__
+
+
+`node listQueues.js`
+
+
+-----
+
+
+
+
+### Quickstart
+
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/quickstart.js).
+
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/quickstart.js,samples/README.md)
+
+__Usage:__
+
+
+`node quickstart.js`
+
+
+-----
+
+
+
+
+### Server
+
+View the [source code](https://github.com/googleapis/nodejs-tasks/blob/master/samples/server.js).
+
+[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/server.js,samples/README.md)
+
+__Usage:__
+
+
+`node server.js`
+
+
+
+
+
+
+[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
+[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/README.md
+[product-docs]: https://cloud.google.com/tasks/docs/
\ No newline at end of file
diff --git a/packages/google-cloud-tasks/samples/quickstart.js b/packages/google-cloud-tasks/samples/quickstart.js
new file mode 100644
index 00000000000..4c01c6ca3e4
--- /dev/null
+++ b/packages/google-cloud-tasks/samples/quickstart.js
@@ -0,0 +1,70 @@
+/**
+ * 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.
+ * 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';
+
+/**
+ * Create a task for a given queue with an arbitrary payload.
+ */
+async function createTask(project, location, queue, payload, inSeconds) {
+ // [START tasks_quickstart]
+ // Imports the Google Cloud Tasks library.
+ const {CloudTasksClient} = require('@google-cloud/tasks');
+
+ // Instantiates a client.
+ const client = new CloudTasksClient();
+
+ // TODO(developer): Uncomment these lines and replace with your values.
+ // const project = 'my-project-id';
+ // const queue = 'my-appengine-queue';
+ // const location = 'us-central1';
+ // const options = {payload: 'hello'};
+
+ // Construct the fully qualified queue name.
+ const parent = client.queuePath(project, location, queue);
+
+ const task = {
+ appEngineHttpRequest: {
+ httpMethod: 'POST',
+ relativeUri: '/log_payload',
+ },
+ };
+
+ if (payload) {
+ task.appEngineHttpRequest.body = Buffer.from(payload).toString('base64');
+ }
+
+ if (inSeconds) {
+ task.scheduleTime = {
+ seconds: inSeconds + Date.now() / 1000,
+ };
+ }
+
+ const request = {
+ parent: parent,
+ task: task,
+ };
+
+ console.log('Sending task:');
+ console.log(task);
+ // Send create task request.
+ const [response] = await client.createTask(request);
+ const name = response.name;
+ console.log(`Created task ${name}`);
+
+ // [END tasks_quickstart]
+}
+
+createTask(...process.argv.slice(2)).catch(console.error);
diff --git a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.js b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.js
index 0f6e6226d7c..155eb93927b 100644
--- a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.js
+++ b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.js
@@ -236,7 +236,8 @@ class CloudTasksClient {
* 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".
*
@@ -361,7 +362,8 @@ class CloudTasksClient {
* 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".
*
@@ -471,8 +473,9 @@ class CloudTasksClient {
* WARNING: Using this method may have unintended side effects if you are
* using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
* Read
- * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- * before using this method.
+ * [Overview of Queue Management and
+ * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ * this method.
*
* @param {Object} request
* The request object that will be sent.
@@ -557,8 +560,9 @@ class CloudTasksClient {
* WARNING: Using this method may have unintended side effects if you are
* using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
* Read
- * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- * before using this method.
+ * [Overview of Queue Management and
+ * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ * this method.
*
* @param {Object} request
* The request object that will be sent.
@@ -637,8 +641,9 @@ class CloudTasksClient {
* WARNING: Using this method may have unintended side effects if you are
* using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
* Read
- * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml)
- * before using this method.
+ * [Overview of Queue Management and
+ * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
+ * this method.
*
* @param {Object} request
* The request object that will be sent.
@@ -820,7 +825,8 @@ class CloudTasksClient {
* WARNING: Resuming many high-QPS queues at the same time can
* lead to target overloading. If you are resuming high-QPS
* queues, follow the 500/50/5 pattern described in
- * [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
+ * [Managing Cloud Tasks Scaling
+ * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
*
* @param {Object} request
* The request object that will be sent.
@@ -1359,8 +1365,7 @@ class CloudTasksClient {
*
* Tasks cannot be updated after creation; there is no UpdateTask command.
*
- * * For App Engine queues, the maximum task size is
- * 100KB.
+ * * The maximum task size is 100KB.
*
* @param {Object} request
* The request object that will be sent.
diff --git a/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_cloudtasks.js b/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_cloudtasks.js
index 233990f3075..fbd5a7030d8 100644
--- a/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_cloudtasks.js
+++ b/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_cloudtasks.js
@@ -29,7 +29,8 @@
* 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".
*
@@ -262,13 +263,14 @@ const ResumeQueueRequest = {
* The number should be among the values of [View]{@link google.cloud.tasks.v2.View}
*
* @property {number} pageSize
- * Requested page size. Fewer tasks than requested might be returned.
+ * Maximum page size.
*
- * The maximum page size is 1000. If unspecified, the page size will
- * be the maximum. Fewer tasks than requested might be returned,
- * even if more tasks exist; use
- * next_page_token in the
- * response to determine if more tasks exist.
+ * Fewer tasks than requested might be returned, even if more tasks exist; use
+ * 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.
*
* @property {string} pageToken
* A token identifying the page of results to return.
diff --git a/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_target.js b/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_target.js
index 9ecd45d6ccd..e6fb9ee8817 100644
--- a/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_target.js
+++ b/packages/google-cloud-tasks/src/v2/doc/google/cloud/tasks/v2/doc_target.js
@@ -21,9 +21,6 @@
* The message defines the HTTP request that is sent to an App Engine app when
* the task is dispatched.
*
- * This proto can only be used for tasks in a queue which has
- * app_engine_http_queue set.
- *
* Using AppEngineHttpRequest requires
* [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
* Google IAM permission for the project
@@ -69,13 +66,17 @@
* required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
* Task dispatches also do not follow redirects.
*
- * The task attempt has succeeded if the app's request handler returns
- * an HTTP response code in the range [`200` - `299`]. `503` is
- * considered an App Engine system error instead of an application
- * error. Requests returning error `503` will be retried regardless of
- * retry configuration and not counted against retry counts.
- * Any other response code or a failure to receive a response before the
- * deadline is a failed attempt.
+ * The task attempt has succeeded if the app's request handler returns an HTTP
+ * response code in the range [`200` - `299`]. The task attempt has failed if
+ * the app's handler returns a non-2xx response code or Cloud Tasks does
+ * not receive response before the deadline. Failed
+ * tasks will be retried according to the
+ * retry configuration. `503` (Service Unavailable) is
+ * considered an App Engine system error instead of an application error and
+ * will cause Cloud Tasks' traffic congestion control to temporarily throttle
+ * the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
+ * Requests) response from an app handler does not cause traffic congestion
+ * control to throttle the queue.
*
* @property {number} httpMethod
* The HTTP method to use for the request. The default is POST.
diff --git a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.js b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.js
index ce2a882d19a..ef291578008 100644
--- a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.js
+++ b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.js
@@ -1365,8 +1365,7 @@ class CloudTasksClient {
*
* Tasks cannot be updated after creation; there is no UpdateTask command.
*
- * * For App Engine queues, the maximum task size is
- * 100KB.
+ * * The maximum task size is 100KB.
*
* @param {Object} request
* The request object that will be sent.
diff --git a/packages/google-cloud-tasks/src/v2beta3/doc/google/cloud/tasks/v2beta3/doc_target.js b/packages/google-cloud-tasks/src/v2beta3/doc/google/cloud/tasks/v2beta3/doc_target.js
index 9d826a29c56..ecb63ec8792 100644
--- a/packages/google-cloud-tasks/src/v2beta3/doc/google/cloud/tasks/v2beta3/doc_target.js
+++ b/packages/google-cloud-tasks/src/v2beta3/doc/google/cloud/tasks/v2beta3/doc_target.js
@@ -18,10 +18,6 @@
/**
* HTTP request.
*
- * Warning: This is an [alpha](https://cloud.google.com/terms/launch-stages)
- * feature. If you haven't already joined, you can [use this form to sign
- * up](https://docs.google.com/forms/d/e/1FAIpQLSfc4uEy9CBHKYUSdnY1hdhKDCX7julVZHy3imOiR-XrU7bUNQ/viewform).
- *
* The task will be pushed to the worker as an HTTP request. If the worker
* or the redirected worker acknowledges the task by returning a successful HTTP
* response code ([`200` - `299`]), the task will removed from the queue. If
@@ -108,8 +104,8 @@
* will be generated and attached as an `Authorization` header in the HTTP
* request.
*
- * This type of authorization should be used when sending requests to a GCP
- * endpoint.
+ * This type of authorization should generally only be used when calling
+ * Google APIs hosted on *.googleapis.com.
*
* This object should have the same structure as [OAuthToken]{@link google.cloud.tasks.v2beta3.OAuthToken}
*
@@ -119,8 +115,9 @@
* token will be generated and attached as an `Authorization` header in the
* HTTP request.
*
- * This type of authorization should be used when sending requests to third
- * party endpoints or Cloud Run.
+ * This type of authorization can be used for many scenarios, including
+ * calling Cloud Run, or endpoints where you intend to validate the token
+ * yourself.
*
* This object should have the same structure as [OidcToken]{@link google.cloud.tasks.v2beta3.OidcToken}
*
@@ -216,13 +213,17 @@ const AppEngineHttpQueue = {
* required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
* Task dispatches also do not follow redirects.
*
- * The task attempt has succeeded if the app's request handler returns
- * an HTTP response code in the range [`200` - `299`]. `503` is
- * considered an App Engine system error instead of an application
- * error. Requests returning error `503` will be retried regardless of
- * retry configuration and not counted against retry counts.
- * Any other response code or a failure to receive a response before the
- * deadline is a failed attempt.
+ * The task attempt has succeeded if the app's request handler returns an HTTP
+ * response code in the range [`200` - `299`]. The task attempt has failed if
+ * the app's handler returns a non-2xx response code or Cloud Tasks does
+ * not receive response before the deadline. Failed
+ * tasks will be retried according to the
+ * retry configuration. `503` (Service Unavailable) is
+ * considered an App Engine system error instead of an application error and
+ * will cause Cloud Tasks' traffic congestion control to temporarily throttle
+ * the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
+ * Requests) response from an app handler does not cause traffic congestion
+ * control to throttle the queue.
*
* @property {number} httpMethod
* The HTTP method to use for the request. The default is POST.
@@ -406,8 +407,8 @@ const AppEngineRouting = {
/**
* Contains information needed for generating an
* [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
- * This type of authorization should be used when sending requests to a GCP
- * endpoint.
+ * This type of authorization should generally only be used when calling Google
+ * APIs hosted on *.googleapis.com.
*
* @property {string} serviceAccountEmail
* [Service account email](https://cloud.google.com/iam/docs/service-accounts)
@@ -432,9 +433,10 @@ const OAuthToken = {
/**
* Contains information needed for generating an
* [OpenID Connect
- * token](https://developers.google.com/identity/protocols/OpenIDConnect). This
- * type of authorization should be used when sending requests to third party
- * endpoints or Cloud Run.
+ * token](https://developers.google.com/identity/protocols/OpenIDConnect).
+ * This type of authorization can be used for many scenarios, including
+ * calling Cloud Run, or endpoints where you intend to validate the token
+ * yourself.
*
* @property {string} serviceAccountEmail
* [Service account email](https://cloud.google.com/iam/docs/service-accounts)
diff --git a/packages/google-cloud-tasks/synth.metadata b/packages/google-cloud-tasks/synth.metadata
index 7b0f8786f32..be3cc6db5e7 100644
--- a/packages/google-cloud-tasks/synth.metadata
+++ b/packages/google-cloud-tasks/synth.metadata
@@ -1,5 +1,5 @@
{
- "updateTime": "2019-05-11T11:24:21.021732Z",
+ "updateTime": "2019-05-13T20:35:21.669210Z",
"sources": [
{
"generator": {
@@ -12,15 +12,15 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "32b08107fa1710f46287c17d5bb2016e443ed3ba",
- "internalRef": "247684466"
+ "sha": "aa2542389436aabe91ed26e2390039f81af32d00",
+ "internalRef": "247981473"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
- "version": "2019.5.2"
+ "version": "2019.4.10"
}
}
],