Skip to content

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 (#215)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2c9cca4a-366c-4c22-a332-9048b732edf6/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 362856902
Source-Link: googleapis/googleapis@1305ca4
  • Loading branch information
yoshi-automation authored Mar 15, 2021
1 parent c75c1f2 commit fa5da7b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest reque
*
* <pre>{@code
* try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
* ListWorkflowsRequest request =
* ListWorkflowsRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* while (true) {
* ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request);
* for (Workflow element : response.getResponsesList()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void reset() {
@Override
public void listWorkflows(
ListWorkflowsRequest request, StreamObserver<ListWorkflowsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListWorkflowsResponse) {
requests.add(request);
responseObserver.onNext(((ListWorkflowsResponse) response));
Expand All @@ -74,15 +74,15 @@ public void listWorkflows(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListWorkflows, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListWorkflowsResponse.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getWorkflow(GetWorkflowRequest request, StreamObserver<Workflow> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Workflow) {
requests.add(request);
responseObserver.onNext(((Workflow) response));
Expand All @@ -94,7 +94,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver<Workflow> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetWorkflow, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Workflow.class.getName(),
Exception.class.getName())));
}
Expand All @@ -103,7 +103,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver<Workflow> res
@Override
public void createWorkflow(
CreateWorkflowRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -115,7 +115,7 @@ public void createWorkflow(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateWorkflow, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -124,7 +124,7 @@ public void createWorkflow(
@Override
public void deleteWorkflow(
DeleteWorkflowRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -136,7 +136,7 @@ public void deleteWorkflow(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteWorkflow, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -145,7 +145,7 @@ public void deleteWorkflow(
@Override
public void updateWorkflow(
UpdateWorkflowRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -157,7 +157,7 @@ public void updateWorkflow(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateWorkflow, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand Down
6 changes: 3 additions & 3 deletions java-workflows/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-workflows.git",
"sha": "47a3bf4d8f12110af1fe4571e661dc08656644cb"
"sha": "68b345fd4fd74a977281376f6bb6abde1e803db3"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
Expand Down

0 comments on commit fa5da7b

Please sign in to comment.