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

Commit 721c8dc

Browse files
gcf-owl-bot[bot]Neenu1995vam-google
authored
fix: update gapic-generator-java with mock service generation fixes (#424)
* feat: generating GAPIC libraries for Google Cloud Functions v2beta PiperOrigin-RevId: 454900284 Source-Link: googleapis/googleapis@05576c8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5b2f0e36d27aa58fbde15d1e7ab7138cf5ea837a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWIyZjBlMzZkMjdhYTU4ZmJkZTE1ZDFlN2FiNzEzOGNmNWVhODM3YSJ9 feat: generating GAPIC libraries for Google Cloud Functions v2alpha PiperOrigin-RevId: 454899846 Source-Link: googleapis/googleapis@7088e38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c3673f892c803b9c3f17841bcdee7db6b3179444 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzM2NzNmODkyYzgwM2I5YzNmMTc4NDFiY2RlZTdkYjZiMzE3OTQ0NCJ9 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 feat: added support for CMEK docs: clarified wording around quota usage Clients can now specify the docker registry to use for storing function Docker images and KMS crypto keys for function source code objects. PiperOrigin-RevId: 453234231 Source-Link: googleapis/googleapis@d180952 Source-Link: https://github.com/googleapis/googleapis-gen/commit/836ff24b7e881ef46acd17836c46ed1a9832b195 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODM2ZmYyNGI3ZTg4MWVmNDZhY2QxNzgzNmM0NmVkMWE5ODMyYjE5NSJ9 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 * 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add grpc-google-iam-v1 * chore: remove unused dependency * 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 * remove proto-google-iam-v1 dependency Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Neenu Shaji <[email protected]> Co-authored-by: Neenu1995 <[email protected]> Co-authored-by: Vadym Matsishevskyi <[email protected]>
1 parent 1238022 commit 721c8dc

File tree

224 files changed

+118578
-254
lines changed

Some content is hidden

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

224 files changed

+118578
-254
lines changed

google-cloud-functions-bom/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,31 @@
6363
<artifactId>grpc-google-cloud-functions-v1</artifactId>
6464
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v1:current} -->
6565
</dependency>
66+
<dependency>
67+
<groupId>com.google.api.grpc</groupId>
68+
<artifactId>grpc-google-cloud-functions-v2beta</artifactId>
69+
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v2beta:current} -->
70+
</dependency>
71+
<dependency>
72+
<groupId>com.google.api.grpc</groupId>
73+
<artifactId>grpc-google-cloud-functions-v2alpha</artifactId>
74+
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-functions-v2alpha:current} -->
75+
</dependency>
6676
<dependency>
6777
<groupId>com.google.api.grpc</groupId>
6878
<artifactId>proto-google-cloud-functions-v1</artifactId>
6979
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v1:current} -->
7080
</dependency>
81+
<dependency>
82+
<groupId>com.google.api.grpc</groupId>
83+
<artifactId>proto-google-cloud-functions-v2beta</artifactId>
84+
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v2beta:current} -->
85+
</dependency>
86+
<dependency>
87+
<groupId>com.google.api.grpc</groupId>
88+
<artifactId>proto-google-cloud-functions-v2alpha</artifactId>
89+
<version>2.4.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-functions-v2alpha:current} -->
90+
</dependency>
7191
</dependencies>
7292
</dependencyManagement>
7393

google-cloud-functions/pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,24 @@
4141
<groupId>com.google.api.grpc</groupId>
4242
<artifactId>proto-google-common-protos</artifactId>
4343
</dependency>
44+
<dependency>
45+
<groupId>com.google.api.grpc</groupId>
46+
<artifactId>grpc-google-common-protos</artifactId>
47+
</dependency>
48+
<dependency>
49+
<groupId>com.google.api.grpc</groupId>
50+
<artifactId>grpc-google-iam-v1</artifactId>
51+
</dependency>
52+
4453

54+
<dependency>
55+
<groupId>com.google.api.grpc</groupId>
56+
<artifactId>proto-google-cloud-functions-v2alpha</artifactId>
57+
</dependency>
58+
<dependency>
59+
<groupId>com.google.api.grpc</groupId>
60+
<artifactId>proto-google-cloud-functions-v2beta</artifactId>
61+
</dependency>
4562
<dependency>
4663
<groupId>com.google.api.grpc</groupId>
4764
<artifactId>proto-google-cloud-functions-v1</artifactId>
@@ -58,6 +75,10 @@
5875
<groupId>com.google.api</groupId>
5976
<artifactId>gax-grpc</artifactId>
6077
</dependency>
78+
<dependency>
79+
<groupId>com.google.api</groupId>
80+
<artifactId>gax-httpjson</artifactId>
81+
</dependency>
6182
<dependency>
6283
<groupId>org.threeten</groupId>
6384
<artifactId>threetenbp</artifactId>
@@ -79,13 +100,35 @@
79100
<artifactId>grpc-google-cloud-functions-v1</artifactId>
80101
<scope>test</scope>
81102
</dependency>
103+
<dependency>
104+
<groupId>com.google.api.grpc</groupId>
105+
<artifactId>grpc-google-cloud-functions-v2alpha</artifactId>
106+
<scope>test</scope>
107+
</dependency>
108+
<dependency>
109+
<groupId>com.google.api.grpc</groupId>
110+
<artifactId>grpc-google-cloud-functions-v2beta</artifactId>
111+
<scope>test</scope>
112+
</dependency>
82113
<!-- Need testing utility classes for generated gRPC clients tests -->
114+
<dependency>
115+
<groupId>com.google.api</groupId>
116+
<artifactId>gax</artifactId>
117+
<classifier>testlib</classifier>
118+
<scope>test</scope>
119+
</dependency>
83120
<dependency>
84121
<groupId>com.google.api</groupId>
85122
<artifactId>gax-grpc</artifactId>
86123
<classifier>testlib</classifier>
87124
<scope>test</scope>
88125
</dependency>
126+
<dependency>
127+
<groupId>com.google.api</groupId>
128+
<artifactId>gax-httpjson</artifactId>
129+
<classifier>testlib</classifier>
130+
<scope>test</scope>
131+
</dependency>
89132
</dependencies>
90133

91134
<profiles>

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.api.core.ApiFutures;
2121
import com.google.api.core.BetaApi;
2222
import com.google.api.gax.core.BackgroundResource;
23+
import com.google.api.gax.httpjson.longrunning.OperationsClient;
2324
import com.google.api.gax.longrunning.OperationFuture;
2425
import com.google.api.gax.paging.AbstractFixedSizeCollection;
2526
import com.google.api.gax.paging.AbstractPage;
@@ -36,7 +37,6 @@
3637
import com.google.iam.v1.TestIamPermissionsRequest;
3738
import com.google.iam.v1.TestIamPermissionsResponse;
3839
import com.google.longrunning.Operation;
39-
import com.google.longrunning.OperationsClient;
4040
import com.google.protobuf.Empty;
4141
import java.io.IOException;
4242
import java.util.List;
@@ -111,13 +111,29 @@
111111
* CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
112112
* }</pre>
113113
*
114+
* <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
115+
* the wire:
116+
*
117+
* <pre>{@code
118+
* // This snippet has been automatically generated for illustrative purposes only.
119+
* // It may require modifications to work in your environment.
120+
* CloudFunctionsServiceSettings cloudFunctionsServiceSettings =
121+
* CloudFunctionsServiceSettings.newBuilder()
122+
* .setTransportChannelProvider(
123+
* CloudFunctionsServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
124+
* .build();
125+
* CloudFunctionsServiceClient cloudFunctionsServiceClient =
126+
* CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
127+
* }</pre>
128+
*
114129
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
115130
*/
116131
@Generated("by gapic-generator-java")
117132
public class CloudFunctionsServiceClient implements BackgroundResource {
118133
private final CloudFunctionsServiceSettings settings;
119134
private final CloudFunctionsServiceStub stub;
120-
private final OperationsClient operationsClient;
135+
private final OperationsClient httpJsonOperationsClient;
136+
private final com.google.longrunning.OperationsClient operationsClient;
121137

122138
/** Constructs an instance of CloudFunctionsServiceClient with default settings. */
123139
public static final CloudFunctionsServiceClient create() throws IOException {
@@ -137,7 +153,6 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceSett
137153
* Constructs an instance of CloudFunctionsServiceClient, using the given stub for making calls.
138154
* This is for advanced usage - prefer using create(CloudFunctionsServiceSettings).
139155
*/
140-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
141156
public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub stub) {
142157
return new CloudFunctionsServiceClient(stub);
143158
}
@@ -150,21 +165,23 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub
150165
protected CloudFunctionsServiceClient(CloudFunctionsServiceSettings settings) throws IOException {
151166
this.settings = settings;
152167
this.stub = ((CloudFunctionsServiceStubSettings) settings.getStubSettings()).createStub();
153-
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
168+
this.operationsClient =
169+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
170+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
154171
}
155172

156-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
157173
protected CloudFunctionsServiceClient(CloudFunctionsServiceStub stub) {
158174
this.settings = null;
159175
this.stub = stub;
160-
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
176+
this.operationsClient =
177+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
178+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
161179
}
162180

163181
public final CloudFunctionsServiceSettings getSettings() {
164182
return settings;
165183
}
166184

167-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
168185
public CloudFunctionsServiceStub getStub() {
169186
return stub;
170187
}
@@ -173,10 +190,19 @@ public CloudFunctionsServiceStub getStub() {
173190
* Returns the OperationsClient that can be used to query the status of a long-running operation
174191
* returned by another API method call.
175192
*/
176-
public final OperationsClient getOperationsClient() {
193+
public final com.google.longrunning.OperationsClient getOperationsClient() {
177194
return operationsClient;
178195
}
179196

197+
/**
198+
* Returns the OperationsClient that can be used to query the status of a long-running operation
199+
* returned by another API method call.
200+
*/
201+
@BetaApi
202+
public final OperationsClient getHttpJsonOperationsClient() {
203+
return httpJsonOperationsClient;
204+
}
205+
180206
// AUTO-GENERATED DOCUMENTATION AND METHOD.
181207
/**
182208
* Returns a list of functions that belong to the requested project.
@@ -259,7 +285,7 @@ public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest reque
259285
* while (true) {
260286
* ListFunctionsResponse response =
261287
* cloudFunctionsServiceClient.listFunctionsCallable().call(request);
262-
* for (CloudFunction element : response.getResponsesList()) {
288+
* for (CloudFunction element : response.getFunctionsList()) {
263289
* // doThingsWith(element);
264290
* }
265291
* String nextPageToken = response.getNextPageToken();
@@ -930,7 +956,12 @@ public final UnaryCallable<CallFunctionRequest, CallFunctionResponse> callFuncti
930956
* try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
931957
* CloudFunctionsServiceClient.create()) {
932958
* GenerateUploadUrlRequest request =
933-
* GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
959+
* GenerateUploadUrlRequest.newBuilder()
960+
* .setParent("parent-995424086")
961+
* .setKmsKeyName(
962+
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
963+
* .toString())
964+
* .build();
934965
* GenerateUploadUrlResponse response = cloudFunctionsServiceClient.generateUploadUrl(request);
935966
* }
936967
* }</pre>
@@ -981,7 +1012,12 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
9811012
* try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
9821013
* CloudFunctionsServiceClient.create()) {
9831014
* GenerateUploadUrlRequest request =
984-
* GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
1015+
* GenerateUploadUrlRequest.newBuilder()
1016+
* .setParent("parent-995424086")
1017+
* .setKmsKeyName(
1018+
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
1019+
* .toString())
1020+
* .build();
9851021
* ApiFuture<GenerateUploadUrlResponse> future =
9861022
* cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request);
9871023
* // Do something.

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.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;
@@ -186,11 +187,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
186187
return CloudFunctionsServiceStubSettings.defaultCredentialsProviderBuilder();
187188
}
188189

189-
/** Returns a builder for the default ChannelProvider for this service. */
190+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
190191
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
191192
return CloudFunctionsServiceStubSettings.defaultGrpcTransportProviderBuilder();
192193
}
193194

195+
/** Returns a builder for the default REST ChannelProvider for this service. */
196+
@BetaApi
197+
public static InstantiatingHttpJsonChannelProvider.Builder
198+
defaultHttpJsonTransportProviderBuilder() {
199+
return CloudFunctionsServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
200+
}
201+
194202
public static TransportChannelProvider defaultTransportChannelProvider() {
195203
return CloudFunctionsServiceStubSettings.defaultTransportChannelProvider();
196204
}
@@ -200,11 +208,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
200208
return CloudFunctionsServiceStubSettings.defaultApiClientHeaderProviderBuilder();
201209
}
202210

203-
/** Returns a new builder for this class. */
211+
/** Returns a new gRPC builder for this class. */
204212
public static Builder newBuilder() {
205213
return Builder.createDefault();
206214
}
207215

216+
/** Returns a new REST builder for this class. */
217+
@BetaApi
218+
public static Builder newHttpJsonBuilder() {
219+
return Builder.createHttpJsonDefault();
220+
}
221+
208222
/** Returns a new builder for this class. */
209223
public static Builder newBuilder(ClientContext clientContext) {
210224
return new Builder(clientContext);
@@ -243,6 +257,11 @@ private static Builder createDefault() {
243257
return new Builder(CloudFunctionsServiceStubSettings.newBuilder());
244258
}
245259

260+
@BetaApi
261+
private static Builder createHttpJsonDefault() {
262+
return new Builder(CloudFunctionsServiceStubSettings.newHttpJsonBuilder());
263+
}
264+
246265
public CloudFunctionsServiceStubSettings.Builder getStubSettingsBuilder() {
247266
return ((CloudFunctionsServiceStubSettings.Builder) getStubSettings());
248267
}

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
/**
18-
* The interfaces provided are listed below, along with usage samples.
18+
* A client to Cloud Functions API
19+
*
20+
* <p>The interfaces provided are listed below, along with usage samples.
1921
*
2022
* <p>======================= CloudFunctionsServiceClient =======================
2123
*

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@
5555
public abstract class CloudFunctionsServiceStub implements BackgroundResource {
5656

5757
public OperationsStub getOperationsStub() {
58-
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
58+
return null;
59+
}
60+
61+
public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
62+
return null;
5963
}
6064

6165
public UnaryCallable<ListFunctionsRequest, ListFunctionsPagedResponse>

0 commit comments

Comments
 (0)