use of com.google.cloud.retail.v2.ImportErrorsConfig in project java-retail by googleapis.
the class CreateTestResources method getImportProductsGcsRequest.
public static ImportProductsRequest getImportProductsGcsRequest(String gcsObjectName) {
GcsSource gcsSource = GcsSource.newBuilder().addAllInputUris(Collections.singleton(String.format("gs://%s/%s", BUCKET_NAME, gcsObjectName))).build();
ProductInputConfig inputConfig = ProductInputConfig.newBuilder().setGcsSource(gcsSource).build();
System.out.println("GRS source: " + gcsSource.getInputUrisList());
ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().setGcsPrefix(GCS_ERROR_BUCKET).build();
ImportProductsRequest importRequest = ImportProductsRequest.newBuilder().setParent(DEFAULT_CATALOG).setReconciliationMode(ReconciliationMode.INCREMENTAL).setInputConfig(inputConfig).setErrorsConfig(errorsConfig).build();
System.out.println("Import products from google cloud source request: " + importRequest);
return importRequest;
}
use of com.google.cloud.retail.v2.ImportErrorsConfig in project java-retail by googleapis.
the class ImportProductsGcs method getImportProductsGcsRequest.
public static ImportProductsRequest getImportProductsGcsRequest(String gcsObjectName) {
GcsSource gcsSource = GcsSource.newBuilder().addAllInputUris(Collections.singleton(String.format("%s/%s", GCS_BUCKET, gcsObjectName))).build();
ProductInputConfig inputConfig = ProductInputConfig.newBuilder().setGcsSource(gcsSource).build();
System.out.println("GRS source: " + gcsSource.getInputUrisList());
ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().setGcsPrefix(GCS_ERROR_BUCKET).build();
ImportProductsRequest importRequest = ImportProductsRequest.newBuilder().setParent(DEFAULT_CATALOG).setReconciliationMode(ReconciliationMode.INCREMENTAL).setInputConfig(inputConfig).setErrorsConfig(errorsConfig).build();
System.out.println("Import products from google cloud source request: " + importRequest);
return importRequest;
}
Aggregations