diff --git a/retail/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java b/retail/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java index df1080f6caa..2c6a63cc850 100644 --- a/retail/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java +++ b/retail/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java @@ -23,9 +23,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; @@ -47,22 +45,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/retail/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java b/retail/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java index a5eac37d89e..35e7b8f0071 100644 --- a/retail/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java +++ b/retail/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java @@ -23,9 +23,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; @@ -48,21 +46,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/retail/interactive-tutorials/src/main/java/product/SetInventory.java b/retail/interactive-tutorials/src/main/java/product/SetInventory.java index 379dc31c5dc..0a16d4085d2 100644 --- a/retail/interactive-tutorials/src/main/java/product/SetInventory.java +++ b/retail/interactive-tutorials/src/main/java/product/SetInventory.java @@ -29,9 +29,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; @@ -57,13 +55,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( @@ -97,7 +88,6 @@ public static void setInventory(String productName) throws IOException, Interrup SetInventoryRequest setInventoryRequest = SetInventoryRequest.newBuilder() .setInventory(product) - .setSetTime(requestTime) .setAllowMissing(true) .setSetMask(setMask) .build();