Class UserEvent

  • All Implemented Interfaces:
    UserEventOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class UserEvent
    extends com.google.protobuf.GeneratedMessageV3
    implements UserEventOrBuilder
     UserEvent captures all metadata information recommendation engine needs to
     know about how end users interact with customers' website.
     
    Protobuf type google.cloud.recommendationengine.v1beta1.UserEvent
    See Also:
    Serialized Form
    • Field Detail

      • EVENT_TYPE_FIELD_NUMBER

        public static final int EVENT_TYPE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EVENT_DETAIL_FIELD_NUMBER

        public static final int EVENT_DETAIL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PRODUCT_EVENT_DETAIL_FIELD_NUMBER

        public static final int PRODUCT_EVENT_DETAIL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EVENT_TIME_FIELD_NUMBER

        public static final int EVENT_TIME_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EVENT_SOURCE_FIELD_NUMBER

        public static final int EVENT_SOURCE_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getEventType

        public String getEventType()
         Required. User event type. Allowed values are:
        
         * `add-to-cart` Products being added to cart.
         * `add-to-list` Items being added to a list (shopping list, favorites
           etc).
         * `category-page-view` Special pages such as sale or promotion pages
           viewed.
         * `checkout-start` User starting a checkout process.
         * `detail-page-view` Products detail page viewed.
         * `home-page-view` Homepage viewed.
         * `page-visit` Generic page visits not included in the event types above.
         * `purchase-complete` User finishing a purchase.
         * `refund` Purchased items being refunded or returned.
         * `remove-from-cart` Products being removed from cart.
         * `remove-from-list` Items being removed from a list.
         * `search` Product search.
         * `shopping-cart-page-view` User viewing a shopping cart.
         * `impression` List of items displayed. Used by Google Tag Manager.
         
        string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getEventType in interface UserEventOrBuilder
        Returns:
        The eventType.
      • getEventTypeBytes

        public com.google.protobuf.ByteString getEventTypeBytes()
         Required. User event type. Allowed values are:
        
         * `add-to-cart` Products being added to cart.
         * `add-to-list` Items being added to a list (shopping list, favorites
           etc).
         * `category-page-view` Special pages such as sale or promotion pages
           viewed.
         * `checkout-start` User starting a checkout process.
         * `detail-page-view` Products detail page viewed.
         * `home-page-view` Homepage viewed.
         * `page-visit` Generic page visits not included in the event types above.
         * `purchase-complete` User finishing a purchase.
         * `refund` Purchased items being refunded or returned.
         * `remove-from-cart` Products being removed from cart.
         * `remove-from-list` Items being removed from a list.
         * `search` Product search.
         * `shopping-cart-page-view` User viewing a shopping cart.
         * `impression` List of items displayed. Used by Google Tag Manager.
         
        string event_type = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getEventTypeBytes in interface UserEventOrBuilder
        Returns:
        The bytes for eventType.
      • hasUserInfo

        public boolean hasUserInfo()
         Required. User information.
         
        .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        hasUserInfo in interface UserEventOrBuilder
        Returns:
        Whether the userInfo field is set.
      • getUserInfo

        public UserInfo getUserInfo()
         Required. User information.
         
        .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getUserInfo in interface UserEventOrBuilder
        Returns:
        The userInfo.
      • getUserInfoOrBuilder

        public UserInfoOrBuilder getUserInfoOrBuilder()
         Required. User information.
         
        .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getUserInfoOrBuilder in interface UserEventOrBuilder
      • hasEventDetail

        public boolean hasEventDetail()
         Optional. User event detailed information common across different
         recommendation types.
         
        .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasEventDetail in interface UserEventOrBuilder
        Returns:
        Whether the eventDetail field is set.
      • getEventDetail

        public EventDetail getEventDetail()
         Optional. User event detailed information common across different
         recommendation types.
         
        .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventDetail in interface UserEventOrBuilder
        Returns:
        The eventDetail.
      • getEventDetailOrBuilder

        public EventDetailOrBuilder getEventDetailOrBuilder()
         Optional. User event detailed information common across different
         recommendation types.
         
        .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventDetailOrBuilder in interface UserEventOrBuilder
      • hasProductEventDetail

        public boolean hasProductEventDetail()
         Optional. Retail product specific user event metadata.
        
         This field is required for the following event types:
        
         * `add-to-cart`
         * `add-to-list`
         * `category-page-view`
         * `checkout-start`
         * `detail-page-view`
         * `purchase-complete`
         * `refund`
         * `remove-from-cart`
         * `remove-from-list`
         * `search`
        
         This field is optional for the following event types:
        
         * `page-visit`
         * `shopping-cart-page-view` - note that 'product_event_detail' should be
           set for this unless the shopping cart is empty.
        
         This field is not allowed for the following event types:
        
         * `home-page-view`
         
        .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasProductEventDetail in interface UserEventOrBuilder
        Returns:
        Whether the productEventDetail field is set.
      • getProductEventDetail

        public ProductEventDetail getProductEventDetail()
         Optional. Retail product specific user event metadata.
        
         This field is required for the following event types:
        
         * `add-to-cart`
         * `add-to-list`
         * `category-page-view`
         * `checkout-start`
         * `detail-page-view`
         * `purchase-complete`
         * `refund`
         * `remove-from-cart`
         * `remove-from-list`
         * `search`
        
         This field is optional for the following event types:
        
         * `page-visit`
         * `shopping-cart-page-view` - note that 'product_event_detail' should be
           set for this unless the shopping cart is empty.
        
         This field is not allowed for the following event types:
        
         * `home-page-view`
         
        .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getProductEventDetail in interface UserEventOrBuilder
        Returns:
        The productEventDetail.
      • getProductEventDetailOrBuilder

        public ProductEventDetailOrBuilder getProductEventDetailOrBuilder()
         Optional. Retail product specific user event metadata.
        
         This field is required for the following event types:
        
         * `add-to-cart`
         * `add-to-list`
         * `category-page-view`
         * `checkout-start`
         * `detail-page-view`
         * `purchase-complete`
         * `refund`
         * `remove-from-cart`
         * `remove-from-list`
         * `search`
        
         This field is optional for the following event types:
        
         * `page-visit`
         * `shopping-cart-page-view` - note that 'product_event_detail' should be
           set for this unless the shopping cart is empty.
        
         This field is not allowed for the following event types:
        
         * `home-page-view`
         
        .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getProductEventDetailOrBuilder in interface UserEventOrBuilder
      • hasEventTime

        public boolean hasEventTime()
         Optional. Only required for ImportUserEvents method. Timestamp of user
         event created.
         
        .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasEventTime in interface UserEventOrBuilder
        Returns:
        Whether the eventTime field is set.
      • getEventTime

        public com.google.protobuf.Timestamp getEventTime()
         Optional. Only required for ImportUserEvents method. Timestamp of user
         event created.
         
        .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventTime in interface UserEventOrBuilder
        Returns:
        The eventTime.
      • getEventTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder()
         Optional. Only required for ImportUserEvents method. Timestamp of user
         event created.
         
        .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventTimeOrBuilder in interface UserEventOrBuilder
      • getEventSourceValue

        public int getEventSourceValue()
         Optional. This field should *not* be set when using JavaScript pixel
         or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
         
        .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventSourceValue in interface UserEventOrBuilder
        Returns:
        The enum numeric value on the wire for eventSource.
      • getEventSource

        public UserEvent.EventSource getEventSource()
         Optional. This field should *not* be set when using JavaScript pixel
         or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`.
         
        .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getEventSource in interface UserEventOrBuilder
        Returns:
        The eventSource.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static UserEvent parseFrom​(ByteBuffer data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(ByteBuffer data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(com.google.protobuf.ByteString data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(com.google.protobuf.ByteString data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(byte[] data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(byte[] data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static UserEvent parseFrom​(com.google.protobuf.CodedInputStream input,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws IOException
        Throws:
        IOException
      • newBuilderForType

        public UserEvent.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public UserEvent.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected UserEvent.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static UserEvent getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<UserEvent> parser()
      • getParserForType

        public com.google.protobuf.Parser<UserEvent> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public UserEvent getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder