Skip to content

Commit

Permalink
fix: update gapic-generator-java with mock service generation fixes (g…
Browse files Browse the repository at this point in the history
…oogleapis#243)

* chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1

PiperOrigin-RevId: 450543911

Source-Link: googleapis/googleapis@5528344

Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f6775cab1958982b88967a43e5e806af0f135db
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Integrate new gapic-generator-java and rules_gapic

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

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

PiperOrigin-RevId: 456641589

Source-Link: googleapis/googleapis@8a251f5

Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update pom.xml

* fix: update gapic-generator-java with mock service generation fixes

PiperOrigin-RevId: 457524730

Source-Link: googleapis/googleapis@917e7f2

Source-Link: https://github.com/googleapis/googleapis-gen/commit/2497f9a069d3f6b2d6810d5a4e239cda1e7e5a39
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ5N2Y5YTA2OWQzZjZiMmQ2ODEwZDVhNGUyMzljZGExZTdlNWEzOSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 28, 2022
1 parent 5246dde commit 466cd18
Show file tree
Hide file tree
Showing 54 changed files with 7,756 additions and 112 deletions.
16 changes: 16 additions & 0 deletions java-appengine-admin/google-cloud-appengine-admin/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 @@ -18,13 +18,13 @@

import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.appengine.v1.stub.ApplicationsStub;
import com.google.appengine.v1.stub.ApplicationsStubSettings;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
Expand Down Expand Up @@ -93,13 +93,28 @@
* ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings);
* }</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.
* ApplicationsSettings applicationsSettings =
* ApplicationsSettings.newBuilder()
* .setTransportChannelProvider(
* ApplicationsSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class ApplicationsClient implements BackgroundResource {
private final ApplicationsSettings settings;
private final ApplicationsStub stub;
private final OperationsClient operationsClient;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;

/** Constructs an instance of ApplicationsClient with default settings. */
public static final ApplicationsClient create() throws IOException {
Expand All @@ -118,7 +133,6 @@ public static final ApplicationsClient create(ApplicationsSettings settings) thr
* Constructs an instance of ApplicationsClient, using the given stub for making calls. This is
* for advanced usage - prefer using create(ApplicationsSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ApplicationsClient create(ApplicationsStub stub) {
return new ApplicationsClient(stub);
}
Expand All @@ -131,21 +145,23 @@ public static final ApplicationsClient create(ApplicationsStub stub) {
protected ApplicationsClient(ApplicationsSettings settings) throws IOException {
this.settings = settings;
this.stub = ((ApplicationsStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected ApplicationsClient(ApplicationsStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

public final ApplicationsSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ApplicationsStub getStub() {
return stub;
}
Expand All @@ -154,10 +170,19 @@ public ApplicationsStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final OperationsClient getOperationsClient() {
public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}

/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi
public final OperationsClient getHttpJsonOperationsClient() {
return httpJsonOperationsClient;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets information about an application.
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 @@ -132,11 +133,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return ApplicationsStubSettings.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 ApplicationsStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return ApplicationsStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -146,11 +154,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return ApplicationsStubSettings.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 @@ -188,6 +202,11 @@ private static Builder createDefault() {
return new Builder(ApplicationsStubSettings.newBuilder());
}

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

public ApplicationsStubSettings.Builder getStubSettingsBuilder() {
return ((ApplicationsStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -108,6 +107,21 @@
* AuthorizedCertificatesClient.create(authorizedCertificatesSettings);
* }</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.
* AuthorizedCertificatesSettings authorizedCertificatesSettings =
* AuthorizedCertificatesSettings.newBuilder()
* .setTransportChannelProvider(
* AuthorizedCertificatesSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* AuthorizedCertificatesClient authorizedCertificatesClient =
* AuthorizedCertificatesClient.create(authorizedCertificatesSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
Expand All @@ -133,7 +147,6 @@ public static final AuthorizedCertificatesClient create(AuthorizedCertificatesSe
* Constructs an instance of AuthorizedCertificatesClient, using the given stub for making calls.
* This is for advanced usage - prefer using create(AuthorizedCertificatesSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final AuthorizedCertificatesClient create(AuthorizedCertificatesStub stub) {
return new AuthorizedCertificatesClient(stub);
}
Expand All @@ -149,7 +162,6 @@ protected AuthorizedCertificatesClient(AuthorizedCertificatesSettings settings)
this.stub = ((AuthorizedCertificatesStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected AuthorizedCertificatesClient(AuthorizedCertificatesStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -159,7 +171,6 @@ public final AuthorizedCertificatesSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AuthorizedCertificatesStub getStub() {
return stub;
}
Expand Down Expand Up @@ -253,7 +264,7 @@ public final ListAuthorizedCertificatesPagedResponse listAuthorizedCertificates(
* while (true) {
* ListAuthorizedCertificatesResponse response =
* authorizedCertificatesClient.listAuthorizedCertificatesCallable().call(request);
* for (AuthorizedCertificate element : response.getResponsesList()) {
* for (AuthorizedCertificate element : response.getCertificatesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
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 @@ -136,11 +137,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return AuthorizedCertificatesStubSettings.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 AuthorizedCertificatesStubSettings.defaultGrpcTransportProviderBuilder();
}

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

public static TransportChannelProvider defaultTransportChannelProvider() {
return AuthorizedCertificatesStubSettings.defaultTransportChannelProvider();
}
Expand All @@ -150,11 +158,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return AuthorizedCertificatesStubSettings.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 @@ -193,6 +207,11 @@ private static Builder createDefault() {
return new Builder(AuthorizedCertificatesStubSettings.newBuilder());
}

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

public AuthorizedCertificatesStubSettings.Builder getStubSettingsBuilder() {
return ((AuthorizedCertificatesStubSettings.Builder) getStubSettings());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -110,6 +109,21 @@
* AuthorizedDomainsClient.create(authorizedDomainsSettings);
* }</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.
* AuthorizedDomainsSettings authorizedDomainsSettings =
* AuthorizedDomainsSettings.newBuilder()
* .setTransportChannelProvider(
* AuthorizedDomainsSettings.defaultHttpJsonTransportProviderBuilder().build())
* .build();
* AuthorizedDomainsClient authorizedDomainsClient =
* AuthorizedDomainsClient.create(authorizedDomainsSettings);
* }</pre>
*
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
Expand All @@ -135,7 +149,6 @@ public static final AuthorizedDomainsClient create(AuthorizedDomainsSettings set
* Constructs an instance of AuthorizedDomainsClient, using the given stub for making calls. This
* is for advanced usage - prefer using create(AuthorizedDomainsSettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final AuthorizedDomainsClient create(AuthorizedDomainsStub stub) {
return new AuthorizedDomainsClient(stub);
}
Expand All @@ -150,7 +163,6 @@ protected AuthorizedDomainsClient(AuthorizedDomainsSettings settings) throws IOE
this.stub = ((AuthorizedDomainsStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected AuthorizedDomainsClient(AuthorizedDomainsStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -160,7 +172,6 @@ public final AuthorizedDomainsSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public AuthorizedDomainsStub getStub() {
return stub;
}
Expand Down Expand Up @@ -245,7 +256,7 @@ public final ListAuthorizedDomainsPagedResponse listAuthorizedDomains(
* while (true) {
* ListAuthorizedDomainsResponse response =
* authorizedDomainsClient.listAuthorizedDomainsCallable().call(request);
* for (AuthorizedDomain element : response.getResponsesList()) {
* for (AuthorizedDomain element : response.getDomainsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Loading

0 comments on commit 466cd18

Please sign in to comment.