From 2a8071b0211021d8ef624d11fc86b2f045764c75 Mon Sep 17 00:00:00 2001 From: Daria Firova Date: Mon, 5 Sep 2022 11:54:55 +0300 Subject: [PATCH 1/2] fix (samples) removed add time from lro. --- .../src/main/java/product/AddFulfillmentPlaces.java | 11 ++--------- .../main/java/product/RemoveFulfillmentPlaces.java | 10 +++------- .../src/main/java/product/SetInventory.java | 8 -------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java b/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java index 31d94273..bbd7daf8 100644 --- a/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java +++ b/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java @@ -27,9 +27,7 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.AddFulfillmentPlacesRequest; import com.google.cloud.retail.v2.ProductServiceClient; -import com.google.protobuf.Timestamp; import java.io.IOException; -import java.time.Instant; import java.util.UUID; import java.util.concurrent.TimeUnit; @@ -51,22 +49,17 @@ public static void main(String[] args) throws IOException, InterruptedException public static void addFulfillmentPlaces(String productName, String placeId) throws IOException, InterruptedException { - Timestamp currentDate = - Timestamp.newBuilder() - .setSeconds(Instant.now().getEpochSecond()) - .setNanos(Instant.now().getNano()) - .build(); - System.out.printf("Add fulfilment places with current date: %s", currentDate); + System.out.println("Add fulfilment places"); AddFulfillmentPlacesRequest addFulfillmentPlacesRequest = AddFulfillmentPlacesRequest.newBuilder() .setProduct(productName) .setType("pickup-in-store") .addPlaceIds(placeId) - .setAddTime(currentDate) .setAllowMissing(true) .build(); + System.out.println("Add fulfillment request " + addFulfillmentPlacesRequest); // Initialize client that will be used to send requests. This client only diff --git a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java index 14f64dee..e08e7f17 100644 --- a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java +++ b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java @@ -52,21 +52,17 @@ public static void main(String[] args) throws IOException, InterruptedException // remove fulfillment places to product public static void removeFulfillmentPlaces(String productName, String storeId) throws IOException, InterruptedException { - Timestamp currentDate = - Timestamp.newBuilder() - .setSeconds(Instant.now().getEpochSecond()) - .setNanos(Instant.now().getNano()) - .build(); - System.out.printf("Remove fulfilment places with current date: %s", currentDate); + System.out.println("Remove fulfilment places with current date"); + RemoveFulfillmentPlacesRequest removeFulfillmentRequest = RemoveFulfillmentPlacesRequest.newBuilder() .setProduct(productName) .setType("pickup-in-store") .addPlaceIds(storeId) - .setRemoveTime(currentDate) .setAllowMissing(true) .build(); + System.out.println("Remove fulfillment request " + removeFulfillmentRequest); // Initialize client that will be used to send requests. This client only diff --git a/samples/interactive-tutorials/src/main/java/product/SetInventory.java b/samples/interactive-tutorials/src/main/java/product/SetInventory.java index fbf260db..5cb81d67 100644 --- a/samples/interactive-tutorials/src/main/java/product/SetInventory.java +++ b/samples/interactive-tutorials/src/main/java/product/SetInventory.java @@ -61,13 +61,6 @@ public static void setInventory(String productName) throws IOException, Interrup float originalPrice = 20.0f; float cost = 8.0f; - // The request timestamp - Timestamp requestTime = - Timestamp.newBuilder() - .setSeconds(Instant.now().getEpochSecond()) - .setNanos(Instant.now().getNano()) - .build(); - FieldMask setMask = FieldMask.newBuilder() .addAllPaths( @@ -101,7 +94,6 @@ public static void setInventory(String productName) throws IOException, Interrup SetInventoryRequest setInventoryRequest = SetInventoryRequest.newBuilder() .setInventory(product) - .setSetTime(requestTime) .setAllowMissing(true) .setSetMask(setMask) .build(); From a1109382b235666e4dd2668973ea8dbf35074b61 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 12 Sep 2022 18:11:55 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../src/main/java/product/RemoveFulfillmentPlaces.java | 2 -- .../src/main/java/product/SetInventory.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java index e08e7f17..2d58108d 100644 --- a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java +++ b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java @@ -27,9 +27,7 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.retail.v2.ProductServiceClient; import com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; -import com.google.protobuf.Timestamp; import java.io.IOException; -import java.time.Instant; import java.util.UUID; import java.util.concurrent.TimeUnit; diff --git a/samples/interactive-tutorials/src/main/java/product/SetInventory.java b/samples/interactive-tutorials/src/main/java/product/SetInventory.java index 5cb81d67..b110ec58 100644 --- a/samples/interactive-tutorials/src/main/java/product/SetInventory.java +++ b/samples/interactive-tutorials/src/main/java/product/SetInventory.java @@ -33,9 +33,7 @@ import com.google.cloud.retail.v2.SetInventoryRequest; import com.google.protobuf.FieldMask; import com.google.protobuf.Int32Value; -import com.google.protobuf.Timestamp; import java.io.IOException; -import java.time.Instant; import java.util.Arrays; import java.util.UUID; import java.util.concurrent.TimeUnit;