Class ActionInteraction

java.lang.Object
software.amazon.awssdk.services.personalizeevents.model.ActionInteraction
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<ActionInteraction.Builder,ActionInteraction>

@Generated("software.amazon.awssdk:codegen") public final class ActionInteraction extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ActionInteraction.Builder,ActionInteraction>

Represents an action interaction event sent using the PutActionInteractions API.

See Also:
  • Method Details

    • actionId

      public final String actionId()

      The ID of the action the user interacted with. This corresponds to the ACTION_ID field of the Action interaction schema.

      Returns:
      The ID of the action the user interacted with. This corresponds to the ACTION_ID field of the Action interaction schema.
    • userId

      public final String userId()

      The ID of the user who interacted with the action. This corresponds to the USER_ID field of the Action interaction schema.

      Returns:
      The ID of the user who interacted with the action. This corresponds to the USER_ID field of the Action interaction schema.
    • sessionId

      public final String sessionId()

      The ID associated with the user's visit. Your application generates a unique sessionId when a user first visits your website or uses your application.

      Returns:
      The ID associated with the user's visit. Your application generates a unique sessionId when a user first visits your website or uses your application.
    • timestamp

      public final Instant timestamp()

      The timestamp for when the action interaction event occurred. Timestamps must be in Unix epoch time format, in seconds.

      Returns:
      The timestamp for when the action interaction event occurred. Timestamps must be in Unix epoch time format, in seconds.
    • eventType

      public final String eventType()

      The type of action interaction event. You can specify Viewed, Taken, and Not Taken event types. For more information about action interaction event type data, see Event type data.

      Returns:
      The type of action interaction event. You can specify Viewed, Taken, and Not Taken event types. For more information about action interaction event type data, see Event type data.
    • eventId

      public final String eventId()

      An ID associated with the event. If an event ID is not provided, Amazon Personalize generates a unique ID for the event. An event ID is not used as an input to the model. Amazon Personalize uses the event ID to distinguish unique events. Any subsequent events after the first with the same event ID are not used in model training.

      Returns:
      An ID associated with the event. If an event ID is not provided, Amazon Personalize generates a unique ID for the event. An event ID is not used as an input to the model. Amazon Personalize uses the event ID to distinguish unique events. Any subsequent events after the first with the same event ID are not used in model training.
    • recommendationId

      public final String recommendationId()

      The ID of the list of recommendations that contains the action the user interacted with.

      Returns:
      The ID of the list of recommendations that contains the action the user interacted with.
    • hasImpression

      public final boolean hasImpression()
      For responses, this returns true if the service returned a value for the Impression property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • impression

      public final List<String> impression()

      A list of action IDs that represents the sequence of actions you have shown the user. For example, ["actionId1", "actionId2", "actionId3"]. Amazon Personalize doesn't use impressions data from action interaction events. Instead, record multiple events for each action and use the Viewed event type.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasImpression() method.

      Returns:
      A list of action IDs that represents the sequence of actions you have shown the user. For example, ["actionId1", "actionId2", "actionId3"]. Amazon Personalize doesn't use impressions data from action interaction events. Instead, record multiple events for each action and use the Viewed event type.
    • properties

      public final String properties()

      A string map of event-specific data that you might choose to record. For example, if a user takes an action, other than the action ID, you might also send the number of actions taken by the user.

      Each item in the map consists of a key-value pair. For example,

      {"numberOfActions": "12"}

      The keys use camel case names that match the fields in the Action interactions schema. In the above example, the numberOfActions would match the 'NUMBER_OF_ACTIONS' field defined in the Action interactions schema.

      The following can't be included as a keyword for properties (case insensitive).

      • userId

      • sessionId

      • eventType

      • timestamp

      • recommendationId

      • impression

      Returns:
      A string map of event-specific data that you might choose to record. For example, if a user takes an action, other than the action ID, you might also send the number of actions taken by the user.

      Each item in the map consists of a key-value pair. For example,

      {"numberOfActions": "12"}

      The keys use camel case names that match the fields in the Action interactions schema. In the above example, the numberOfActions would match the 'NUMBER_OF_ACTIONS' field defined in the Action interactions schema.

      The following can't be included as a keyword for properties (case insensitive).

      • userId

      • sessionId

      • eventType

      • timestamp

      • recommendationId

      • impression

    • toBuilder

      public ActionInteraction.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<ActionInteraction.Builder,ActionInteraction>
      Returns:
      a builder for type T
    • builder

      public static ActionInteraction.Builder builder()
    • serializableBuilderClass

      public static Class<? extends ActionInteraction.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.