Class RecommendationAIWriteUserEvent

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

    public abstract class RecommendationAIWriteUserEvent
    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 converts them to and creates UserEvents.

    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").

    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.UserEvent> 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 user events 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)
      The transform converts the contents of input PCollection into UserEvents and then calls the Recommendation AI service to create the user event.
      abstract java.lang.String projectId()
      Returns ID of Google Cloud project to be used for creating user events.
      RecommendationAIWriteUserEvent withCatalogName​(java.lang.String catalogName)  
      RecommendationAIWriteUserEvent withEventStore​(java.lang.String eventStore)  
      RecommendationAIWriteUserEvent 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.UserEvent> SUCCESS_TAG
      • FAILURE_TAG

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

      • RecommendationAIWriteUserEvent

        public RecommendationAIWriteUserEvent()
    • Method Detail

      • projectId

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

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

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

        public org.apache.beam.sdk.values.PCollectionTuple expand​(org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson> input)
        The transform converts the contents of input PCollection into UserEvents and then calls the Recommendation AI service to create the user event.
        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>
        Parameters:
        input - input PCollection
        Returns:
        PCollectionTuple with successful and failed UserEvents