Class RecommendationAICreateCatalogItem

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
org.apache.beam.sdk.extensions.ml.RecommendationAICreateCatalogItem
All Implemented Interfaces:
Serializable, HasDisplayData

public abstract class RecommendationAICreateCatalogItem extends PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
A PTransform using the Recommendations AI API (https://cloud.google.com/recommendations). Takes an input PCollection of GenericJsons and converts them to and creates CatalogItems. 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").

See Also:
  • Field Details

    • SUCCESS_TAG

      public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> SUCCESS_TAG
    • FAILURE_TAG

      public static final TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem> FAILURE_TAG
  • Constructor Details

    • RecommendationAICreateCatalogItem

      public RecommendationAICreateCatalogItem()
  • Method Details

    • projectId

      @Nullable public abstract String projectId()
      Returns:
      ID of Google Cloud project to be used for creating catalog items.
    • catalogName

      @Nullable public abstract String catalogName()
      Returns:
      Name of the catalog where the catalog items will be created (defaults to "default_catalog").
    • withProjectId

      public RecommendationAICreateCatalogItem withProjectId(String projectId)
    • withCatalogName

      public RecommendationAICreateCatalogItem withCatalogName(String catalogName)
    • expand

      public PCollectionTuple expand(PCollection<com.google.api.client.json.GenericJson> input)
      The transform converts the contents of input PCollection into CatalogItems and then calls the Recommendation AI service to create the catalog item.
      Specified by:
      expand in class PTransform<PCollection<com.google.api.client.json.GenericJson>,PCollectionTuple>
      Parameters:
      input - input PCollection
      Returns:
      PCollectionTuple with successful and failed CatalogItems