UNPKG

6.16 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 PersonalizeRuntime extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: PersonalizeRuntime.Types.ClientConfiguration)
13 config: Config & PersonalizeRuntime.Types.ClientConfiguration;
14 /**
15 * Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user. The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.
16 */
17 getPersonalizedRanking(params: PersonalizeRuntime.Types.GetPersonalizedRankingRequest, callback?: (err: AWSError, data: PersonalizeRuntime.Types.GetPersonalizedRankingResponse) => void): Request<PersonalizeRuntime.Types.GetPersonalizedRankingResponse, AWSError>;
18 /**
19 * Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user. The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.
20 */
21 getPersonalizedRanking(callback?: (err: AWSError, data: PersonalizeRuntime.Types.GetPersonalizedRankingResponse) => void): Request<PersonalizeRuntime.Types.GetPersonalizedRankingResponse, AWSError>;
22 /**
23 * Returns a list of recommended items. The required input depends on the recipe type used to create the solution backing the campaign, as follows: RELATED_ITEMS - itemId required, userId not used USER_PERSONALIZATION - itemId optional, userId required Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.
24 */
25 getRecommendations(params: PersonalizeRuntime.Types.GetRecommendationsRequest, callback?: (err: AWSError, data: PersonalizeRuntime.Types.GetRecommendationsResponse) => void): Request<PersonalizeRuntime.Types.GetRecommendationsResponse, AWSError>;
26 /**
27 * Returns a list of recommended items. The required input depends on the recipe type used to create the solution backing the campaign, as follows: RELATED_ITEMS - itemId required, userId not used USER_PERSONALIZATION - itemId optional, userId required Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.
28 */
29 getRecommendations(callback?: (err: AWSError, data: PersonalizeRuntime.Types.GetRecommendationsResponse) => void): Request<PersonalizeRuntime.Types.GetRecommendationsResponse, AWSError>;
30}
31declare namespace PersonalizeRuntime {
32 export type Arn = string;
33 export type AttributeName = string;
34 export type AttributeValue = string;
35 export type Context = {[key: string]: AttributeValue};
36 export interface GetPersonalizedRankingRequest {
37 /**
38 * The Amazon Resource Name (ARN) of the campaign to use for generating the personalized ranking.
39 */
40 campaignArn: Arn;
41 /**
42 * A list of items (itemId's) to rank. If an item was not included in the training dataset, the item is appended to the end of the reranked list. The maximum is 500.
43 */
44 inputList: InputList;
45 /**
46 * The user for which you want the campaign to provide a personalized ranking.
47 */
48 userId: UserID;
49 /**
50 * The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type. For more information, see Contextual Metadata.
51 */
52 context?: Context;
53 }
54 export interface GetPersonalizedRankingResponse {
55 /**
56 * A list of items in order of most likely interest to the user. The maximum is 500.
57 */
58 personalizedRanking?: ItemList;
59 }
60 export interface GetRecommendationsRequest {
61 /**
62 * The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.
63 */
64 campaignArn: Arn;
65 /**
66 * The item ID to provide recommendations for. Required for RELATED_ITEMS recipe type.
67 */
68 itemId?: ItemID;
69 /**
70 * The user ID to provide recommendations for. Required for USER_PERSONALIZATION recipe type.
71 */
72 userId?: UserID;
73 /**
74 * The number of results to return. The default is 25. The maximum is 500.
75 */
76 numResults?: NumResults;
77 /**
78 * The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type. For more information, see Contextual Metadata.
79 */
80 context?: Context;
81 }
82 export interface GetRecommendationsResponse {
83 /**
84 * A list of recommendations sorted in ascending order by prediction score. There can be a maximum of 500 items in the list.
85 */
86 itemList?: ItemList;
87 }
88 export type InputList = ItemID[];
89 export type ItemID = string;
90 export type ItemList = PredictedItem[];
91 export type NumResults = number;
92 export interface PredictedItem {
93 /**
94 * The recommended item ID.
95 */
96 itemId?: ItemID;
97 }
98 export type UserID = string;
99 /**
100 * 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.
101 */
102 export type apiVersion = "2018-05-22"|"latest"|string;
103 export interface ClientApiVersions {
104 /**
105 * 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.
106 */
107 apiVersion?: apiVersion;
108 }
109 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
110 /**
111 * Contains interfaces for use with the PersonalizeRuntime client.
112 */
113 export import Types = PersonalizeRuntime;
114}
115export = PersonalizeRuntime;