Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
chore: update java microgenerator to 1.0.2 Adds request initializatio…
Browse files Browse the repository at this point in the history
…n to sample code (#348)

Committer: @miraleung
PiperOrigin-RevId: 362856902

Source-Author: Google APIs <noreply@google.com>
Source-Date: Sun Mar 14 20:47:20 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 1305ca41d554eb0725237561e34129373bb8cbc1
Source-Link: googleapis/googleapis@1305ca4
  • Loading branch information
yoshi-automation committed Mar 15, 2021
1 parent e5beb80 commit b6381a2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 39 deletions.
Expand Up @@ -492,6 +492,12 @@ public final ListConnectionsPagedResponse listConnections(ListConnectionsRequest
*
* <pre>{@code
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ListConnectionsRequest request =
* ListConnectionsRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListConnectionsResponse response =
* connectionServiceClient.listConnectionsCallable().call(request);
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void reset() {
public void createConnection(
ConnectionProto.CreateConnectionRequest request,
StreamObserver<ConnectionProto.Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ConnectionProto.Connection) {
requests.add(request);
responseObserver.onNext(((ConnectionProto.Connection) response));
Expand All @@ -80,7 +80,7 @@ public void createConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ConnectionProto.Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -90,7 +90,7 @@ public void createConnection(
public void getConnection(
ConnectionProto.GetConnectionRequest request,
StreamObserver<ConnectionProto.Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ConnectionProto.Connection) {
requests.add(request);
responseObserver.onNext(((ConnectionProto.Connection) response));
Expand All @@ -102,7 +102,7 @@ public void getConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ConnectionProto.Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -112,7 +112,7 @@ public void getConnection(
public void listConnections(
ConnectionProto.ListConnectionsRequest request,
StreamObserver<ConnectionProto.ListConnectionsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ConnectionProto.ListConnectionsResponse) {
requests.add(request);
responseObserver.onNext(((ConnectionProto.ListConnectionsResponse) response));
Expand All @@ -124,7 +124,7 @@ public void listConnections(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListConnections, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ConnectionProto.ListConnectionsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -134,7 +134,7 @@ public void listConnections(
public void updateConnection(
ConnectionProto.UpdateConnectionRequest request,
StreamObserver<ConnectionProto.Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ConnectionProto.Connection) {
requests.add(request);
responseObserver.onNext(((ConnectionProto.Connection) response));
Expand All @@ -146,7 +146,7 @@ public void updateConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ConnectionProto.Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -156,7 +156,7 @@ public void updateConnection(
public void updateConnectionCredential(
ConnectionProto.UpdateConnectionCredentialRequest request,
StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -168,7 +168,7 @@ public void updateConnectionCredential(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateConnectionCredential, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
Expand All @@ -177,7 +177,7 @@ public void updateConnectionCredential(
@Override
public void deleteConnection(
ConnectionProto.DeleteConnectionRequest request, StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -189,15 +189,15 @@ public void deleteConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -209,15 +209,15 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetIamPolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
}

@Override
public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -229,7 +229,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method SetIamPolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
Expand All @@ -239,7 +239,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
public void testIamPermissions(
TestIamPermissionsRequest request,
StreamObserver<TestIamPermissionsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TestIamPermissionsResponse) {
requests.add(request);
responseObserver.onNext(((TestIamPermissionsResponse) response));
Expand All @@ -251,7 +251,7 @@ public void testIamPermissions(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method TestIamPermissions, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TestIamPermissionsResponse.class.getName(),
Exception.class.getName())));
}
Expand Down
Expand Up @@ -74,7 +74,7 @@ public void reset() {
@Override
public void createConnection(
CreateConnectionRequest request, StreamObserver<Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Connection) {
requests.add(request);
responseObserver.onNext(((Connection) response));
Expand All @@ -86,7 +86,7 @@ public void createConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -95,7 +95,7 @@ public void createConnection(
@Override
public void getConnection(
GetConnectionRequest request, StreamObserver<Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Connection) {
requests.add(request);
responseObserver.onNext(((Connection) response));
Expand All @@ -107,7 +107,7 @@ public void getConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -116,7 +116,7 @@ public void getConnection(
@Override
public void listConnections(
ListConnectionsRequest request, StreamObserver<ListConnectionsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListConnectionsResponse) {
requests.add(request);
responseObserver.onNext(((ListConnectionsResponse) response));
Expand All @@ -128,7 +128,7 @@ public void listConnections(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListConnections, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListConnectionsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -137,7 +137,7 @@ public void listConnections(
@Override
public void updateConnection(
UpdateConnectionRequest request, StreamObserver<Connection> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Connection) {
requests.add(request);
responseObserver.onNext(((Connection) response));
Expand All @@ -149,7 +149,7 @@ public void updateConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Connection.class.getName(),
Exception.class.getName())));
}
Expand All @@ -158,7 +158,7 @@ public void updateConnection(
@Override
public void deleteConnection(
DeleteConnectionRequest request, StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -170,15 +170,15 @@ public void deleteConnection(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteConnection, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -190,15 +190,15 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetIamPolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
}

@Override
public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Policy) {
requests.add(request);
responseObserver.onNext(((Policy) response));
Expand All @@ -210,7 +210,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method SetIamPolicy, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Policy.class.getName(),
Exception.class.getName())));
}
Expand All @@ -220,7 +220,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
public void testIamPermissions(
TestIamPermissionsRequest request,
StreamObserver<TestIamPermissionsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TestIamPermissionsResponse) {
requests.add(request);
responseObserver.onNext(((TestIamPermissionsResponse) response));
Expand All @@ -232,7 +232,7 @@ public void testIamPermissions(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method TestIamPermissions, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TestIamPermissionsResponse.class.getName(),
Exception.class.getName())));
}
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Expand Up @@ -4,23 +4,23 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-bigqueryconnection.git",
"sha": "3646f9b03af9a8b7ff361f9a4f43f2efde2ea055"
"sha": "e5beb808c8367710f9bb54a011979915cfdf1677"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
Expand Down

0 comments on commit b6381a2

Please sign in to comment.