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;
}
Aggregations