Search in sources :

Example 6 with PriceInfo

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();
}
Also used : PriceInfo(com.google.cloud.retail.v2.PriceInfo)

Example 7 with PriceInfo

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();
}
Also used : FulfillmentInfo(com.google.cloud.retail.v2.FulfillmentInfo) PriceInfo(com.google.cloud.retail.v2.PriceInfo)

Aggregations

PriceInfo (com.google.cloud.retail.v2.PriceInfo)7 FulfillmentInfo (com.google.cloud.retail.v2.FulfillmentInfo)3 ColorInfo (com.google.cloud.retail.v2.ColorInfo)1 Product (com.google.cloud.retail.v2.Product)1 FieldMask (com.google.protobuf.FieldMask)1 ArrayList (java.util.ArrayList)1