Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat: Enable REST transport for most of Java and Go clients #690

Merged
merged 7 commits into from
Jun 28, 2022
Merged
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-tasks</artifactId>
<version>2.1.11</version>
<version>2.2.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-tasks:2.1.11'
implementation 'com.google.cloud:google-cloud-tasks:2.2.0'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-tasks" % "2.1.11"
libraryDependencies += "com.google.cloud" % "google-cloud-tasks" % "2.2.0"
```

## Authentication
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -130,7 +129,6 @@ public static final CloudTasksClient create(CloudTasksSettings settings) throws
* Constructs an instance of CloudTasksClient, using the given stub for making calls. This is for
* advanced usage - prefer using create(CloudTasksSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final CloudTasksClient create(CloudTasksStub stub) {
return new CloudTasksClient(stub);
}
@@ -144,7 +142,6 @@ protected CloudTasksClient(CloudTasksSettings settings) throws IOException {
this.stub = ((CloudTasksStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected CloudTasksClient(CloudTasksStub stub) {
this.settings = null;
this.stub = stub;
@@ -154,7 +151,6 @@ public final CloudTasksSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub getStub() {
return stub;
}
@@ -300,7 +296,7 @@ public final UnaryCallable<ListQueuesRequest, ListQueuesPagedResponse> listQueue
* .build();
* while (true) {
* ListQueuesResponse response = cloudTasksClient.listQueuesCallable().call(request);
* for (Queue element : response.getResponsesList()) {
* for (Queue element : response.getQueuesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1785,7 +1781,7 @@ public final UnaryCallable<ListTasksRequest, ListTasksPagedResponse> listTasksPa
* .build();
* while (true) {
* ListTasksResponse response = cloudTasksClient.listTasksCallable().call(request);
* for (Task element : response.getResponsesList()) {
* for (Task element : response.getTasksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Original file line number Diff line number Diff line change
@@ -321,7 +321,6 @@ public UnaryCallSettings<RunTaskRequest, Task> runTaskSettings() {
return runTaskSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Original file line number Diff line number Diff line change
@@ -133,7 +133,6 @@ public static final CloudTasksClient create(CloudTasksSettings settings) throws
* Constructs an instance of CloudTasksClient, using the given stub for making calls. This is for
* advanced usage - prefer using create(CloudTasksSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final CloudTasksClient create(CloudTasksStub stub) {
return new CloudTasksClient(stub);
}
@@ -147,7 +146,6 @@ protected CloudTasksClient(CloudTasksSettings settings) throws IOException {
this.stub = ((CloudTasksStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected CloudTasksClient(CloudTasksStub stub) {
this.settings = null;
this.stub = stub;
@@ -157,7 +155,6 @@ public final CloudTasksSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub getStub() {
return stub;
}
@@ -306,7 +303,7 @@ public final UnaryCallable<ListQueuesRequest, ListQueuesPagedResponse> listQueue
* .build();
* while (true) {
* ListQueuesResponse response = cloudTasksClient.listQueuesCallable().call(request);
* for (Queue element : response.getResponsesList()) {
* for (Queue element : response.getQueuesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1797,7 +1794,7 @@ public final UnaryCallable<ListTasksRequest, ListTasksPagedResponse> listTasksPa
* .build();
* while (true) {
* ListTasksResponse response = cloudTasksClient.listTasksCallable().call(request);
* for (Task element : response.getResponsesList()) {
* for (Task element : response.getTasksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Original file line number Diff line number Diff line change
@@ -351,7 +351,6 @@ public UnaryCallSettings<RunTaskRequest, Task> runTaskSettings() {
return runTaskSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Original file line number Diff line number Diff line change
@@ -131,7 +131,6 @@ public static final CloudTasksClient create(CloudTasksSettings settings) throws
* Constructs an instance of CloudTasksClient, using the given stub for making calls. This is for
* advanced usage - prefer using create(CloudTasksSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final CloudTasksClient create(CloudTasksStub stub) {
return new CloudTasksClient(stub);
}
@@ -145,7 +144,6 @@ protected CloudTasksClient(CloudTasksSettings settings) throws IOException {
this.stub = ((CloudTasksStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected CloudTasksClient(CloudTasksStub stub) {
this.settings = null;
this.stub = stub;
@@ -155,7 +153,6 @@ public final CloudTasksSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub getStub() {
return stub;
}
@@ -304,7 +301,7 @@ public final UnaryCallable<ListQueuesRequest, ListQueuesPagedResponse> listQueue
* .build();
* while (true) {
* ListQueuesResponse response = cloudTasksClient.listQueuesCallable().call(request);
* for (Queue element : response.getResponsesList()) {
* for (Queue element : response.getQueuesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1795,7 +1792,7 @@ public final UnaryCallable<ListTasksRequest, ListTasksPagedResponse> listTasksPa
* .build();
* while (true) {
* ListTasksResponse response = cloudTasksClient.listTasksCallable().call(request);
* for (Task element : response.getResponsesList()) {
* for (Task element : response.getTasksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Original file line number Diff line number Diff line change
@@ -322,7 +322,6 @@ public UnaryCallSettings<RunTaskRequest, Task> runTaskSettings() {
return runTaskSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CloudTasksStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()