@aws-sdk/client-personalize-runtime 3.306.0 → 3.309.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/commands/GetPersonalizedRankingCommand.js +2 -2
- package/dist-cjs/commands/GetRecommendationsCommand.js +2 -2
- package/dist-cjs/protocols/Aws_restJson1.js +37 -43
- package/dist-es/commands/GetPersonalizedRankingCommand.js +3 -3
- package/dist-es/commands/GetRecommendationsCommand.js +3 -3
- package/dist-es/protocols/Aws_restJson1.js +32 -38
- package/dist-types/protocols/Aws_restJson1.d.ts +16 -4
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +4 -4
- package/package.json +6 -6
|
@@ -37,10 +37,10 @@ class GetPersonalizedRankingCommand extends smithy_client_1.Command {
|
|
|
37
37
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
38
38
|
}
|
|
39
39
|
serialize(input, context) {
|
|
40
|
-
return (0, Aws_restJson1_1.
|
|
40
|
+
return (0, Aws_restJson1_1.se_GetPersonalizedRankingCommand)(input, context);
|
|
41
41
|
}
|
|
42
42
|
deserialize(output, context) {
|
|
43
|
-
return (0, Aws_restJson1_1.
|
|
43
|
+
return (0, Aws_restJson1_1.de_GetPersonalizedRankingCommand)(output, context);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.GetPersonalizedRankingCommand = GetPersonalizedRankingCommand;
|
|
@@ -37,10 +37,10 @@ class GetRecommendationsCommand extends smithy_client_1.Command {
|
|
|
37
37
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
38
38
|
}
|
|
39
39
|
serialize(input, context) {
|
|
40
|
-
return (0, Aws_restJson1_1.
|
|
40
|
+
return (0, Aws_restJson1_1.se_GetRecommendationsCommand)(input, context);
|
|
41
41
|
}
|
|
42
42
|
deserialize(output, context) {
|
|
43
|
-
return (0, Aws_restJson1_1.
|
|
43
|
+
return (0, Aws_restJson1_1.de_GetRecommendationsCommand)(output, context);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.GetRecommendationsCommand = GetRecommendationsCommand;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.de_GetRecommendationsCommand = exports.de_GetPersonalizedRankingCommand = exports.se_GetRecommendationsCommand = exports.se_GetPersonalizedRankingCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const PersonalizeRuntimeServiceException_1 = require("../models/PersonalizeRuntimeServiceException");
|
|
8
|
-
const
|
|
8
|
+
const se_GetPersonalizedRankingCommand = async (input, context) => {
|
|
9
9
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
10
|
const headers = {
|
|
11
11
|
"content-type": "application/json",
|
|
@@ -14,12 +14,10 @@ const serializeAws_restJson1GetPersonalizedRankingCommand = async (input, contex
|
|
|
14
14
|
let body;
|
|
15
15
|
body = JSON.stringify({
|
|
16
16
|
...(input.campaignArn != null && { campaignArn: input.campaignArn }),
|
|
17
|
-
...(input.context != null && { context:
|
|
17
|
+
...(input.context != null && { context: se_Context(input.context, context) }),
|
|
18
18
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
19
|
-
...(input.filterValues != null && {
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
...(input.inputList != null && { inputList: serializeAws_restJson1InputList(input.inputList, context) }),
|
|
19
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
20
|
+
...(input.inputList != null && { inputList: se_InputList(input.inputList, context) }),
|
|
23
21
|
...(input.userId != null && { userId: input.userId }),
|
|
24
22
|
});
|
|
25
23
|
return new protocol_http_1.HttpRequest({
|
|
@@ -32,8 +30,8 @@ const serializeAws_restJson1GetPersonalizedRankingCommand = async (input, contex
|
|
|
32
30
|
body,
|
|
33
31
|
});
|
|
34
32
|
};
|
|
35
|
-
exports.
|
|
36
|
-
const
|
|
33
|
+
exports.se_GetPersonalizedRankingCommand = se_GetPersonalizedRankingCommand;
|
|
34
|
+
const se_GetRecommendationsCommand = async (input, context) => {
|
|
37
35
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
38
36
|
const headers = {
|
|
39
37
|
"content-type": "application/json",
|
|
@@ -42,14 +40,12 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
|
|
|
42
40
|
let body;
|
|
43
41
|
body = JSON.stringify({
|
|
44
42
|
...(input.campaignArn != null && { campaignArn: input.campaignArn }),
|
|
45
|
-
...(input.context != null && { context:
|
|
43
|
+
...(input.context != null && { context: se_Context(input.context, context) }),
|
|
46
44
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
47
|
-
...(input.filterValues != null && {
|
|
48
|
-
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
49
|
-
}),
|
|
45
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
50
46
|
...(input.itemId != null && { itemId: input.itemId }),
|
|
51
47
|
...(input.numResults != null && { numResults: input.numResults }),
|
|
52
|
-
...(input.promotions != null && { promotions:
|
|
48
|
+
...(input.promotions != null && { promotions: se_PromotionList(input.promotions, context) }),
|
|
53
49
|
...(input.recommenderArn != null && { recommenderArn: input.recommenderArn }),
|
|
54
50
|
...(input.userId != null && { userId: input.userId }),
|
|
55
51
|
});
|
|
@@ -63,25 +59,25 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
|
|
|
63
59
|
body,
|
|
64
60
|
});
|
|
65
61
|
};
|
|
66
|
-
exports.
|
|
67
|
-
const
|
|
62
|
+
exports.se_GetRecommendationsCommand = se_GetRecommendationsCommand;
|
|
63
|
+
const de_GetPersonalizedRankingCommand = async (output, context) => {
|
|
68
64
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
69
|
-
return
|
|
65
|
+
return de_GetPersonalizedRankingCommandError(output, context);
|
|
70
66
|
}
|
|
71
67
|
const contents = map({
|
|
72
68
|
$metadata: deserializeMetadata(output),
|
|
73
69
|
});
|
|
74
70
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
75
71
|
if (data.personalizedRanking != null) {
|
|
76
|
-
contents.personalizedRanking =
|
|
72
|
+
contents.personalizedRanking = de_ItemList(data.personalizedRanking, context);
|
|
77
73
|
}
|
|
78
74
|
if (data.recommendationId != null) {
|
|
79
75
|
contents.recommendationId = (0, smithy_client_1.expectString)(data.recommendationId);
|
|
80
76
|
}
|
|
81
77
|
return contents;
|
|
82
78
|
};
|
|
83
|
-
exports.
|
|
84
|
-
const
|
|
79
|
+
exports.de_GetPersonalizedRankingCommand = de_GetPersonalizedRankingCommand;
|
|
80
|
+
const de_GetPersonalizedRankingCommandError = async (output, context) => {
|
|
85
81
|
const parsedOutput = {
|
|
86
82
|
...output,
|
|
87
83
|
body: await parseErrorBody(output.body, context),
|
|
@@ -90,10 +86,10 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
|
|
|
90
86
|
switch (errorCode) {
|
|
91
87
|
case "InvalidInputException":
|
|
92
88
|
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
93
|
-
throw await
|
|
89
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
94
90
|
case "ResourceNotFoundException":
|
|
95
91
|
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
96
|
-
throw await
|
|
92
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
97
93
|
default:
|
|
98
94
|
const parsedBody = parsedOutput.body;
|
|
99
95
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -104,24 +100,24 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
|
|
|
104
100
|
});
|
|
105
101
|
}
|
|
106
102
|
};
|
|
107
|
-
const
|
|
103
|
+
const de_GetRecommendationsCommand = async (output, context) => {
|
|
108
104
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
109
|
-
return
|
|
105
|
+
return de_GetRecommendationsCommandError(output, context);
|
|
110
106
|
}
|
|
111
107
|
const contents = map({
|
|
112
108
|
$metadata: deserializeMetadata(output),
|
|
113
109
|
});
|
|
114
110
|
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
115
111
|
if (data.itemList != null) {
|
|
116
|
-
contents.itemList =
|
|
112
|
+
contents.itemList = de_ItemList(data.itemList, context);
|
|
117
113
|
}
|
|
118
114
|
if (data.recommendationId != null) {
|
|
119
115
|
contents.recommendationId = (0, smithy_client_1.expectString)(data.recommendationId);
|
|
120
116
|
}
|
|
121
117
|
return contents;
|
|
122
118
|
};
|
|
123
|
-
exports.
|
|
124
|
-
const
|
|
119
|
+
exports.de_GetRecommendationsCommand = de_GetRecommendationsCommand;
|
|
120
|
+
const de_GetRecommendationsCommandError = async (output, context) => {
|
|
125
121
|
const parsedOutput = {
|
|
126
122
|
...output,
|
|
127
123
|
body: await parseErrorBody(output.body, context),
|
|
@@ -130,10 +126,10 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
|
|
|
130
126
|
switch (errorCode) {
|
|
131
127
|
case "InvalidInputException":
|
|
132
128
|
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
133
|
-
throw await
|
|
129
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
134
130
|
case "ResourceNotFoundException":
|
|
135
131
|
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
136
|
-
throw await
|
|
132
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
137
133
|
default:
|
|
138
134
|
const parsedBody = parsedOutput.body;
|
|
139
135
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -145,7 +141,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
|
|
|
145
141
|
}
|
|
146
142
|
};
|
|
147
143
|
const map = smithy_client_1.map;
|
|
148
|
-
const
|
|
144
|
+
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
149
145
|
const contents = map({});
|
|
150
146
|
const data = parsedOutput.body;
|
|
151
147
|
if (data.message != null) {
|
|
@@ -157,7 +153,7 @@ const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutpu
|
|
|
157
153
|
});
|
|
158
154
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
159
155
|
};
|
|
160
|
-
const
|
|
156
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
161
157
|
const contents = map({});
|
|
162
158
|
const data = parsedOutput.body;
|
|
163
159
|
if (data.message != null) {
|
|
@@ -169,7 +165,7 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
|
|
|
169
165
|
});
|
|
170
166
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
171
167
|
};
|
|
172
|
-
const
|
|
168
|
+
const se_Context = (input, context) => {
|
|
173
169
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
174
170
|
if (value === null) {
|
|
175
171
|
return acc;
|
|
@@ -178,7 +174,7 @@ const serializeAws_restJson1Context = (input, context) => {
|
|
|
178
174
|
return acc;
|
|
179
175
|
}, {});
|
|
180
176
|
};
|
|
181
|
-
const
|
|
177
|
+
const se_FilterValues = (input, context) => {
|
|
182
178
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
183
179
|
if (value === null) {
|
|
184
180
|
return acc;
|
|
@@ -187,42 +183,40 @@ const serializeAws_restJson1FilterValues = (input, context) => {
|
|
|
187
183
|
return acc;
|
|
188
184
|
}, {});
|
|
189
185
|
};
|
|
190
|
-
const
|
|
186
|
+
const se_InputList = (input, context) => {
|
|
191
187
|
return input
|
|
192
188
|
.filter((e) => e != null)
|
|
193
189
|
.map((entry) => {
|
|
194
190
|
return entry;
|
|
195
191
|
});
|
|
196
192
|
};
|
|
197
|
-
const
|
|
193
|
+
const se_Promotion = (input, context) => {
|
|
198
194
|
return {
|
|
199
195
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
200
|
-
...(input.filterValues != null && {
|
|
201
|
-
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
202
|
-
}),
|
|
196
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
203
197
|
...(input.name != null && { name: input.name }),
|
|
204
198
|
...(input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }),
|
|
205
199
|
};
|
|
206
200
|
};
|
|
207
|
-
const
|
|
201
|
+
const se_PromotionList = (input, context) => {
|
|
208
202
|
return input
|
|
209
203
|
.filter((e) => e != null)
|
|
210
204
|
.map((entry) => {
|
|
211
|
-
return
|
|
205
|
+
return se_Promotion(entry, context);
|
|
212
206
|
});
|
|
213
207
|
};
|
|
214
|
-
const
|
|
208
|
+
const de_ItemList = (output, context) => {
|
|
215
209
|
const retVal = (output || [])
|
|
216
210
|
.filter((e) => e != null)
|
|
217
211
|
.map((entry) => {
|
|
218
212
|
if (entry === null) {
|
|
219
213
|
return null;
|
|
220
214
|
}
|
|
221
|
-
return
|
|
215
|
+
return de_PredictedItem(entry, context);
|
|
222
216
|
});
|
|
223
217
|
return retVal;
|
|
224
218
|
};
|
|
225
|
-
const
|
|
219
|
+
const de_PredictedItem = (output, context) => {
|
|
226
220
|
return {
|
|
227
221
|
itemId: (0, smithy_client_1.expectString)(output.itemId),
|
|
228
222
|
promotionName: (0, smithy_client_1.expectString)(output.promotionName),
|
|
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
4
|
import { GetPersonalizedRankingRequestFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
-
import {
|
|
5
|
+
import { de_GetPersonalizedRankingCommand, se_GetPersonalizedRankingCommand } from "../protocols/Aws_restJson1";
|
|
6
6
|
export class GetPersonalizedRankingCommand extends $Command {
|
|
7
7
|
static getEndpointParameterInstructions() {
|
|
8
8
|
return {
|
|
@@ -34,9 +34,9 @@ export class GetPersonalizedRankingCommand extends $Command {
|
|
|
34
34
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
35
|
}
|
|
36
36
|
serialize(input, context) {
|
|
37
|
-
return
|
|
37
|
+
return se_GetPersonalizedRankingCommand(input, context);
|
|
38
38
|
}
|
|
39
39
|
deserialize(output, context) {
|
|
40
|
-
return
|
|
40
|
+
return de_GetPersonalizedRankingCommand(output, context);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
4
|
import { GetRecommendationsRequestFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
-
import {
|
|
5
|
+
import { de_GetRecommendationsCommand, se_GetRecommendationsCommand } from "../protocols/Aws_restJson1";
|
|
6
6
|
export class GetRecommendationsCommand extends $Command {
|
|
7
7
|
static getEndpointParameterInstructions() {
|
|
8
8
|
return {
|
|
@@ -34,9 +34,9 @@ export class GetRecommendationsCommand extends $Command {
|
|
|
34
34
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
35
|
}
|
|
36
36
|
serialize(input, context) {
|
|
37
|
-
return
|
|
37
|
+
return se_GetRecommendationsCommand(input, context);
|
|
38
38
|
}
|
|
39
39
|
deserialize(output, context) {
|
|
40
|
-
return
|
|
40
|
+
return de_GetRecommendationsCommand(output, context);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -2,7 +2,7 @@ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
|
2
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
3
|
import { InvalidInputException, ResourceNotFoundException } from "../models/models_0";
|
|
4
4
|
import { PersonalizeRuntimeServiceException as __BaseException } from "../models/PersonalizeRuntimeServiceException";
|
|
5
|
-
export const
|
|
5
|
+
export const se_GetPersonalizedRankingCommand = async (input, context) => {
|
|
6
6
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
7
|
const headers = {
|
|
8
8
|
"content-type": "application/json",
|
|
@@ -11,12 +11,10 @@ export const serializeAws_restJson1GetPersonalizedRankingCommand = async (input,
|
|
|
11
11
|
let body;
|
|
12
12
|
body = JSON.stringify({
|
|
13
13
|
...(input.campaignArn != null && { campaignArn: input.campaignArn }),
|
|
14
|
-
...(input.context != null && { context:
|
|
14
|
+
...(input.context != null && { context: se_Context(input.context, context) }),
|
|
15
15
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
16
|
-
...(input.filterValues != null && {
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
...(input.inputList != null && { inputList: serializeAws_restJson1InputList(input.inputList, context) }),
|
|
16
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
17
|
+
...(input.inputList != null && { inputList: se_InputList(input.inputList, context) }),
|
|
20
18
|
...(input.userId != null && { userId: input.userId }),
|
|
21
19
|
});
|
|
22
20
|
return new __HttpRequest({
|
|
@@ -29,7 +27,7 @@ export const serializeAws_restJson1GetPersonalizedRankingCommand = async (input,
|
|
|
29
27
|
body,
|
|
30
28
|
});
|
|
31
29
|
};
|
|
32
|
-
export const
|
|
30
|
+
export const se_GetRecommendationsCommand = async (input, context) => {
|
|
33
31
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
34
32
|
const headers = {
|
|
35
33
|
"content-type": "application/json",
|
|
@@ -38,14 +36,12 @@ export const serializeAws_restJson1GetRecommendationsCommand = async (input, con
|
|
|
38
36
|
let body;
|
|
39
37
|
body = JSON.stringify({
|
|
40
38
|
...(input.campaignArn != null && { campaignArn: input.campaignArn }),
|
|
41
|
-
...(input.context != null && { context:
|
|
39
|
+
...(input.context != null && { context: se_Context(input.context, context) }),
|
|
42
40
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
43
|
-
...(input.filterValues != null && {
|
|
44
|
-
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
45
|
-
}),
|
|
41
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
46
42
|
...(input.itemId != null && { itemId: input.itemId }),
|
|
47
43
|
...(input.numResults != null && { numResults: input.numResults }),
|
|
48
|
-
...(input.promotions != null && { promotions:
|
|
44
|
+
...(input.promotions != null && { promotions: se_PromotionList(input.promotions, context) }),
|
|
49
45
|
...(input.recommenderArn != null && { recommenderArn: input.recommenderArn }),
|
|
50
46
|
...(input.userId != null && { userId: input.userId }),
|
|
51
47
|
});
|
|
@@ -59,23 +55,23 @@ export const serializeAws_restJson1GetRecommendationsCommand = async (input, con
|
|
|
59
55
|
body,
|
|
60
56
|
});
|
|
61
57
|
};
|
|
62
|
-
export const
|
|
58
|
+
export const de_GetPersonalizedRankingCommand = async (output, context) => {
|
|
63
59
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
64
|
-
return
|
|
60
|
+
return de_GetPersonalizedRankingCommandError(output, context);
|
|
65
61
|
}
|
|
66
62
|
const contents = map({
|
|
67
63
|
$metadata: deserializeMetadata(output),
|
|
68
64
|
});
|
|
69
65
|
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
70
66
|
if (data.personalizedRanking != null) {
|
|
71
|
-
contents.personalizedRanking =
|
|
67
|
+
contents.personalizedRanking = de_ItemList(data.personalizedRanking, context);
|
|
72
68
|
}
|
|
73
69
|
if (data.recommendationId != null) {
|
|
74
70
|
contents.recommendationId = __expectString(data.recommendationId);
|
|
75
71
|
}
|
|
76
72
|
return contents;
|
|
77
73
|
};
|
|
78
|
-
const
|
|
74
|
+
const de_GetPersonalizedRankingCommandError = async (output, context) => {
|
|
79
75
|
const parsedOutput = {
|
|
80
76
|
...output,
|
|
81
77
|
body: await parseErrorBody(output.body, context),
|
|
@@ -84,10 +80,10 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
|
|
|
84
80
|
switch (errorCode) {
|
|
85
81
|
case "InvalidInputException":
|
|
86
82
|
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
87
|
-
throw await
|
|
83
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
88
84
|
case "ResourceNotFoundException":
|
|
89
85
|
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
90
|
-
throw await
|
|
86
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
91
87
|
default:
|
|
92
88
|
const parsedBody = parsedOutput.body;
|
|
93
89
|
throwDefaultError({
|
|
@@ -98,23 +94,23 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
|
|
|
98
94
|
});
|
|
99
95
|
}
|
|
100
96
|
};
|
|
101
|
-
export const
|
|
97
|
+
export const de_GetRecommendationsCommand = async (output, context) => {
|
|
102
98
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
103
|
-
return
|
|
99
|
+
return de_GetRecommendationsCommandError(output, context);
|
|
104
100
|
}
|
|
105
101
|
const contents = map({
|
|
106
102
|
$metadata: deserializeMetadata(output),
|
|
107
103
|
});
|
|
108
104
|
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
109
105
|
if (data.itemList != null) {
|
|
110
|
-
contents.itemList =
|
|
106
|
+
contents.itemList = de_ItemList(data.itemList, context);
|
|
111
107
|
}
|
|
112
108
|
if (data.recommendationId != null) {
|
|
113
109
|
contents.recommendationId = __expectString(data.recommendationId);
|
|
114
110
|
}
|
|
115
111
|
return contents;
|
|
116
112
|
};
|
|
117
|
-
const
|
|
113
|
+
const de_GetRecommendationsCommandError = async (output, context) => {
|
|
118
114
|
const parsedOutput = {
|
|
119
115
|
...output,
|
|
120
116
|
body: await parseErrorBody(output.body, context),
|
|
@@ -123,10 +119,10 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
|
|
|
123
119
|
switch (errorCode) {
|
|
124
120
|
case "InvalidInputException":
|
|
125
121
|
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
126
|
-
throw await
|
|
122
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
127
123
|
case "ResourceNotFoundException":
|
|
128
124
|
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
129
|
-
throw await
|
|
125
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
130
126
|
default:
|
|
131
127
|
const parsedBody = parsedOutput.body;
|
|
132
128
|
throwDefaultError({
|
|
@@ -138,7 +134,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
|
|
|
138
134
|
}
|
|
139
135
|
};
|
|
140
136
|
const map = __map;
|
|
141
|
-
const
|
|
137
|
+
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
142
138
|
const contents = map({});
|
|
143
139
|
const data = parsedOutput.body;
|
|
144
140
|
if (data.message != null) {
|
|
@@ -150,7 +146,7 @@ const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutpu
|
|
|
150
146
|
});
|
|
151
147
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
152
148
|
};
|
|
153
|
-
const
|
|
149
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
154
150
|
const contents = map({});
|
|
155
151
|
const data = parsedOutput.body;
|
|
156
152
|
if (data.message != null) {
|
|
@@ -162,7 +158,7 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
|
|
|
162
158
|
});
|
|
163
159
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
164
160
|
};
|
|
165
|
-
const
|
|
161
|
+
const se_Context = (input, context) => {
|
|
166
162
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
167
163
|
if (value === null) {
|
|
168
164
|
return acc;
|
|
@@ -171,7 +167,7 @@ const serializeAws_restJson1Context = (input, context) => {
|
|
|
171
167
|
return acc;
|
|
172
168
|
}, {});
|
|
173
169
|
};
|
|
174
|
-
const
|
|
170
|
+
const se_FilterValues = (input, context) => {
|
|
175
171
|
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
176
172
|
if (value === null) {
|
|
177
173
|
return acc;
|
|
@@ -180,42 +176,40 @@ const serializeAws_restJson1FilterValues = (input, context) => {
|
|
|
180
176
|
return acc;
|
|
181
177
|
}, {});
|
|
182
178
|
};
|
|
183
|
-
const
|
|
179
|
+
const se_InputList = (input, context) => {
|
|
184
180
|
return input
|
|
185
181
|
.filter((e) => e != null)
|
|
186
182
|
.map((entry) => {
|
|
187
183
|
return entry;
|
|
188
184
|
});
|
|
189
185
|
};
|
|
190
|
-
const
|
|
186
|
+
const se_Promotion = (input, context) => {
|
|
191
187
|
return {
|
|
192
188
|
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
193
|
-
...(input.filterValues != null && {
|
|
194
|
-
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
195
|
-
}),
|
|
189
|
+
...(input.filterValues != null && { filterValues: se_FilterValues(input.filterValues, context) }),
|
|
196
190
|
...(input.name != null && { name: input.name }),
|
|
197
191
|
...(input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }),
|
|
198
192
|
};
|
|
199
193
|
};
|
|
200
|
-
const
|
|
194
|
+
const se_PromotionList = (input, context) => {
|
|
201
195
|
return input
|
|
202
196
|
.filter((e) => e != null)
|
|
203
197
|
.map((entry) => {
|
|
204
|
-
return
|
|
198
|
+
return se_Promotion(entry, context);
|
|
205
199
|
});
|
|
206
200
|
};
|
|
207
|
-
const
|
|
201
|
+
const de_ItemList = (output, context) => {
|
|
208
202
|
const retVal = (output || [])
|
|
209
203
|
.filter((e) => e != null)
|
|
210
204
|
.map((entry) => {
|
|
211
205
|
if (entry === null) {
|
|
212
206
|
return null;
|
|
213
207
|
}
|
|
214
|
-
return
|
|
208
|
+
return de_PredictedItem(entry, context);
|
|
215
209
|
});
|
|
216
210
|
return retVal;
|
|
217
211
|
};
|
|
218
|
-
const
|
|
212
|
+
const de_PredictedItem = (output, context) => {
|
|
219
213
|
return {
|
|
220
214
|
itemId: __expectString(output.itemId),
|
|
221
215
|
promotionName: __expectString(output.promotionName),
|
|
@@ -2,7 +2,19 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@a
|
|
|
2
2
|
import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
|
|
3
3
|
import { GetPersonalizedRankingCommandInput, GetPersonalizedRankingCommandOutput } from "../commands/GetPersonalizedRankingCommand";
|
|
4
4
|
import { GetRecommendationsCommandInput, GetRecommendationsCommandOutput } from "../commands/GetRecommendationsCommand";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
5
|
+
/**
|
|
6
|
+
* serializeAws_restJson1GetPersonalizedRankingCommand
|
|
7
|
+
*/
|
|
8
|
+
export declare const se_GetPersonalizedRankingCommand: (input: GetPersonalizedRankingCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
9
|
+
/**
|
|
10
|
+
* serializeAws_restJson1GetRecommendationsCommand
|
|
11
|
+
*/
|
|
12
|
+
export declare const se_GetRecommendationsCommand: (input: GetRecommendationsCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
13
|
+
/**
|
|
14
|
+
* deserializeAws_restJson1GetPersonalizedRankingCommand
|
|
15
|
+
*/
|
|
16
|
+
export declare const de_GetPersonalizedRankingCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetPersonalizedRankingCommandOutput>;
|
|
17
|
+
/**
|
|
18
|
+
* deserializeAws_restJson1GetRecommendationsCommand
|
|
19
|
+
*/
|
|
20
|
+
export declare const de_GetRecommendationsCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetRecommendationsCommandOutput>;
|
|
@@ -11,19 +11,19 @@ import {
|
|
|
11
11
|
GetRecommendationsCommandInput,
|
|
12
12
|
GetRecommendationsCommandOutput,
|
|
13
13
|
} from "../commands/GetRecommendationsCommand";
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const se_GetPersonalizedRankingCommand: (
|
|
15
15
|
input: GetPersonalizedRankingCommandInput,
|
|
16
16
|
context: __SerdeContext
|
|
17
17
|
) => Promise<__HttpRequest>;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const se_GetRecommendationsCommand: (
|
|
19
19
|
input: GetRecommendationsCommandInput,
|
|
20
20
|
context: __SerdeContext
|
|
21
21
|
) => Promise<__HttpRequest>;
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const de_GetPersonalizedRankingCommand: (
|
|
23
23
|
output: __HttpResponse,
|
|
24
24
|
context: __SerdeContext
|
|
25
25
|
) => Promise<GetPersonalizedRankingCommandOutput>;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const de_GetRecommendationsCommand: (
|
|
27
27
|
output: __HttpResponse,
|
|
28
28
|
context: __SerdeContext
|
|
29
29
|
) => Promise<GetRecommendationsCommandOutput>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-personalize-runtime",
|
|
3
3
|
"description": "AWS SDK for JavaScript Personalize Runtime Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.309.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
24
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
+
"@aws-sdk/client-sts": "3.309.0",
|
|
25
25
|
"@aws-sdk/config-resolver": "3.306.0",
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
26
|
+
"@aws-sdk/credential-provider-node": "3.309.0",
|
|
27
27
|
"@aws-sdk/fetch-http-handler": "3.306.0",
|
|
28
28
|
"@aws-sdk/hash-node": "3.306.0",
|
|
29
29
|
"@aws-sdk/invalid-dependency": "3.306.0",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@aws-sdk/node-config-provider": "3.306.0",
|
|
41
41
|
"@aws-sdk/node-http-handler": "3.306.0",
|
|
42
42
|
"@aws-sdk/protocol-http": "3.306.0",
|
|
43
|
-
"@aws-sdk/smithy-client": "3.
|
|
43
|
+
"@aws-sdk/smithy-client": "3.309.0",
|
|
44
44
|
"@aws-sdk/types": "3.306.0",
|
|
45
45
|
"@aws-sdk/url-parser": "3.306.0",
|
|
46
46
|
"@aws-sdk/util-base64": "3.303.0",
|
|
47
47
|
"@aws-sdk/util-body-length-browser": "3.303.0",
|
|
48
48
|
"@aws-sdk/util-body-length-node": "3.303.0",
|
|
49
|
-
"@aws-sdk/util-defaults-mode-browser": "3.
|
|
50
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
49
|
+
"@aws-sdk/util-defaults-mode-browser": "3.309.0",
|
|
50
|
+
"@aws-sdk/util-defaults-mode-node": "3.309.0",
|
|
51
51
|
"@aws-sdk/util-endpoints": "3.306.0",
|
|
52
52
|
"@aws-sdk/util-retry": "3.306.0",
|
|
53
53
|
"@aws-sdk/util-user-agent-browser": "3.306.0",
|