From fa5da7beca4ed2e89cdf8f486ba2e2c5054c4026 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Mar 2021 08:28:06 -0700 Subject: [PATCH] chore: update java microgenerator to 1.0.2 Adds request initialization to sample code (#215) This PR was generated using Autosynth. :rainbow: 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: https://github.com/googleapis/googleapis/commit/1305ca41d554eb0725237561e34129373bb8cbc1 --- .../workflows/v1beta/WorkflowsClient.java | 8 ++++++++ .../workflows/v1beta/MockWorkflowsImpl.java | 20 +++++++++---------- java-workflows/synth.metadata | 6 +++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java index 5e73912eb33f..7cef1c2586bf 100644 --- a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java @@ -281,6 +281,14 @@ public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest reque * *
{@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()) {
diff --git a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java
index 6a8b27c9e8a7..fc08de504bd8 100644
--- a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java
+++ b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java
@@ -62,7 +62,7 @@ public void reset() {
   @Override
   public void listWorkflows(
       ListWorkflowsRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof ListWorkflowsResponse) {
       requests.add(request);
       responseObserver.onNext(((ListWorkflowsResponse) response));
@@ -74,7 +74,7 @@ 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())));
     }
@@ -82,7 +82,7 @@ public void listWorkflows(
 
   @Override
   public void getWorkflow(GetWorkflowRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Workflow) {
       requests.add(request);
       responseObserver.onNext(((Workflow) response));
@@ -94,7 +94,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver 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())));
     }
@@ -103,7 +103,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver res
   @Override
   public void createWorkflow(
       CreateWorkflowRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Operation) {
       requests.add(request);
       responseObserver.onNext(((Operation) response));
@@ -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())));
     }
@@ -124,7 +124,7 @@ public void createWorkflow(
   @Override
   public void deleteWorkflow(
       DeleteWorkflowRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Operation) {
       requests.add(request);
       responseObserver.onNext(((Operation) response));
@@ -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())));
     }
@@ -145,7 +145,7 @@ public void deleteWorkflow(
   @Override
   public void updateWorkflow(
       UpdateWorkflowRequest request, StreamObserver responseObserver) {
-    Object response = responses.remove();
+    Object response = responses.poll();
     if (response instanceof Operation) {
       requests.add(request);
       responseObserver.onNext(((Operation) response));
@@ -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())));
     }
diff --git a/java-workflows/synth.metadata b/java-workflows/synth.metadata
index 1ec6161aec2f..dd5631b553da 100644
--- a/java-workflows/synth.metadata
+++ b/java-workflows/synth.metadata
@@ -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"
       }
     },
     {