Class ActionInteraction
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<ActionInteraction.Builder,
ActionInteraction>
Represents an action interaction event sent using the PutActionInteractions
API.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal String
actionId()
The ID of the action the user interacted with.static ActionInteraction.Builder
builder()
final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final String
eventId()
An ID associated with the event.final String
The type of action interaction event.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the Impression property.A list of action IDs that represents the sequence of actions you have shown the user.final String
A string map of event-specific data that you might choose to record.final String
The ID of the list of recommendations that contains the action the user interacted with.static Class
<? extends ActionInteraction.Builder> final String
The ID associated with the user's visit.final Instant
The timestamp for when the action interaction event occurred.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.final String
userId()
The ID of the user who interacted with the action.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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
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
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
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
The type of action interaction event. You can specify
Viewed
,Taken
, andNot 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
, andNot Taken
event types. For more information about action interaction event type data, see Event type data.
-
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
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 theisEmpty()
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
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 theViewed
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 theViewed
event type.
-
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
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 interfaceToCopyableBuilder<ActionInteraction.Builder,
ActionInteraction> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
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 anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
- Returns:
- The mapping between the field name and its corresponding field.
-