diff --git a/generated_samples/interactive-tutorials/product/add_fulfillment_places.py b/generated_samples/interactive-tutorials/product/add_fulfillment_places.py index c1f5503a2067..b3c7df63c934 100644 --- a/generated_samples/interactive-tutorials/product/add_fulfillment_places.py +++ b/generated_samples/interactive-tutorials/product/add_fulfillment_places.py @@ -15,7 +15,6 @@ # [START retail_add_fulfillment_places] # Adding place IDs using Retail API. # -import datetime import random import string import time @@ -37,13 +36,12 @@ # add fulfillment request def get_add_fulfillment_request( - product_name: str, timestamp, place_id + product_name: str, place_id ) -> AddFulfillmentPlacesRequest: add_fulfillment_request = AddFulfillmentPlacesRequest() add_fulfillment_request.product = product_name add_fulfillment_request.type_ = "pickup-in-store" add_fulfillment_request.place_ids = [place_id] - add_fulfillment_request.add_time = timestamp add_fulfillment_request.allow_missing = True print("---add fulfillment request---") @@ -53,10 +51,8 @@ def get_add_fulfillment_request( # add fulfillment places to product -def add_fulfillment_places(product_name: str, timestamp, place_id): - add_fulfillment_request = get_add_fulfillment_request( - product_name, timestamp, place_id - ) +def add_fulfillment_places(product_name: str, place_id): + add_fulfillment_request = get_add_fulfillment_request(product_name, place_id) ProductServiceClient().add_fulfillment_places(add_fulfillment_request) # This is a long running operation and its result is not immediately present with get operations, @@ -70,9 +66,7 @@ def add_fulfillment_places(product_name: str, timestamp, place_id): create_product(product_id) -# The request timestamp -current_date = datetime.datetime.now() + datetime.timedelta(seconds=30) -print(f"------add fulfilment places with current date: {current_date}-----") -add_fulfillment_places(product_name, current_date, "store2") +print("------add fulfilment places-----") +add_fulfillment_places(product_name, "store2") get_product(product_name) delete_product(product_name) diff --git a/generated_samples/interactive-tutorials/product/remove_fulfillment_places.py b/generated_samples/interactive-tutorials/product/remove_fulfillment_places.py index 400ab80ffae0..1796cd277df9 100644 --- a/generated_samples/interactive-tutorials/product/remove_fulfillment_places.py +++ b/generated_samples/interactive-tutorials/product/remove_fulfillment_places.py @@ -15,7 +15,6 @@ # [START retail_remove_fulfillment_places] # Remove place IDs using Retail API. # -import datetime import random import string import time @@ -29,13 +28,12 @@ # remove fulfillment request def get_remove_fulfillment_request( - product_name: str, timestamp, store_id + product_name: str, store_id ) -> RemoveFulfillmentPlacesRequest: remove_fulfillment_request = RemoveFulfillmentPlacesRequest() remove_fulfillment_request.product = product_name remove_fulfillment_request.type_ = "pickup-in-store" remove_fulfillment_request.place_ids = [store_id] - remove_fulfillment_request.remove_time = timestamp remove_fulfillment_request.allow_missing = True print("---remove fulfillment request---") @@ -45,10 +43,8 @@ def get_remove_fulfillment_request( # remove fulfillment places to product -def remove_fulfillment_places(product_name: str, timestamp, store_id): - remove_fulfillment_request = get_remove_fulfillment_request( - product_name, timestamp, store_id - ) +def remove_fulfillment_places(product_name: str, store_id): + remove_fulfillment_request = get_remove_fulfillment_request(product_name, store_id) ProductServiceClient().remove_fulfillment_places(remove_fulfillment_request) # This is a long running operation and its result is not immediately present with get operations, @@ -62,10 +58,7 @@ def remove_fulfillment_places(product_name: str, timestamp, store_id): product = create_product(product_id) -# The request timestamp -current_date = datetime.datetime.now() - -print(f"------remove fulfilment places with current date: {current_date}-----") -remove_fulfillment_places(product.name, current_date, "store0") +print("------remove fulfilment places-----") +remove_fulfillment_places(product.name, "store0") get_product(product.name) delete_product(product.name) diff --git a/generated_samples/interactive-tutorials/product/set_inventory.py b/generated_samples/interactive-tutorials/product/set_inventory.py index 4a779c3f6a52..be69217c8090 100644 --- a/generated_samples/interactive-tutorials/product/set_inventory.py +++ b/generated_samples/interactive-tutorials/product/set_inventory.py @@ -15,7 +15,6 @@ # [START retail_set_inventory] # Updating inventory information using Retail API. # -import datetime import random import string import time @@ -65,15 +64,12 @@ def get_product_with_inventory_info(product_name: str) -> Product: # set inventory request def get_set_inventory_request(product_name: str) -> SetInventoryRequest: - # The request timestamp - request_time = datetime.datetime.now() + datetime.timedelta(seconds=30) set_mask = FieldMask( paths=["price_info", "availability", "fulfillment_info", "available_quantity"] ) set_inventory_request = SetInventoryRequest() set_inventory_request.inventory = get_product_with_inventory_info(product_name) - set_inventory_request.set_time = request_time set_inventory_request.allow_missing = True set_inventory_request.set_mask = set_mask