Skip to content

Commit 466cd18

Browse files
fix: update gapic-generator-java with mock service generation fixes (#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 <[email protected]>
1 parent 5246dde commit 466cd18

File tree

54 files changed

+7756
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7756
-112
lines changed

java-appengine-admin/google-cloud-appengine-admin/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<groupId>com.google.api</groupId>
5959
<artifactId>gax-grpc</artifactId>
6060
</dependency>
61+
<dependency>
62+
<groupId>com.google.api</groupId>
63+
<artifactId>gax-httpjson</artifactId>
64+
</dependency>
6165
<dependency>
6266
<groupId>org.threeten</groupId>
6367
<artifactId>threetenbp</artifactId>
@@ -77,12 +81,24 @@
7781
<scope>test</scope>
7882
</dependency>
7983
<!-- Need testing utility classes for generated gRPC clients tests -->
84+
<dependency>
85+
<groupId>com.google.api</groupId>
86+
<artifactId>gax</artifactId>
87+
<classifier>testlib</classifier>
88+
<scope>test</scope>
89+
</dependency>
8090
<dependency>
8191
<groupId>com.google.api</groupId>
8292
<artifactId>gax-grpc</artifactId>
8393
<classifier>testlib</classifier>
8494
<scope>test</scope>
8595
</dependency>
96+
<dependency>
97+
<groupId>com.google.api</groupId>
98+
<artifactId>gax-httpjson</artifactId>
99+
<classifier>testlib</classifier>
100+
<scope>test</scope>
101+
</dependency>
86102
</dependencies>
87103

88104
<profiles>

java-appengine-admin/google-cloud-appengine-admin/src/main/java/com/google/appengine/v1/ApplicationsClient.java

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
import com.google.api.core.BetaApi;
2020
import com.google.api.gax.core.BackgroundResource;
21+
import com.google.api.gax.httpjson.longrunning.OperationsClient;
2122
import com.google.api.gax.longrunning.OperationFuture;
2223
import com.google.api.gax.rpc.OperationCallable;
2324
import com.google.api.gax.rpc.UnaryCallable;
2425
import com.google.appengine.v1.stub.ApplicationsStub;
2526
import com.google.appengine.v1.stub.ApplicationsStubSettings;
2627
import com.google.longrunning.Operation;
27-
import com.google.longrunning.OperationsClient;
2828
import java.io.IOException;
2929
import java.util.concurrent.TimeUnit;
3030
import javax.annotation.Generated;
@@ -93,13 +93,28 @@
9393
* ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings);
9494
* }</pre>
9595
*
96+
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
97+
* the wire:
98+
*
99+
* <pre>{@code
100+
* // This snippet has been automatically generated for illustrative purposes only.
101+
* // It may require modifications to work in your environment.
102+
* ApplicationsSettings applicationsSettings =
103+
* ApplicationsSettings.newBuilder()
104+
* .setTransportChannelProvider(
105+
* ApplicationsSettings.defaultHttpJsonTransportProviderBuilder().build())
106+
* .build();
107+
* ApplicationsClient applicationsClient = ApplicationsClient.create(applicationsSettings);
108+
* }</pre>
109+
*
96110
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
97111
*/
98112
@Generated("by gapic-generator-java")
99113
public class ApplicationsClient implements BackgroundResource {
100114
private final ApplicationsSettings settings;
101115
private final ApplicationsStub stub;
102-
private final OperationsClient operationsClient;
116+
private final OperationsClient httpJsonOperationsClient;
117+
private final com.google.longrunning.OperationsClient operationsClient;
103118

104119
/** Constructs an instance of ApplicationsClient with default settings. */
105120
public static final ApplicationsClient create() throws IOException {
@@ -118,7 +133,6 @@ public static final ApplicationsClient create(ApplicationsSettings settings) thr
118133
* Constructs an instance of ApplicationsClient, using the given stub for making calls. This is
119134
* for advanced usage - prefer using create(ApplicationsSettings).
120135
*/
121-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
122136
public static final ApplicationsClient create(ApplicationsStub stub) {
123137
return new ApplicationsClient(stub);
124138
}
@@ -131,21 +145,23 @@ public static final ApplicationsClient create(ApplicationsStub stub) {
131145
protected ApplicationsClient(ApplicationsSettings settings) throws IOException {
132146
this.settings = settings;
133147
this.stub = ((ApplicationsStubSettings) settings.getStubSettings()).createStub();
134-
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
148+
this.operationsClient =
149+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
150+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
135151
}
136152

137-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
138153
protected ApplicationsClient(ApplicationsStub stub) {
139154
this.settings = null;
140155
this.stub = stub;
141-
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
156+
this.operationsClient =
157+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
158+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
142159
}
143160

144161
public final ApplicationsSettings getSettings() {
145162
return settings;
146163
}
147164

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

177+
/**
178+
* Returns the OperationsClient that can be used to query the status of a long-running operation
179+
* returned by another API method call.
180+
*/
181+
@BetaApi
182+
public final OperationsClient getHttpJsonOperationsClient() {
183+
return httpJsonOperationsClient;
184+
}
185+
161186
// AUTO-GENERATED DOCUMENTATION AND METHOD.
162187
/**
163188
* Gets information about an application.

java-appengine-admin/google-cloud-appengine-admin/src/main/java/com/google/appengine/v1/ApplicationsSettings.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.google.api.gax.core.GoogleCredentialsProvider;
2222
import com.google.api.gax.core.InstantiatingExecutorProvider;
2323
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
24+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
2425
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2526
import com.google.api.gax.rpc.ClientContext;
2627
import com.google.api.gax.rpc.ClientSettings;
@@ -132,11 +133,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
132133
return ApplicationsStubSettings.defaultCredentialsProviderBuilder();
133134
}
134135

135-
/** Returns a builder for the default ChannelProvider for this service. */
136+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
136137
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
137138
return ApplicationsStubSettings.defaultGrpcTransportProviderBuilder();
138139
}
139140

141+
/** Returns a builder for the default REST ChannelProvider for this service. */
142+
@BetaApi
143+
public static InstantiatingHttpJsonChannelProvider.Builder
144+
defaultHttpJsonTransportProviderBuilder() {
145+
return ApplicationsStubSettings.defaultHttpJsonTransportProviderBuilder();
146+
}
147+
140148
public static TransportChannelProvider defaultTransportChannelProvider() {
141149
return ApplicationsStubSettings.defaultTransportChannelProvider();
142150
}
@@ -146,11 +154,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
146154
return ApplicationsStubSettings.defaultApiClientHeaderProviderBuilder();
147155
}
148156

149-
/** Returns a new builder for this class. */
157+
/** Returns a new gRPC builder for this class. */
150158
public static Builder newBuilder() {
151159
return Builder.createDefault();
152160
}
153161

162+
/** Returns a new REST builder for this class. */
163+
@BetaApi
164+
public static Builder newHttpJsonBuilder() {
165+
return Builder.createHttpJsonDefault();
166+
}
167+
154168
/** Returns a new builder for this class. */
155169
public static Builder newBuilder(ClientContext clientContext) {
156170
return new Builder(clientContext);
@@ -188,6 +202,11 @@ private static Builder createDefault() {
188202
return new Builder(ApplicationsStubSettings.newBuilder());
189203
}
190204

205+
@BetaApi
206+
private static Builder createHttpJsonDefault() {
207+
return new Builder(ApplicationsStubSettings.newHttpJsonBuilder());
208+
}
209+
191210
public ApplicationsStubSettings.Builder getStubSettingsBuilder() {
192211
return ((ApplicationsStubSettings.Builder) getStubSettings());
193212
}

java-appengine-admin/google-cloud-appengine-admin/src/main/java/com/google/appengine/v1/AuthorizedCertificatesClient.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.ApiFutures;
21-
import com.google.api.core.BetaApi;
2221
import com.google.api.gax.core.BackgroundResource;
2322
import com.google.api.gax.paging.AbstractFixedSizeCollection;
2423
import com.google.api.gax.paging.AbstractPage;
@@ -108,6 +107,21 @@
108107
* AuthorizedCertificatesClient.create(authorizedCertificatesSettings);
109108
* }</pre>
110109
*
110+
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
111+
* the wire:
112+
*
113+
* <pre>{@code
114+
* // This snippet has been automatically generated for illustrative purposes only.
115+
* // It may require modifications to work in your environment.
116+
* AuthorizedCertificatesSettings authorizedCertificatesSettings =
117+
* AuthorizedCertificatesSettings.newBuilder()
118+
* .setTransportChannelProvider(
119+
* AuthorizedCertificatesSettings.defaultHttpJsonTransportProviderBuilder().build())
120+
* .build();
121+
* AuthorizedCertificatesClient authorizedCertificatesClient =
122+
* AuthorizedCertificatesClient.create(authorizedCertificatesSettings);
123+
* }</pre>
124+
*
111125
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
112126
*/
113127
@Generated("by gapic-generator-java")
@@ -133,7 +147,6 @@ public static final AuthorizedCertificatesClient create(AuthorizedCertificatesSe
133147
* Constructs an instance of AuthorizedCertificatesClient, using the given stub for making calls.
134148
* This is for advanced usage - prefer using create(AuthorizedCertificatesSettings).
135149
*/
136-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
137150
public static final AuthorizedCertificatesClient create(AuthorizedCertificatesStub stub) {
138151
return new AuthorizedCertificatesClient(stub);
139152
}
@@ -149,7 +162,6 @@ protected AuthorizedCertificatesClient(AuthorizedCertificatesSettings settings)
149162
this.stub = ((AuthorizedCertificatesStubSettings) settings.getStubSettings()).createStub();
150163
}
151164

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

162-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
163174
public AuthorizedCertificatesStub getStub() {
164175
return stub;
165176
}
@@ -253,7 +264,7 @@ public final ListAuthorizedCertificatesPagedResponse listAuthorizedCertificates(
253264
* while (true) {
254265
* ListAuthorizedCertificatesResponse response =
255266
* authorizedCertificatesClient.listAuthorizedCertificatesCallable().call(request);
256-
* for (AuthorizedCertificate element : response.getResponsesList()) {
267+
* for (AuthorizedCertificate element : response.getCertificatesList()) {
257268
* // doThingsWith(element);
258269
* }
259270
* String nextPageToken = response.getNextPageToken();

java-appengine-admin/google-cloud-appengine-admin/src/main/java/com/google/appengine/v1/AuthorizedCertificatesSettings.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.google.api.gax.core.GoogleCredentialsProvider;
2424
import com.google.api.gax.core.InstantiatingExecutorProvider;
2525
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
26+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
2627
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2728
import com.google.api.gax.rpc.ClientContext;
2829
import com.google.api.gax.rpc.ClientSettings;
@@ -136,11 +137,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
136137
return AuthorizedCertificatesStubSettings.defaultCredentialsProviderBuilder();
137138
}
138139

139-
/** Returns a builder for the default ChannelProvider for this service. */
140+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
140141
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
141142
return AuthorizedCertificatesStubSettings.defaultGrpcTransportProviderBuilder();
142143
}
143144

145+
/** Returns a builder for the default REST ChannelProvider for this service. */
146+
@BetaApi
147+
public static InstantiatingHttpJsonChannelProvider.Builder
148+
defaultHttpJsonTransportProviderBuilder() {
149+
return AuthorizedCertificatesStubSettings.defaultHttpJsonTransportProviderBuilder();
150+
}
151+
144152
public static TransportChannelProvider defaultTransportChannelProvider() {
145153
return AuthorizedCertificatesStubSettings.defaultTransportChannelProvider();
146154
}
@@ -150,11 +158,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
150158
return AuthorizedCertificatesStubSettings.defaultApiClientHeaderProviderBuilder();
151159
}
152160

153-
/** Returns a new builder for this class. */
161+
/** Returns a new gRPC builder for this class. */
154162
public static Builder newBuilder() {
155163
return Builder.createDefault();
156164
}
157165

166+
/** Returns a new REST builder for this class. */
167+
@BetaApi
168+
public static Builder newHttpJsonBuilder() {
169+
return Builder.createHttpJsonDefault();
170+
}
171+
158172
/** Returns a new builder for this class. */
159173
public static Builder newBuilder(ClientContext clientContext) {
160174
return new Builder(clientContext);
@@ -193,6 +207,11 @@ private static Builder createDefault() {
193207
return new Builder(AuthorizedCertificatesStubSettings.newBuilder());
194208
}
195209

210+
@BetaApi
211+
private static Builder createHttpJsonDefault() {
212+
return new Builder(AuthorizedCertificatesStubSettings.newHttpJsonBuilder());
213+
}
214+
196215
public AuthorizedCertificatesStubSettings.Builder getStubSettingsBuilder() {
197216
return ((AuthorizedCertificatesStubSettings.Builder) getStubSettings());
198217
}

java-appengine-admin/google-cloud-appengine-admin/src/main/java/com/google/appengine/v1/AuthorizedDomainsClient.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.ApiFutures;
21-
import com.google.api.core.BetaApi;
2221
import com.google.api.gax.core.BackgroundResource;
2322
import com.google.api.gax.paging.AbstractFixedSizeCollection;
2423
import com.google.api.gax.paging.AbstractPage;
@@ -110,6 +109,21 @@
110109
* AuthorizedDomainsClient.create(authorizedDomainsSettings);
111110
* }</pre>
112111
*
112+
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
113+
* the wire:
114+
*
115+
* <pre>{@code
116+
* // This snippet has been automatically generated for illustrative purposes only.
117+
* // It may require modifications to work in your environment.
118+
* AuthorizedDomainsSettings authorizedDomainsSettings =
119+
* AuthorizedDomainsSettings.newBuilder()
120+
* .setTransportChannelProvider(
121+
* AuthorizedDomainsSettings.defaultHttpJsonTransportProviderBuilder().build())
122+
* .build();
123+
* AuthorizedDomainsClient authorizedDomainsClient =
124+
* AuthorizedDomainsClient.create(authorizedDomainsSettings);
125+
* }</pre>
126+
*
113127
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
114128
*/
115129
@Generated("by gapic-generator-java")
@@ -135,7 +149,6 @@ public static final AuthorizedDomainsClient create(AuthorizedDomainsSettings set
135149
* Constructs an instance of AuthorizedDomainsClient, using the given stub for making calls. This
136150
* is for advanced usage - prefer using create(AuthorizedDomainsSettings).
137151
*/
138-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
139152
public static final AuthorizedDomainsClient create(AuthorizedDomainsStub stub) {
140153
return new AuthorizedDomainsClient(stub);
141154
}
@@ -150,7 +163,6 @@ protected AuthorizedDomainsClient(AuthorizedDomainsSettings settings) throws IOE
150163
this.stub = ((AuthorizedDomainsStubSettings) settings.getStubSettings()).createStub();
151164
}
152165

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

163-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
164175
public AuthorizedDomainsStub getStub() {
165176
return stub;
166177
}
@@ -245,7 +256,7 @@ public final ListAuthorizedDomainsPagedResponse listAuthorizedDomains(
245256
* while (true) {
246257
* ListAuthorizedDomainsResponse response =
247258
* authorizedDomainsClient.listAuthorizedDomainsCallable().call(request);
248-
* for (AuthorizedDomain element : response.getResponsesList()) {
259+
* for (AuthorizedDomain element : response.getDomainsList()) {
249260
* // doThingsWith(element);
250261
* }
251262
* String nextPageToken = response.getNextPageToken();

0 commit comments

Comments
 (0)