Search in sources :

Example 1 with ProductInlineSource

use of com.google.cloud.retail.v2.ProductInlineSource in project java-retail by googleapis.

the class ImportProductsInlineSource method getImportProductsInlineRequest.

public static ImportProductsRequest getImportProductsInlineRequest(List<Product> productsToImport) {
    ProductInlineSource inlineSource = ProductInlineSource.newBuilder().addAllProducts(productsToImport).build();
    ProductInputConfig inputConfig = ProductInputConfig.newBuilder().setProductInlineSource(inlineSource).build();
    ImportProductsRequest importRequest = ImportProductsRequest.newBuilder().setParent(DEFAULT_CATALOG).setInputConfig(inputConfig).build();
    System.out.printf("Import products from inline source request: %s%n", importRequest);
    return importRequest;
}
Also used : ImportProductsRequest(com.google.cloud.retail.v2.ImportProductsRequest) ProductInputConfig(com.google.cloud.retail.v2.ProductInputConfig) ProductInlineSource(com.google.cloud.retail.v2.ProductInlineSource)

Aggregations

ImportProductsRequest (com.google.cloud.retail.v2.ImportProductsRequest)1 ProductInlineSource (com.google.cloud.retail.v2.ProductInlineSource)1 ProductInputConfig (com.google.cloud.retail.v2.ProductInputConfig)1