getTaskCallable() {
* 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 completed recently then the call
* will fail 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 completed. 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 completed.
+ * created using Cloud Tasks, then another task with the same name can't be created for ~1
+ * hour after the original task was deleted or completed. 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 ~9
+ * days after the original task was deleted or completed.
*
Because there is an extra lookup cost to identify duplicate task names, these
* [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] calls have significantly
* increased latency. Using hashed strings for the task id or for the prefix of the task id is
@@ -2196,10 +2266,10 @@ public final Task createTask(QueueName parent, Task task) {
*
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 completed recently then the call
* will fail 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 completed. 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 completed.
+ * created using Cloud Tasks, then another task with the same name can't be created for ~1
+ * hour after the original task was deleted or completed. 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 ~9
+ * days after the original task was deleted or completed.
*
Because there is an extra lookup cost to identify duplicate task names, these
* [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] calls have significantly
* increased latency. Using hashed strings for the task id or for the prefix of the task id is
@@ -3328,6 +3398,325 @@ public final UnaryCallable runTaskCallable() {
return stub.runTaskCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue
+ * must have [HTTP target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
+ * custom ID, use the following format and set TASK_ID to your desired ID:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the
+ * task with an automatically generated ID, use the following format:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is
+ * in its experimental stage. You must request access to the API through the [Cloud Tasks
+ * BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * QueueName queue = QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]");
+ * String taskId = "taskId-880873088";
+ * HttpBody body = HttpBody.newBuilder().build();
+ * BufferTaskResponse response = cloudTasksClient.bufferTask(queue, taskId, body);
+ * }
+ * }
+ *
+ * @param queue Required. The parent queue name. For example:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
+ * The queue must already exist.
+ * @param taskId Optional. Task ID for the task being created. If not provided, a random task ID
+ * is assigned to the task.
+ * @param body Optional. Body of the HTTP request.
+ *
The body can take any generic value. The value is written to the [HttpRequest][payload]
+ * of the [Task].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BufferTaskResponse bufferTask(QueueName queue, String taskId, HttpBody body) {
+ BufferTaskRequest request =
+ BufferTaskRequest.newBuilder()
+ .setQueue(queue == null ? null : queue.toString())
+ .setTaskId(taskId)
+ .setBody(body)
+ .build();
+ return bufferTask(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue
+ * must have [HTTP target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
+ * custom ID, use the following format and set TASK_ID to your desired ID:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the
+ * task with an automatically generated ID, use the following format:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is
+ * in its experimental stage. You must request access to the API through the [Cloud Tasks
+ * BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * String queue = QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]").toString();
+ * String taskId = "taskId-880873088";
+ * HttpBody body = HttpBody.newBuilder().build();
+ * BufferTaskResponse response = cloudTasksClient.bufferTask(queue, taskId, body);
+ * }
+ * }
+ *
+ * @param queue Required. The parent queue name. For example:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
+ * The queue must already exist.
+ * @param taskId Optional. Task ID for the task being created. If not provided, a random task ID
+ * is assigned to the task.
+ * @param body Optional. Body of the HTTP request.
+ *
The body can take any generic value. The value is written to the [HttpRequest][payload]
+ * of the [Task].
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BufferTaskResponse bufferTask(String queue, String taskId, HttpBody body) {
+ BufferTaskRequest request =
+ BufferTaskRequest.newBuilder().setQueue(queue).setTaskId(taskId).setBody(body).build();
+ return bufferTask(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue
+ * must have [HTTP target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
+ * custom ID, use the following format and set TASK_ID to your desired ID:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the
+ * task with an automatically generated ID, use the following format:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is
+ * in its experimental stage. You must request access to the API through the [Cloud Tasks
+ * BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * BufferTaskRequest request =
+ * BufferTaskRequest.newBuilder()
+ * .setQueue(QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]").toString())
+ * .setTaskId("taskId-880873088")
+ * .setBody(HttpBody.newBuilder().build())
+ * .build();
+ * BufferTaskResponse response = cloudTasksClient.bufferTask(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BufferTaskResponse bufferTask(BufferTaskRequest request) {
+ return bufferTaskCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue
+ * must have [HTTP target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
+ * custom ID, use the following format and set TASK_ID to your desired ID:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the
+ * task with an automatically generated ID, use the following format:
+ * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is
+ * in its experimental stage. You must request access to the API through the [Cloud Tasks
+ * BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * BufferTaskRequest request =
+ * BufferTaskRequest.newBuilder()
+ * .setQueue(QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]").toString())
+ * .setTaskId("taskId-880873088")
+ * .setBody(HttpBody.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * cloudTasksClient.bufferTaskCallable().futureCall(request);
+ * // Do something.
+ * BufferTaskResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable bufferTaskCallable() {
+ return stub.bufferTaskCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : cloudTasksClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * cloudTasksClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = cloudTasksClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = cloudTasksClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = cloudTasksClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
@Override
public final void close() {
stub.close();
@@ -3495,4 +3884,80 @@ protected ListTasksFixedSizeCollection createCollection(
return new ListTasksFixedSizeCollection(pages, collectionSize);
}
}
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
}
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksSettings.java b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksSettings.java
index 0d109253fed4..4bf2422ea102 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksSettings.java
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksSettings.java
@@ -16,6 +16,7 @@
package com.google.cloud.tasks.v2beta2;
+import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListLocationsPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListQueuesPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListTasksPagedResponse;
@@ -31,6 +32,10 @@
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
import com.google.cloud.tasks.v2beta2.stub.CloudTasksStubSettings;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
@@ -123,6 +128,11 @@ public UnaryCallSettings resumeQueueSettings() {
return ((CloudTasksStubSettings) getStubSettings()).resumeQueueSettings();
}
+ /** Returns the object with the settings used for calls to uploadQueueYaml. */
+ public UnaryCallSettings uploadQueueYamlSettings() {
+ return ((CloudTasksStubSettings) getStubSettings()).uploadQueueYamlSettings();
+ }
+
/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings getIamPolicySettings() {
return ((CloudTasksStubSettings) getStubSettings()).getIamPolicySettings();
@@ -185,6 +195,22 @@ public UnaryCallSettings runTaskSettings() {
return ((CloudTasksStubSettings) getStubSettings()).runTaskSettings();
}
+ /** Returns the object with the settings used for calls to bufferTask. */
+ public UnaryCallSettings bufferTaskSettings() {
+ return ((CloudTasksStubSettings) getStubSettings()).bufferTaskSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((CloudTasksStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((CloudTasksStubSettings) getStubSettings()).getLocationSettings();
+ }
+
public static final CloudTasksSettings create(CloudTasksStubSettings stub) throws IOException {
return new CloudTasksSettings.Builder(stub.toBuilder()).build();
}
@@ -340,6 +366,11 @@ public UnaryCallSettings.Builder resumeQueueSettings(
return getStubSettingsBuilder().resumeQueueSettings();
}
+ /** Returns the builder for the settings used for calls to uploadQueueYaml. */
+ public UnaryCallSettings.Builder uploadQueueYamlSettings() {
+ return getStubSettingsBuilder().uploadQueueYamlSettings();
+ }
+
/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
@@ -402,6 +433,23 @@ public UnaryCallSettings.Builder runTaskSettings() {
return getStubSettingsBuilder().runTaskSettings();
}
+ /** Returns the builder for the settings used for calls to bufferTask. */
+ public UnaryCallSettings.Builder bufferTaskSettings() {
+ return getStubSettingsBuilder().bufferTaskSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
@Override
public CloudTasksSettings build() throws IOException {
return new CloudTasksSettings(this);
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/gapic_metadata.json b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/gapic_metadata.json
index c0501ad8ecdd..05edf09d0640 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/gapic_metadata.json
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/gapic_metadata.json
@@ -13,6 +13,9 @@
"AcknowledgeTask": {
"methods": ["acknowledgeTask", "acknowledgeTask", "acknowledgeTask", "acknowledgeTaskCallable"]
},
+ "BufferTask": {
+ "methods": ["bufferTask", "bufferTask", "bufferTask", "bufferTaskCallable"]
+ },
"CancelLease": {
"methods": ["cancelLease", "cancelLease", "cancelLease", "cancelLeaseCallable"]
},
@@ -31,6 +34,9 @@
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"]
},
+ "GetLocation": {
+ "methods": ["getLocation", "getLocationCallable"]
+ },
"GetQueue": {
"methods": ["getQueue", "getQueue", "getQueue", "getQueueCallable"]
},
@@ -40,6 +46,9 @@
"LeaseTasks": {
"methods": ["leaseTasks", "leaseTasks", "leaseTasks", "leaseTasksCallable"]
},
+ "ListLocations": {
+ "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
+ },
"ListQueues": {
"methods": ["listQueues", "listQueues", "listQueues", "listQueuesPagedCallable", "listQueuesCallable"]
},
@@ -69,6 +78,9 @@
},
"UpdateQueue": {
"methods": ["updateQueue", "updateQueue", "updateQueueCallable"]
+ },
+ "UploadQueueYaml": {
+ "methods": ["uploadQueueYaml", "uploadQueueYamlCallable"]
}
}
}
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStub.java b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStub.java
index 39afe4673d0a..ac361d88b049 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStub.java
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStub.java
@@ -16,13 +16,20 @@
package com.google.cloud.tasks.v2beta2.stub;
+import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListLocationsPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListQueuesPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListTasksPagedResponse;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
import com.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskResponse;
import com.google.cloud.tasks.v2beta2.CancelLeaseRequest;
import com.google.cloud.tasks.v2beta2.CreateQueueRequest;
import com.google.cloud.tasks.v2beta2.CreateTaskRequest;
@@ -44,6 +51,7 @@
import com.google.cloud.tasks.v2beta2.RunTaskRequest;
import com.google.cloud.tasks.v2beta2.Task;
import com.google.cloud.tasks.v2beta2.UpdateQueueRequest;
+import com.google.cloud.tasks.v2beta2.UploadQueueYamlRequest;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -98,6 +106,10 @@ public UnaryCallable resumeQueueCallable() {
throw new UnsupportedOperationException("Not implemented: resumeQueueCallable()");
}
+ public UnaryCallable uploadQueueYamlCallable() {
+ throw new UnsupportedOperationException("Not implemented: uploadQueueYamlCallable()");
+ }
+
public UnaryCallable getIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()");
}
@@ -151,6 +163,23 @@ public UnaryCallable runTaskCallable() {
throw new UnsupportedOperationException("Not implemented: runTaskCallable()");
}
+ public UnaryCallable bufferTaskCallable() {
+ throw new UnsupportedOperationException("Not implemented: bufferTaskCallable()");
+ }
+
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
+ }
+
+ public UnaryCallable listLocationsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsCallable()");
+ }
+
+ public UnaryCallable getLocationCallable() {
+ throw new UnsupportedOperationException("Not implemented: getLocationCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStubSettings.java b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStubSettings.java
index a7a8571c8edb..383f81ae8f1b 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStubSettings.java
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/CloudTasksStubSettings.java
@@ -16,6 +16,7 @@
package com.google.cloud.tasks.v2beta2.stub;
+import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListLocationsPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListQueuesPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListTasksPagedResponse;
@@ -44,7 +45,13 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
import com.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskResponse;
import com.google.cloud.tasks.v2beta2.CancelLeaseRequest;
import com.google.cloud.tasks.v2beta2.CreateQueueRequest;
import com.google.cloud.tasks.v2beta2.CreateTaskRequest;
@@ -66,6 +73,7 @@
import com.google.cloud.tasks.v2beta2.RunTaskRequest;
import com.google.cloud.tasks.v2beta2.Task;
import com.google.cloud.tasks.v2beta2.UpdateQueueRequest;
+import com.google.cloud.tasks.v2beta2.UploadQueueYamlRequest;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -133,6 +141,7 @@ public class CloudTasksStubSettings extends StubSettings
private final UnaryCallSettings purgeQueueSettings;
private final UnaryCallSettings pauseQueueSettings;
private final UnaryCallSettings resumeQueueSettings;
+ private final UnaryCallSettings uploadQueueYamlSettings;
private final UnaryCallSettings getIamPolicySettings;
private final UnaryCallSettings setIamPolicySettings;
private final UnaryCallSettings
@@ -147,6 +156,11 @@ public class CloudTasksStubSettings extends StubSettings
private final UnaryCallSettings renewLeaseSettings;
private final UnaryCallSettings cancelLeaseSettings;
private final UnaryCallSettings runTaskSettings;
+ private final UnaryCallSettings bufferTaskSettings;
+ private final PagedCallSettings<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings getLocationSettings;
private static final PagedListDescriptor
LIST_QUEUES_PAGE_STR_DESC =
@@ -220,6 +234,42 @@ public Iterable extractResources(ListTasksResponse payload) {
}
};
+ private static final PagedListDescriptor
+ LIST_LOCATIONS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) {
+ return ListLocationsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) {
+ return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListLocationsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListLocationsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListLocationsResponse payload) {
+ return payload.getLocationsList() == null
+ ? ImmutableList.of()
+ : payload.getLocationsList();
+ }
+ };
+
private static final PagedListResponseFactory<
ListQueuesRequest, ListQueuesResponse, ListQueuesPagedResponse>
LIST_QUEUES_PAGE_STR_FACT =
@@ -254,6 +304,23 @@ public ApiFuture getFuturePagedResponse(
}
};
+ private static final PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ LIST_LOCATIONS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListLocationsRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context);
+ return ListLocationsPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
/** Returns the object with the settings used for calls to listQueues. */
public PagedCallSettings
listQueuesSettings() {
@@ -295,6 +362,11 @@ public UnaryCallSettings resumeQueueSettings() {
return resumeQueueSettings;
}
+ /** Returns the object with the settings used for calls to uploadQueueYaml. */
+ public UnaryCallSettings uploadQueueYamlSettings() {
+ return uploadQueueYamlSettings;
+ }
+
/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings getIamPolicySettings() {
return getIamPolicySettings;
@@ -357,6 +429,22 @@ public UnaryCallSettings runTaskSettings() {
return runTaskSettings;
}
+ /** Returns the object with the settings used for calls to bufferTask. */
+ public UnaryCallSettings bufferTaskSettings() {
+ return bufferTaskSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return getLocationSettings;
+ }
+
public CloudTasksStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
@@ -471,6 +559,7 @@ protected CloudTasksStubSettings(Builder settingsBuilder) throws IOException {
purgeQueueSettings = settingsBuilder.purgeQueueSettings().build();
pauseQueueSettings = settingsBuilder.pauseQueueSettings().build();
resumeQueueSettings = settingsBuilder.resumeQueueSettings().build();
+ uploadQueueYamlSettings = settingsBuilder.uploadQueueYamlSettings().build();
getIamPolicySettings = settingsBuilder.getIamPolicySettings().build();
setIamPolicySettings = settingsBuilder.setIamPolicySettings().build();
testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build();
@@ -483,6 +572,9 @@ protected CloudTasksStubSettings(Builder settingsBuilder) throws IOException {
renewLeaseSettings = settingsBuilder.renewLeaseSettings().build();
cancelLeaseSettings = settingsBuilder.cancelLeaseSettings().build();
runTaskSettings = settingsBuilder.runTaskSettings().build();
+ bufferTaskSettings = settingsBuilder.bufferTaskSettings().build();
+ listLocationsSettings = settingsBuilder.listLocationsSettings().build();
+ getLocationSettings = settingsBuilder.getLocationSettings().build();
}
/** Builder for CloudTasksStubSettings. */
@@ -498,6 +590,7 @@ public static class Builder extends StubSettings.Builder purgeQueueSettings;
private final UnaryCallSettings.Builder pauseQueueSettings;
private final UnaryCallSettings.Builder resumeQueueSettings;
+ private final UnaryCallSettings.Builder uploadQueueYamlSettings;
private final UnaryCallSettings.Builder getIamPolicySettings;
private final UnaryCallSettings.Builder setIamPolicySettings;
private final UnaryCallSettings.Builder
@@ -514,6 +607,12 @@ public static class Builder extends StubSettings.Builder renewLeaseSettings;
private final UnaryCallSettings.Builder cancelLeaseSettings;
private final UnaryCallSettings.Builder runTaskSettings;
+ private final UnaryCallSettings.Builder
+ bufferTaskSettings;
+ private final PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings.Builder getLocationSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -527,6 +626,7 @@ public static class Builder extends StubSettings.BuildernewArrayList()));
+ definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
@@ -554,6 +654,8 @@ public static class Builder extends StubSettings.Builder>of(
@@ -595,6 +701,7 @@ protected Builder(ClientContext clientContext) {
purgeQueueSettings,
pauseQueueSettings,
resumeQueueSettings,
+ uploadQueueYamlSettings,
getIamPolicySettings,
setIamPolicySettings,
testIamPermissionsSettings,
@@ -606,7 +713,10 @@ protected Builder(ClientContext clientContext) {
acknowledgeTaskSettings,
renewLeaseSettings,
cancelLeaseSettings,
- runTaskSettings);
+ runTaskSettings,
+ bufferTaskSettings,
+ listLocationsSettings,
+ getLocationSettings);
initDefaults(this);
}
@@ -621,6 +731,7 @@ protected Builder(CloudTasksStubSettings settings) {
purgeQueueSettings = settings.purgeQueueSettings.toBuilder();
pauseQueueSettings = settings.pauseQueueSettings.toBuilder();
resumeQueueSettings = settings.resumeQueueSettings.toBuilder();
+ uploadQueueYamlSettings = settings.uploadQueueYamlSettings.toBuilder();
getIamPolicySettings = settings.getIamPolicySettings.toBuilder();
setIamPolicySettings = settings.setIamPolicySettings.toBuilder();
testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder();
@@ -633,6 +744,9 @@ protected Builder(CloudTasksStubSettings settings) {
renewLeaseSettings = settings.renewLeaseSettings.toBuilder();
cancelLeaseSettings = settings.cancelLeaseSettings.toBuilder();
runTaskSettings = settings.runTaskSettings.toBuilder();
+ bufferTaskSettings = settings.bufferTaskSettings.toBuilder();
+ listLocationsSettings = settings.listLocationsSettings.toBuilder();
+ getLocationSettings = settings.getLocationSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -644,6 +758,7 @@ protected Builder(CloudTasksStubSettings settings) {
purgeQueueSettings,
pauseQueueSettings,
resumeQueueSettings,
+ uploadQueueYamlSettings,
getIamPolicySettings,
setIamPolicySettings,
testIamPermissionsSettings,
@@ -655,7 +770,10 @@ protected Builder(CloudTasksStubSettings settings) {
acknowledgeTaskSettings,
renewLeaseSettings,
cancelLeaseSettings,
- runTaskSettings);
+ runTaskSettings,
+ bufferTaskSettings,
+ listLocationsSettings,
+ getLocationSettings);
}
private static Builder createDefault() {
@@ -725,6 +843,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+ builder
+ .uploadQueueYamlSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+
builder
.getIamPolicySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
@@ -785,6 +908,21 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+ builder
+ .bufferTaskSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+
+ builder
+ .listLocationsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .getLocationSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
return builder;
}
@@ -844,6 +982,11 @@ public UnaryCallSettings.Builder resumeQueueSettings(
return resumeQueueSettings;
}
+ /** Returns the builder for the settings used for calls to uploadQueueYaml. */
+ public UnaryCallSettings.Builder uploadQueueYamlSettings() {
+ return uploadQueueYamlSettings;
+ }
+
/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder getIamPolicySettings() {
return getIamPolicySettings;
@@ -906,6 +1049,23 @@ public UnaryCallSettings.Builder runTaskSettings() {
return runTaskSettings;
}
+ /** Returns the builder for the settings used for calls to bufferTask. */
+ public UnaryCallSettings.Builder bufferTaskSettings() {
+ return bufferTaskSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getLocationSettings;
+ }
+
@Override
public CloudTasksStubSettings build() throws IOException {
return new CloudTasksStubSettings(this);
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/GrpcCloudTasksStub.java b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/GrpcCloudTasksStub.java
index a50e3ff1c962..2a3514cf5203 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/GrpcCloudTasksStub.java
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/GrpcCloudTasksStub.java
@@ -16,6 +16,7 @@
package com.google.cloud.tasks.v2beta2.stub;
+import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListLocationsPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListQueuesPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListTasksPagedResponse;
@@ -27,7 +28,13 @@
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
import com.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskResponse;
import com.google.cloud.tasks.v2beta2.CancelLeaseRequest;
import com.google.cloud.tasks.v2beta2.CreateQueueRequest;
import com.google.cloud.tasks.v2beta2.CreateTaskRequest;
@@ -49,6 +56,7 @@
import com.google.cloud.tasks.v2beta2.RunTaskRequest;
import com.google.cloud.tasks.v2beta2.Task;
import com.google.cloud.tasks.v2beta2.UpdateQueueRequest;
+import com.google.cloud.tasks.v2beta2.UploadQueueYamlRequest;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -136,6 +144,16 @@ public class GrpcCloudTasksStub extends CloudTasksStub {
.setResponseMarshaller(ProtoUtils.marshaller(Queue.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ uploadQueueYamlMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.tasks.v2beta2.CloudTasks/UploadQueueYaml")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(UploadQueueYamlRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+
private static final MethodDescriptor getIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
@@ -239,6 +257,34 @@ public class GrpcCloudTasksStub extends CloudTasksStub {
.setResponseMarshaller(ProtoUtils.marshaller(Task.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ bufferTaskMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.tasks.v2beta2.CloudTasks/BufferTask")
+ .setRequestMarshaller(ProtoUtils.marshaller(BufferTaskRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(BufferTaskResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listLocationsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/ListLocations")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor getLocationMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/GetLocation")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
+ .build();
+
private final UnaryCallable listQueuesCallable;
private final UnaryCallable listQueuesPagedCallable;
private final UnaryCallable getQueueCallable;
@@ -248,6 +294,7 @@ public class GrpcCloudTasksStub extends CloudTasksStub {
private final UnaryCallable purgeQueueCallable;
private final UnaryCallable pauseQueueCallable;
private final UnaryCallable resumeQueueCallable;
+ private final UnaryCallable uploadQueueYamlCallable;
private final UnaryCallable getIamPolicyCallable;
private final UnaryCallable setIamPolicyCallable;
private final UnaryCallable
@@ -262,6 +309,11 @@ public class GrpcCloudTasksStub extends CloudTasksStub {
private final UnaryCallable renewLeaseCallable;
private final UnaryCallable cancelLeaseCallable;
private final UnaryCallable runTaskCallable;
+ private final UnaryCallable bufferTaskCallable;
+ private final UnaryCallable listLocationsCallable;
+ private final UnaryCallable
+ listLocationsPagedCallable;
+ private final UnaryCallable getLocationCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
@@ -385,6 +437,10 @@ protected GrpcCloudTasksStub(
return builder.build();
})
.build();
+ GrpcCallSettings uploadQueueYamlTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(uploadQueueYamlMethodDescriptor)
+ .build();
GrpcCallSettings getIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
@@ -506,6 +562,37 @@ protected GrpcCloudTasksStub(
return builder.build();
})
.build();
+ GrpcCallSettings bufferTaskTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(bufferTaskMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("queue", String.valueOf(request.getQueue()));
+ builder.add("task_id", String.valueOf(request.getTaskId()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings listLocationsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listLocationsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getLocationTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getLocationMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
this.listQueuesCallable =
callableFactory.createUnaryCallable(
@@ -534,6 +621,9 @@ protected GrpcCloudTasksStub(
this.resumeQueueCallable =
callableFactory.createUnaryCallable(
resumeQueueTransportSettings, settings.resumeQueueSettings(), clientContext);
+ this.uploadQueueYamlCallable =
+ callableFactory.createUnaryCallable(
+ uploadQueueYamlTransportSettings, settings.uploadQueueYamlSettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
@@ -575,6 +665,18 @@ protected GrpcCloudTasksStub(
this.runTaskCallable =
callableFactory.createUnaryCallable(
runTaskTransportSettings, settings.runTaskSettings(), clientContext);
+ this.bufferTaskCallable =
+ callableFactory.createUnaryCallable(
+ bufferTaskTransportSettings, settings.bufferTaskSettings(), clientContext);
+ this.listLocationsCallable =
+ callableFactory.createUnaryCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.listLocationsPagedCallable =
+ callableFactory.createPagedCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.getLocationCallable =
+ callableFactory.createUnaryCallable(
+ getLocationTransportSettings, settings.getLocationSettings(), clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
@@ -629,6 +731,11 @@ public UnaryCallable resumeQueueCallable() {
return resumeQueueCallable;
}
+ @Override
+ public UnaryCallable uploadQueueYamlCallable() {
+ return uploadQueueYamlCallable;
+ }
+
@Override
public UnaryCallable getIamPolicyCallable() {
return getIamPolicyCallable;
@@ -695,6 +802,27 @@ public UnaryCallable runTaskCallable() {
return runTaskCallable;
}
+ @Override
+ public UnaryCallable bufferTaskCallable() {
+ return bufferTaskCallable;
+ }
+
+ @Override
+ public UnaryCallable listLocationsCallable() {
+ return listLocationsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ return listLocationsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getLocationCallable() {
+ return getLocationCallable;
+ }
+
@Override
public final void close() {
try {
diff --git a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/HttpJsonCloudTasksStub.java b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/HttpJsonCloudTasksStub.java
index 77d4f6228d9c..8f92c97db4a5 100644
--- a/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/HttpJsonCloudTasksStub.java
+++ b/java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/stub/HttpJsonCloudTasksStub.java
@@ -16,6 +16,7 @@
package com.google.cloud.tasks.v2beta2.stub;
+import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListLocationsPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListQueuesPagedResponse;
import static com.google.cloud.tasks.v2beta2.CloudTasksClient.ListTasksPagedResponse;
@@ -32,7 +33,13 @@
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
import com.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskRequest;
+import com.google.cloud.tasks.v2beta2.BufferTaskResponse;
import com.google.cloud.tasks.v2beta2.CancelLeaseRequest;
import com.google.cloud.tasks.v2beta2.CreateQueueRequest;
import com.google.cloud.tasks.v2beta2.CreateTaskRequest;
@@ -54,6 +61,7 @@
import com.google.cloud.tasks.v2beta2.RunTaskRequest;
import com.google.cloud.tasks.v2beta2.Task;
import com.google.cloud.tasks.v2beta2.UpdateQueueRequest;
+import com.google.cloud.tasks.v2beta2.UploadQueueYamlRequest;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -799,6 +807,115 @@ public class HttpJsonCloudTasksStub extends CloudTasksStub {
.build())
.build();
+ private static final ApiMethodDescriptor
+ bufferTaskMethodDescriptor =
+ ApiMethodDescriptor.