Skip to content

Commit

Permalink
feat: Enable REST transport for most of Java and Go clients (googleap…
Browse files Browse the repository at this point in the history
…is#182)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 456641589

Source-Link: googleapis/googleapis@8a251f5

Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9
  • Loading branch information
gcf-owl-bot[bot] authored Jun 23, 2022
1 parent 19cdd17 commit ed93b83
Show file tree
Hide file tree
Showing 38 changed files with 4,628 additions and 32 deletions.
4 changes: 2 additions & 2 deletions java-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ If you are using Maven, add this to your pom.xml file:
If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-dataflow:0.6.0'
implementation 'com.google.cloud:google-cloud-dataflow:0.6.1'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-dataflow" % "0.6.0"
libraryDependencies += "com.google.cloud" % "google-cloud-dataflow" % "0.6.1"
```

## Authentication
Expand Down
16 changes: 16 additions & 0 deletions java-dataflow/google-cloud-dataflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
Expand All @@ -77,12 +81,24 @@
<scope>test</scope>
</dependency>
<!-- Need testing utility classes for generated gRPC clients tests -->
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@
* FlexTemplatesServiceClient.create(flexTemplatesServiceSettings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* FlexTemplatesServiceSettings flexTemplatesServiceSettings =
* FlexTemplatesServiceSettings.newBuilder()
* .setTransportChannelProvider(
* FlexTemplatesServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* FlexTemplatesServiceClient flexTemplatesServiceClient =
* FlexTemplatesServiceClient.create(flexTemplatesServiceSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
Expand Down Expand Up @@ -101,11 +102,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return FlexTemplatesServiceStubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return FlexTemplatesServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return FlexTemplatesServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return FlexTemplatesServiceStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -115,11 +123,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return FlexTemplatesServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
/** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new REST builder for this class. */
@BetaApi
public static Builder newHttpJsonBuilder() {
return Builder.createHttpJsonDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
Expand Down Expand Up @@ -158,6 +172,11 @@ private static Builder createDefault() {
return new Builder(FlexTemplatesServiceStubSettings.newBuilder());
}

@BetaApi
private static Builder createHttpJsonDefault() {
return new Builder(FlexTemplatesServiceStubSettings.newHttpJsonBuilder());
}

public FlexTemplatesServiceStubSettings.Builder getStubSettingsBuilder() {
return ((FlexTemplatesServiceStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@
* JobsV1Beta3Client jobsV1Beta3Client = JobsV1Beta3Client.create(jobsV1Beta3Settings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* JobsV1Beta3Settings jobsV1Beta3Settings =
* JobsV1Beta3Settings.newBuilder()
* .setTransportChannelProvider(
* JobsV1Beta3Settings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* JobsV1Beta3Client jobsV1Beta3Client = JobsV1Beta3Client.create(jobsV1Beta3Settings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
Expand Down Expand Up @@ -134,11 +135,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return JobsV1Beta3StubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return JobsV1Beta3StubSettings.defaultGrpcTransportProviderBuilder();
}

/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return JobsV1Beta3StubSettings.defaultHttpJsonTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return JobsV1Beta3StubSettings.defaultTransportChannelProvider();
}
Expand All @@ -148,11 +156,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return JobsV1Beta3StubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
/** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new REST builder for this class. */
@BetaApi
public static Builder newHttpJsonBuilder() {
return Builder.createHttpJsonDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
Expand Down Expand Up @@ -190,6 +204,11 @@ private static Builder createDefault() {
return new Builder(JobsV1Beta3StubSettings.newBuilder());
}

@BetaApi
private static Builder createHttpJsonDefault() {
return new Builder(JobsV1Beta3StubSettings.newHttpJsonBuilder());
}

public JobsV1Beta3StubSettings.Builder getStubSettingsBuilder() {
return ((JobsV1Beta3StubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@
* MessagesV1Beta3Client.create(messagesV1Beta3Settings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* MessagesV1Beta3Settings messagesV1Beta3Settings =
* MessagesV1Beta3Settings.newBuilder()
* .setTransportChannelProvider(
* MessagesV1Beta3Settings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* MessagesV1Beta3Client messagesV1Beta3Client =
* MessagesV1Beta3Client.create(messagesV1Beta3Settings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
Expand Down Expand Up @@ -104,11 +105,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return MessagesV1Beta3StubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return MessagesV1Beta3StubSettings.defaultGrpcTransportProviderBuilder();
}

/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return MessagesV1Beta3StubSettings.defaultHttpJsonTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return MessagesV1Beta3StubSettings.defaultTransportChannelProvider();
}
Expand All @@ -118,11 +126,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return MessagesV1Beta3StubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
/** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new REST builder for this class. */
@BetaApi
public static Builder newHttpJsonBuilder() {
return Builder.createHttpJsonDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
Expand Down Expand Up @@ -160,6 +174,11 @@ private static Builder createDefault() {
return new Builder(MessagesV1Beta3StubSettings.newBuilder());
}

@BetaApi
private static Builder createHttpJsonDefault() {
return new Builder(MessagesV1Beta3StubSettings.newHttpJsonBuilder());
}

public MessagesV1Beta3StubSettings.Builder getStubSettingsBuilder() {
return ((MessagesV1Beta3StubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@
* MetricsV1Beta3Client metricsV1Beta3Client = MetricsV1Beta3Client.create(metricsV1Beta3Settings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* MetricsV1Beta3Settings metricsV1Beta3Settings =
* MetricsV1Beta3Settings.newBuilder()
* .setTransportChannelProvider(
* MetricsV1Beta3Settings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* MetricsV1Beta3Client metricsV1Beta3Client = MetricsV1Beta3Client.create(metricsV1Beta3Settings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
Expand Down Expand Up @@ -119,11 +120,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return MetricsV1Beta3StubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
/** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return MetricsV1Beta3StubSettings.defaultGrpcTransportProviderBuilder();
}

/** Returns a builder for the default REST ChannelProvider for this service. */
@BetaApi
public static InstantiatingHttpJsonChannelProvider.Builder
defaultHttpJsonTransportProviderBuilder() {
return MetricsV1Beta3StubSettings.defaultHttpJsonTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return MetricsV1Beta3StubSettings.defaultTransportChannelProvider();
}
Expand All @@ -133,11 +141,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return MetricsV1Beta3StubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
/** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new REST builder for this class. */
@BetaApi
public static Builder newHttpJsonBuilder() {
return Builder.createHttpJsonDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
Expand Down Expand Up @@ -175,6 +189,11 @@ private static Builder createDefault() {
return new Builder(MetricsV1Beta3StubSettings.newBuilder());
}

@BetaApi
private static Builder createHttpJsonDefault() {
return new Builder(MetricsV1Beta3StubSettings.newHttpJsonBuilder());
}

public MetricsV1Beta3StubSettings.Builder getStubSettingsBuilder() {
return ((MetricsV1Beta3StubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@
* SnapshotsV1Beta3Client.create(snapshotsV1Beta3Settings);
* }</pre>
*
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* SnapshotsV1Beta3Settings snapshotsV1Beta3Settings =
* SnapshotsV1Beta3Settings.newBuilder()
* .setTransportChannelProvider(
* SnapshotsV1Beta3Settings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* SnapshotsV1Beta3Client snapshotsV1Beta3Client =
* SnapshotsV1Beta3Client.create(snapshotsV1Beta3Settings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
Expand Down
Loading

0 comments on commit ed93b83

Please sign in to comment.