use of com.google.cloud.retail.v2.PriceInfo in project java-retail by googleapis.
the class UpdateProduct method generateProductForUpdate.
// generate product for update
public static Product generateProductForUpdate(String productId, String branchName) {
final float price = 20.0f;
final float originalPrice = 25.5f;
PriceInfo priceInfo = PriceInfo.newBuilder().setPrice(price).setOriginalPrice(originalPrice).setCurrencyCode("EUR").build();
return Product.newBuilder().setId(productId).setName(branchName + "/products/" + productId).setTitle("Updated Nest Mini").setType(Type.PRIMARY).addCategories("Updated Speakers and displays").addBrands("Updated Google").setAvailability(Availability.OUT_OF_STOCK).setPriceInfo(priceInfo).build();
}
use of com.google.cloud.retail.v2.PriceInfo in project java-retail by googleapis.
the class SetupCleanup method generateProduct.
public static Product generateProduct() {
float price = 30.0f;
float originalPrice = 35.5f;
PriceInfo priceInfo = PriceInfo.newBuilder().setPrice(price).setOriginalPrice(originalPrice).setCurrencyCode("USD").build();
FulfillmentInfo fulfillmentInfo = FulfillmentInfo.newBuilder().setType("pickup-in-store").addAllPlaceIds(Arrays.asList("store0", "store1")).build();
return Product.newBuilder().setTitle("Nest Mini").setType(Type.PRIMARY).addCategories("Speakers and displays").addBrands("Google").setPriceInfo(priceInfo).setAvailability(Availability.IN_STOCK).addFulfillmentInfo(fulfillmentInfo).build();
}