putEvents method

Future<void> putEvents({
  1. required List<Event> eventList,
  2. required String sessionId,
  3. required String trackingId,
  4. String? userId,
})

Records item interaction event data. For more information see Recording item interaction events.

May throw InvalidInputException.

Parameter eventList : A list of event data from the session.

Parameter sessionId : The session ID associated with the user's visit. Your application generates the sessionId when a user first visits your website or uses your application. Amazon Personalize uses the sessionId to associate events with the user before they log in. For more information, see Recording item interaction events.

Parameter trackingId : The tracking ID for the event. The ID is generated by a call to the CreateEventTracker API.

Parameter userId : The user associated with the event.

Implementation

Future<void> putEvents({
  required List<Event> eventList,
  required String sessionId,
  required String trackingId,
  String? userId,
}) async {
  final $payload = <String, dynamic>{
    'eventList': eventList,
    'sessionId': sessionId,
    'trackingId': trackingId,
    if (userId != null) 'userId': userId,
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/events',
    exceptionFnMap: _exceptionFns,
  );
}