Skip to content

Commit 39d3a23

Browse files
authored
chore: Update googleapis hash (incl. mono removal) [ggj] (#793)
* chore: Update googleapis (includes mono removal) * fix: update goldens
1 parent 30a95e9 commit 39d3a23

File tree

7 files changed

+239
-15
lines changed

7 files changed

+239
-15
lines changed

gapic-generator-java/repositories.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def gapic_generator_java_repositories():
5959
_maybe(
6060
http_archive,
6161
name = "com_google_googleapis",
62-
strip_prefix = "googleapis-2c1d1b27646cba6f14b760b635f29fafc5a74ca6",
62+
strip_prefix = "googleapis-efecdbf96311bb705d619459280ffc651b10844a",
6363
urls = [
64-
"https://github.com/googleapis/googleapis/archive/2c1d1b27646cba6f14b760b635f29fafc5a74ca6.zip",
64+
"https://github.com/googleapis/googleapis/archive/efecdbf96311bb705d619459280ffc651b10844a.zip",
6565
],
6666
)
6767

gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/SubscriberClientTest.golden

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,84 @@ public class SubscriberClientTest {
778778
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
779779
mockSubscriber.addResponse(expectedResponse);
780780

781+
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
782+
int maxMessages = 496131527;
783+
784+
PullResponse actualResponse = client.pull(subscription, maxMessages);
785+
Assert.assertEquals(expectedResponse, actualResponse);
786+
787+
List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
788+
Assert.assertEquals(1, actualRequests.size());
789+
PullRequest actualRequest = ((PullRequest) actualRequests.get(0));
790+
791+
Assert.assertEquals(subscription.toString(), actualRequest.getSubscription());
792+
Assert.assertEquals(maxMessages, actualRequest.getMaxMessages());
793+
Assert.assertTrue(
794+
channelProvider.isHeaderSent(
795+
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
796+
GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
797+
}
798+
799+
@Test
800+
public void pullExceptionTest() throws Exception {
801+
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
802+
mockSubscriber.addException(exception);
803+
804+
try {
805+
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
806+
int maxMessages = 496131527;
807+
client.pull(subscription, maxMessages);
808+
Assert.fail("No exception raised");
809+
} catch (InvalidArgumentException e) {
810+
// Expected exception.
811+
}
812+
}
813+
814+
@Test
815+
public void pullTest2() throws Exception {
816+
PullResponse expectedResponse =
817+
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
818+
mockSubscriber.addResponse(expectedResponse);
819+
820+
String subscription = "subscription341203229";
821+
int maxMessages = 496131527;
822+
823+
PullResponse actualResponse = client.pull(subscription, maxMessages);
824+
Assert.assertEquals(expectedResponse, actualResponse);
825+
826+
List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
827+
Assert.assertEquals(1, actualRequests.size());
828+
PullRequest actualRequest = ((PullRequest) actualRequests.get(0));
829+
830+
Assert.assertEquals(subscription, actualRequest.getSubscription());
831+
Assert.assertEquals(maxMessages, actualRequest.getMaxMessages());
832+
Assert.assertTrue(
833+
channelProvider.isHeaderSent(
834+
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
835+
GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
836+
}
837+
838+
@Test
839+
public void pullExceptionTest2() throws Exception {
840+
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
841+
mockSubscriber.addException(exception);
842+
843+
try {
844+
String subscription = "subscription341203229";
845+
int maxMessages = 496131527;
846+
client.pull(subscription, maxMessages);
847+
Assert.fail("No exception raised");
848+
} catch (InvalidArgumentException e) {
849+
// Expected exception.
850+
}
851+
}
852+
853+
@Test
854+
public void pullTest3() throws Exception {
855+
PullResponse expectedResponse =
856+
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
857+
mockSubscriber.addResponse(expectedResponse);
858+
781859
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
782860
boolean returnImmediately = true;
783861
int maxMessages = 496131527;
@@ -799,7 +877,7 @@ public class SubscriberClientTest {
799877
}
800878

801879
@Test
802-
public void pullExceptionTest() throws Exception {
880+
public void pullExceptionTest3() throws Exception {
803881
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
804882
mockSubscriber.addException(exception);
805883

@@ -815,7 +893,7 @@ public class SubscriberClientTest {
815893
}
816894

817895
@Test
818-
public void pullTest2() throws Exception {
896+
public void pullTest4() throws Exception {
819897
PullResponse expectedResponse =
820898
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
821899
mockSubscriber.addResponse(expectedResponse);
@@ -841,7 +919,7 @@ public class SubscriberClientTest {
841919
}
842920

843921
@Test
844-
public void pullExceptionTest2() throws Exception {
922+
public void pullExceptionTest4() throws Exception {
845923
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
846924
mockSubscriber.addException(exception);
847925

@@ -861,6 +939,8 @@ public class SubscriberClientTest {
861939
StreamingPullResponse expectedResponse =
862940
StreamingPullResponse.newBuilder()
863941
.addAllReceivedMessages(new ArrayList<ReceivedMessage>())
942+
.setSubscriptionProperties(
943+
StreamingPullResponse.SubscriptionProperties.newBuilder().build())
864944
.build();
865945
mockSubscriber.addResponse(expectedResponse);
866946
StreamingPullRequest request =

gapic-generator-java/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,9 @@ public final SearchAllResourcesPagedResponse searchAllResources(
11381138
* the searchable fields (except for the included permissions).
11391139
* <li>`resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are
11401140
* set on resources "instance1" or "instance2" and also specify user "amy".
1141+
* <li>`roles:roles/compute.admin` to find IAM policy bindings that specify the Compute
1142+
* Admin role.
1143+
* <li>`memberTypes:user` to find IAM policy bindings that contain the "user" member type.
11411144
* </ul>
11421145
*
11431146
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1164,6 +1167,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope
11641167
* .setQuery("query107944136")
11651168
* .setPageSize(883849137)
11661169
* .setPageToken("pageToken873572522")
1170+
* .addAllAssetTypes(new ArrayList<String>())
1171+
* .setOrderBy("orderBy-1207110587")
11671172
* .build();
11681173
* for (IamPolicySearchResult element :
11691174
* assetServiceClient.searchAllIamPolicies(request).iterateAll()) {
@@ -1196,6 +1201,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
11961201
* .setQuery("query107944136")
11971202
* .setPageSize(883849137)
11981203
* .setPageToken("pageToken873572522")
1204+
* .addAllAssetTypes(new ArrayList<String>())
1205+
* .setOrderBy("orderBy-1207110587")
11991206
* .build();
12001207
* ApiFuture<IamPolicySearchResult> future =
12011208
* assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
@@ -1227,6 +1234,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
12271234
* .setQuery("query107944136")
12281235
* .setPageSize(883849137)
12291236
* .setPageToken("pageToken873572522")
1237+
* .addAllAssetTypes(new ArrayList<String>())
1238+
* .setOrderBy("orderBy-1207110587")
12301239
* .build();
12311240
* while (true) {
12321241
* SearchAllIamPoliciesResponse response =

gapic-generator-java/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,7 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
560560
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
561561
definitions.put(
562562
"retry_policy_2_codes",
563-
ImmutableSet.copyOf(
564-
Lists.<StatusCode.Code>newArrayList(
565-
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
563+
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
566564
definitions.put(
567565
"retry_policy_3_codes",
568566
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
@@ -598,10 +596,10 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
598596
.setInitialRetryDelay(Duration.ofMillis(100L))
599597
.setRetryDelayMultiplier(1.3)
600598
.setMaxRetryDelay(Duration.ofMillis(60000L))
601-
.setInitialRpcTimeout(Duration.ofMillis(15000L))
599+
.setInitialRpcTimeout(Duration.ofMillis(30000L))
602600
.setRpcTimeoutMultiplier(1.0)
603-
.setMaxRpcTimeout(Duration.ofMillis(15000L))
604-
.setTotalTimeout(Duration.ofMillis(15000L))
601+
.setMaxRpcTimeout(Duration.ofMillis(30000L))
602+
.setTotalTimeout(Duration.ofMillis(30000L))
605603
.build();
606604
definitions.put("retry_policy_2_params", settings);
607605
settings =

gapic-generator-java/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,63 @@ public final UnaryCallable<AcknowledgeRequest, Empty> acknowledgeCallable() {
11901190
return stub.acknowledgeCallable();
11911191
}
11921192

1193+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1194+
/**
1195+
* Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
1196+
* concurrent pull requests pending for the given subscription.
1197+
*
1198+
* <p>Sample code:
1199+
*
1200+
* <pre>{@code
1201+
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
1202+
* SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
1203+
* int maxMessages = 496131527;
1204+
* PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
1205+
* }
1206+
* }</pre>
1207+
*
1208+
* @param subscription Required. The subscription from which messages should be pulled. Format is
1209+
* `projects/{project}/subscriptions/{sub}`.
1210+
* @param maxMessages Required. The maximum number of messages to return for this request. Must be
1211+
* a positive integer. The Pub/Sub system may return fewer than the number specified.
1212+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1213+
*/
1214+
public final PullResponse pull(SubscriptionName subscription, int maxMessages) {
1215+
PullRequest request =
1216+
PullRequest.newBuilder()
1217+
.setSubscription(subscription == null ? null : subscription.toString())
1218+
.setMaxMessages(maxMessages)
1219+
.build();
1220+
return pull(request);
1221+
}
1222+
1223+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1224+
/**
1225+
* Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
1226+
* concurrent pull requests pending for the given subscription.
1227+
*
1228+
* <p>Sample code:
1229+
*
1230+
* <pre>{@code
1231+
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
1232+
* String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
1233+
* int maxMessages = 496131527;
1234+
* PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
1235+
* }
1236+
* }</pre>
1237+
*
1238+
* @param subscription Required. The subscription from which messages should be pulled. Format is
1239+
* `projects/{project}/subscriptions/{sub}`.
1240+
* @param maxMessages Required. The maximum number of messages to return for this request. Must be
1241+
* a positive integer. The Pub/Sub system may return fewer than the number specified.
1242+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1243+
*/
1244+
public final PullResponse pull(String subscription, int maxMessages) {
1245+
PullRequest request =
1246+
PullRequest.newBuilder().setSubscription(subscription).setMaxMessages(maxMessages).build();
1247+
return pull(request);
1248+
}
1249+
11931250
// AUTO-GENERATED DOCUMENTATION AND METHOD.
11941251
/**
11951252
* Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many

gapic-generator-java/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,84 @@ public void pullTest() throws Exception {
847847
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
848848
mockSubscriber.addResponse(expectedResponse);
849849

850+
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
851+
int maxMessages = 496131527;
852+
853+
PullResponse actualResponse = client.pull(subscription, maxMessages);
854+
Assert.assertEquals(expectedResponse, actualResponse);
855+
856+
List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
857+
Assert.assertEquals(1, actualRequests.size());
858+
PullRequest actualRequest = ((PullRequest) actualRequests.get(0));
859+
860+
Assert.assertEquals(subscription.toString(), actualRequest.getSubscription());
861+
Assert.assertEquals(maxMessages, actualRequest.getMaxMessages());
862+
Assert.assertTrue(
863+
channelProvider.isHeaderSent(
864+
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
865+
GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
866+
}
867+
868+
@Test
869+
public void pullExceptionTest() throws Exception {
870+
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
871+
mockSubscriber.addException(exception);
872+
873+
try {
874+
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
875+
int maxMessages = 496131527;
876+
client.pull(subscription, maxMessages);
877+
Assert.fail("No exception raised");
878+
} catch (InvalidArgumentException e) {
879+
// Expected exception.
880+
}
881+
}
882+
883+
@Test
884+
public void pullTest2() throws Exception {
885+
PullResponse expectedResponse =
886+
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
887+
mockSubscriber.addResponse(expectedResponse);
888+
889+
String subscription = "subscription341203229";
890+
int maxMessages = 496131527;
891+
892+
PullResponse actualResponse = client.pull(subscription, maxMessages);
893+
Assert.assertEquals(expectedResponse, actualResponse);
894+
895+
List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
896+
Assert.assertEquals(1, actualRequests.size());
897+
PullRequest actualRequest = ((PullRequest) actualRequests.get(0));
898+
899+
Assert.assertEquals(subscription, actualRequest.getSubscription());
900+
Assert.assertEquals(maxMessages, actualRequest.getMaxMessages());
901+
Assert.assertTrue(
902+
channelProvider.isHeaderSent(
903+
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
904+
GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
905+
}
906+
907+
@Test
908+
public void pullExceptionTest2() throws Exception {
909+
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
910+
mockSubscriber.addException(exception);
911+
912+
try {
913+
String subscription = "subscription341203229";
914+
int maxMessages = 496131527;
915+
client.pull(subscription, maxMessages);
916+
Assert.fail("No exception raised");
917+
} catch (InvalidArgumentException e) {
918+
// Expected exception.
919+
}
920+
}
921+
922+
@Test
923+
public void pullTest3() throws Exception {
924+
PullResponse expectedResponse =
925+
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
926+
mockSubscriber.addResponse(expectedResponse);
927+
850928
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
851929
boolean returnImmediately = true;
852930
int maxMessages = 496131527;
@@ -868,7 +946,7 @@ public void pullTest() throws Exception {
868946
}
869947

870948
@Test
871-
public void pullExceptionTest() throws Exception {
949+
public void pullExceptionTest3() throws Exception {
872950
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
873951
mockSubscriber.addException(exception);
874952

@@ -884,7 +962,7 @@ public void pullExceptionTest() throws Exception {
884962
}
885963

886964
@Test
887-
public void pullTest2() throws Exception {
965+
public void pullTest4() throws Exception {
888966
PullResponse expectedResponse =
889967
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList<ReceivedMessage>()).build();
890968
mockSubscriber.addResponse(expectedResponse);
@@ -910,7 +988,7 @@ public void pullTest2() throws Exception {
910988
}
911989

912990
@Test
913-
public void pullExceptionTest2() throws Exception {
991+
public void pullExceptionTest4() throws Exception {
914992
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
915993
mockSubscriber.addException(exception);
916994

@@ -930,6 +1008,8 @@ public void streamingPullTest() throws Exception {
9301008
StreamingPullResponse expectedResponse =
9311009
StreamingPullResponse.newBuilder()
9321010
.addAllReceivedMessages(new ArrayList<ReceivedMessage>())
1011+
.setSubscriptionProperties(
1012+
StreamingPullResponse.SubscriptionProperties.newBuilder().build())
9331013
.build();
9341014
mockSubscriber.addResponse(expectedResponse);
9351015
StreamingPullRequest request =

gapic-generator-java/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/gapic_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"methods": ["modifyPushConfig", "modifyPushConfig", "modifyPushConfig", "modifyPushConfigCallable"]
9393
},
9494
"Pull": {
95-
"methods": ["pull", "pull", "pull", "pullCallable"]
95+
"methods": ["pull", "pull", "pull", "pull", "pull", "pullCallable"]
9696
},
9797
"Seek": {
9898
"methods": ["seek", "seekCallable"]

0 commit comments

Comments
 (0)