public abstract class RecommendationAICreateCatalogItem extends PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
PTransform
using the Recommendations AI API (https://cloud.google.com/recommendations).
Takes an input PCollection
of GenericJson
s and converts them to and creates
CatalogItem
s. It outputs a PCollectionTuple which will contain the successfully created
and failed catalog items.
It is possible to provide a catalog name to which you want to add the catalog item (defaults to "default_catalog").
Modifier and Type | Field and Description |
---|---|
static TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> |
FAILURE_TAG |
static TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> |
SUCCESS_TAG |
name, resourceHints
Constructor and Description |
---|
RecommendationAICreateCatalogItem() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
catalogName() |
PCollectionTuple |
expand(PCollection<com.google.api.client.json.GenericJson> input)
The transform converts the contents of input PCollection into
CatalogItem s and then
calls the Recommendation AI service to create the catalog item. |
abstract java.lang.String |
projectId() |
RecommendationAICreateCatalogItem |
withCatalogName(java.lang.String catalogName) |
RecommendationAICreateCatalogItem |
withProjectId(java.lang.String projectId) |
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate
public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> SUCCESS_TAG
public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> FAILURE_TAG
@Nullable public abstract java.lang.String projectId()
@Nullable public abstract java.lang.String catalogName()
public RecommendationAICreateCatalogItem withProjectId(java.lang.String projectId)
public RecommendationAICreateCatalogItem withCatalogName(java.lang.String catalogName)
public PCollectionTuple expand(PCollection<com.google.api.client.json.GenericJson> input)
CatalogItem
s and then
calls the Recommendation AI service to create the catalog item.expand
in class PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
input
- input PCollectionCatalogItem
s