Class RecommendationAIPredict

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData

    public abstract class RecommendationAIPredict
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,​org.apache.beam.sdk.values.PCollectionTuple>
    A PTransform using the Recommendations AI API (https://cloud.google.com/recommendations). Takes an input PCollection of GenericJsons and creates PredictResponse.PredictionResults.

    It is possible to provide a catalog name to which you want to add the user event (defaults to "default_catalog"). It is possible to provide a event store to which you want to add the user event (defaults to "default_event_store"). A placement id for the recommendation engine placement to be used.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> FAILURE_TAG  
      static org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> SUCCESS_TAG  
      • Fields inherited from class org.apache.beam.sdk.transforms.PTransform

        annotations, displayData, name, resourceHints
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String catalogName()
      Returns name of the catalog where the catalog items will be created.
      abstract java.lang.String eventStore()
      Returns name of the event store where the user events will be created.
      org.apache.beam.sdk.values.PCollectionTuple expand​(org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson> input)  
      abstract java.lang.String placementId()
      Returns ID of the recommendation engine placement.
      abstract java.lang.String projectId()
      Returns ID of Google Cloud project to be used for creating catalog items.
      RecommendationAIPredict withCatalogName​(java.lang.String catalogName)  
      RecommendationAIPredict withEventStore​(java.lang.String eventStore)  
      RecommendationAIPredict withPlacementId​(java.lang.String placementId)  
      RecommendationAIPredict withProjectId​(java.lang.String projectId)  
      • Methods inherited from class org.apache.beam.sdk.transforms.PTransform

        addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SUCCESS_TAG

        public static final org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult> SUCCESS_TAG
      • FAILURE_TAG

        public static final org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.UserEvent> FAILURE_TAG
    • Constructor Detail

      • RecommendationAIPredict

        public RecommendationAIPredict()
    • Method Detail

      • projectId

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

        @Nullable
        public abstract java.lang.String catalogName()
        Returns name of the catalog where the catalog items will be created.
      • eventStore

        @Nullable
        public abstract java.lang.String eventStore()
        Returns name of the event store where the user events will be created.
      • placementId

        public abstract java.lang.String placementId()
        Returns ID of the recommendation engine placement.
      • expand

        public org.apache.beam.sdk.values.PCollectionTuple expand​(org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson> input)
        Specified by:
        expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,​org.apache.beam.sdk.values.PCollectionTuple>