UNPKG

3.77 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class PersonalizeEvents extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: PersonalizeEvents.Types.ClientConfiguration)
13 config: Config & PersonalizeEvents.Types.ClientConfiguration;
14 /**
15 * Records user interaction event data.
16 */
17 putEvents(params: PersonalizeEvents.Types.PutEventsRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
18 /**
19 * Records user interaction event data.
20 */
21 putEvents(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
22}
23declare namespace PersonalizeEvents {
24 export type _Date = Date;
25 export interface Event {
26 /**
27 * 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 distinquish unique events. Any subsequent events after the first with the same event ID are not used in model training.
28 */
29 eventId?: StringType;
30 /**
31 * The type of event. This property corresponds to the EVENT_TYPE field of the Interactions schema.
32 */
33 eventType: StringType;
34 /**
35 * A string map of event-specific data that you might choose to record. For example, if a user rates a movie on your site, you might send the movie ID and rating, and the number of movie ratings made by the user. Each item in the map consists of a key-value pair. For example, {"itemId": "movie1"} {"itemId": "movie2", "eventValue": "4.5"} {"itemId": "movie3", "eventValue": "3", "numberOfRatings": "12"} The keys use camel case names that match the fields in the Interactions schema. The itemId and eventValue keys correspond to the ITEM_ID and EVENT_VALUE fields. In the above example, the eventType might be 'MovieRating' with eventValue being the rating. The numberOfRatings would match the 'NUMBER_OF_RATINGS' field defined in the Interactions schema.
36 */
37 properties: EventPropertiesJSON;
38 /**
39 * The timestamp on the client side when the event occurred.
40 */
41 sentAt: _Date;
42 }
43 export type EventList = Event[];
44 export type EventPropertiesJSON = string;
45 export interface PutEventsRequest {
46 /**
47 * The tracking ID for the event. The ID is generated by a call to the CreateEventTracker API.
48 */
49 trackingId: StringType;
50 /**
51 * The user associated with the event.
52 */
53 userId?: UserId;
54 /**
55 * The session ID associated with the user's visit.
56 */
57 sessionId: StringType;
58 /**
59 * A list of event data from the session.
60 */
61 eventList: EventList;
62 }
63 export type StringType = string;
64 export type UserId = string;
65 /**
66 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
67 */
68 export type apiVersion = "2018-03-22"|"latest"|string;
69 export interface ClientApiVersions {
70 /**
71 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
72 */
73 apiVersion?: apiVersion;
74 }
75 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
76 /**
77 * Contains interfaces for use with the PersonalizeEvents client.
78 */
79 export import Types = PersonalizeEvents;
80}
81export = PersonalizeEvents;