@aws-sdk/client-personalize-runtime 3.141.0 → 3.149.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/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.149.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.148.0...v3.149.0) (2022-08-12)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-personalize-runtime:** This release provides support for promotions in AWS Personalize runtime. ([f7e4104](https://github.com/aws/aws-sdk-js-v3/commit/f7e410466be43961aec27fa05f5e0aa3eae0df8b))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-personalize-runtime
20
+
21
+
22
+
23
+
24
+
25
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
26
+
27
+
28
+ ### Features
29
+
30
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
31
+
32
+
33
+
34
+
35
+
6
36
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
37
 
8
38
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetRecommendationsResponseFilterSensitiveLog = exports.GetRecommendationsRequestFilterSensitiveLog = exports.GetPersonalizedRankingResponseFilterSensitiveLog = exports.PredictedItemFilterSensitiveLog = exports.GetPersonalizedRankingRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.InvalidInputException = void 0;
3
+ exports.GetRecommendationsResponseFilterSensitiveLog = exports.GetRecommendationsRequestFilterSensitiveLog = exports.PromotionFilterSensitiveLog = exports.GetPersonalizedRankingResponseFilterSensitiveLog = exports.PredictedItemFilterSensitiveLog = exports.GetPersonalizedRankingRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.InvalidInputException = void 0;
4
4
  const smithy_client_1 = require("@aws-sdk/smithy-client");
5
5
  const PersonalizeRuntimeServiceException_1 = require("./PersonalizeRuntimeServiceException");
6
6
  class InvalidInputException extends PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException {
@@ -43,10 +43,16 @@ const GetPersonalizedRankingResponseFilterSensitiveLog = (obj) => ({
43
43
  ...obj,
44
44
  });
45
45
  exports.GetPersonalizedRankingResponseFilterSensitiveLog = GetPersonalizedRankingResponseFilterSensitiveLog;
46
+ const PromotionFilterSensitiveLog = (obj) => ({
47
+ ...obj,
48
+ ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
49
+ });
50
+ exports.PromotionFilterSensitiveLog = PromotionFilterSensitiveLog;
46
51
  const GetRecommendationsRequestFilterSensitiveLog = (obj) => ({
47
52
  ...obj,
48
53
  ...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
49
54
  ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
55
+ ...(obj.promotions && { promotions: obj.promotions.map((item) => (0, exports.PromotionFilterSensitiveLog)(item)) }),
50
56
  });
51
57
  exports.GetRecommendationsRequestFilterSensitiveLog = GetRecommendationsRequestFilterSensitiveLog;
52
58
  const GetRecommendationsResponseFilterSensitiveLog = (obj) => ({
@@ -49,6 +49,7 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
49
49
  }),
50
50
  ...(input.itemId != null && { itemId: input.itemId }),
51
51
  ...(input.numResults != null && { numResults: input.numResults }),
52
+ ...(input.promotions != null && { promotions: serializeAws_restJson1PromotionList(input.promotions, context) }),
52
53
  ...(input.recommenderArn != null && { recommenderArn: input.recommenderArn }),
53
54
  ...(input.userId != null && { userId: input.userId }),
54
55
  });
@@ -67,19 +68,17 @@ const deserializeAws_restJson1GetPersonalizedRankingCommand = async (output, con
67
68
  if (output.statusCode !== 200 && output.statusCode >= 300) {
68
69
  return deserializeAws_restJson1GetPersonalizedRankingCommandError(output, context);
69
70
  }
70
- const contents = {
71
+ const contents = map({
71
72
  $metadata: deserializeMetadata(output),
72
- personalizedRanking: undefined,
73
- recommendationId: undefined,
74
- };
73
+ });
75
74
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
76
- if (data.personalizedRanking !== undefined && data.personalizedRanking !== null) {
75
+ if (data.personalizedRanking != null) {
77
76
  contents.personalizedRanking = deserializeAws_restJson1ItemList(data.personalizedRanking, context);
78
77
  }
79
- if (data.recommendationId !== undefined && data.recommendationId !== null) {
78
+ if (data.recommendationId != null) {
80
79
  contents.recommendationId = (0, smithy_client_1.expectString)(data.recommendationId);
81
80
  }
82
- return Promise.resolve(contents);
81
+ return contents;
83
82
  };
84
83
  exports.deserializeAws_restJson1GetPersonalizedRankingCommand = deserializeAws_restJson1GetPersonalizedRankingCommand;
85
84
  const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output, context) => {
@@ -87,7 +86,6 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
87
86
  ...output,
88
87
  body: await parseBody(output.body, context),
89
88
  };
90
- let response;
91
89
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
92
90
  switch (errorCode) {
93
91
  case "InvalidInputException":
@@ -98,33 +96,29 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
98
96
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
99
97
  default:
100
98
  const parsedBody = parsedOutput.body;
101
- const $metadata = deserializeMetadata(output);
102
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
103
- response = new PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException({
104
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
105
- $fault: "client",
106
- $metadata,
99
+ (0, smithy_client_1.throwDefaultError)({
100
+ output,
101
+ parsedBody,
102
+ exceptionCtor: PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException,
103
+ errorCode,
107
104
  });
108
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
109
105
  }
110
106
  };
111
107
  const deserializeAws_restJson1GetRecommendationsCommand = async (output, context) => {
112
108
  if (output.statusCode !== 200 && output.statusCode >= 300) {
113
109
  return deserializeAws_restJson1GetRecommendationsCommandError(output, context);
114
110
  }
115
- const contents = {
111
+ const contents = map({
116
112
  $metadata: deserializeMetadata(output),
117
- itemList: undefined,
118
- recommendationId: undefined,
119
- };
113
+ });
120
114
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
121
- if (data.itemList !== undefined && data.itemList !== null) {
115
+ if (data.itemList != null) {
122
116
  contents.itemList = deserializeAws_restJson1ItemList(data.itemList, context);
123
117
  }
124
- if (data.recommendationId !== undefined && data.recommendationId !== null) {
118
+ if (data.recommendationId != null) {
125
119
  contents.recommendationId = (0, smithy_client_1.expectString)(data.recommendationId);
126
120
  }
127
- return Promise.resolve(contents);
121
+ return contents;
128
122
  };
129
123
  exports.deserializeAws_restJson1GetRecommendationsCommand = deserializeAws_restJson1GetRecommendationsCommand;
130
124
  const deserializeAws_restJson1GetRecommendationsCommandError = async (output, context) => {
@@ -132,7 +126,6 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
132
126
  ...output,
133
127
  body: await parseBody(output.body, context),
134
128
  };
135
- let response;
136
129
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
137
130
  switch (errorCode) {
138
131
  case "InvalidInputException":
@@ -143,20 +136,19 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
143
136
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
144
137
  default:
145
138
  const parsedBody = parsedOutput.body;
146
- const $metadata = deserializeMetadata(output);
147
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
148
- response = new PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException({
149
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
150
- $fault: "client",
151
- $metadata,
139
+ (0, smithy_client_1.throwDefaultError)({
140
+ output,
141
+ parsedBody,
142
+ exceptionCtor: PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException,
143
+ errorCode,
152
144
  });
153
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
154
145
  }
155
146
  };
147
+ const map = smithy_client_1.map;
156
148
  const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutput, context) => {
157
- const contents = {};
149
+ const contents = map({});
158
150
  const data = parsedOutput.body;
159
- if (data.message !== undefined && data.message !== null) {
151
+ if (data.message != null) {
160
152
  contents.message = (0, smithy_client_1.expectString)(data.message);
161
153
  }
162
154
  const exception = new models_0_1.InvalidInputException({
@@ -166,9 +158,9 @@ const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutpu
166
158
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
167
159
  };
168
160
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
169
- const contents = {};
161
+ const contents = map({});
170
162
  const data = parsedOutput.body;
171
- if (data.message !== undefined && data.message !== null) {
163
+ if (data.message != null) {
172
164
  contents.message = (0, smithy_client_1.expectString)(data.message);
173
165
  }
174
166
  const exception = new models_0_1.ResourceNotFoundException({
@@ -203,12 +195,26 @@ const serializeAws_restJson1InputList = (input, context) => {
203
195
  return input
204
196
  .filter((e) => e != null)
205
197
  .map((entry) => {
206
- if (entry === null) {
207
- return null;
208
- }
209
198
  return entry;
210
199
  });
211
200
  };
201
+ const serializeAws_restJson1Promotion = (input, context) => {
202
+ return {
203
+ ...(input.filterArn != null && { filterArn: input.filterArn }),
204
+ ...(input.filterValues != null && {
205
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
206
+ }),
207
+ ...(input.name != null && { name: input.name }),
208
+ ...(input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }),
209
+ };
210
+ };
211
+ const serializeAws_restJson1PromotionList = (input, context) => {
212
+ return input
213
+ .filter((e) => e != null)
214
+ .map((entry) => {
215
+ return serializeAws_restJson1Promotion(entry, context);
216
+ });
217
+ };
212
218
  const deserializeAws_restJson1ItemList = (output, context) => {
213
219
  const retVal = (output || [])
214
220
  .filter((e) => e != null)
@@ -223,6 +229,7 @@ const deserializeAws_restJson1ItemList = (output, context) => {
223
229
  const deserializeAws_restJson1PredictedItem = (output, context) => {
224
230
  return {
225
231
  itemId: (0, smithy_client_1.expectString)(output.itemId),
232
+ promotionName: (0, smithy_client_1.expectString)(output.promotionName),
226
233
  score: (0, smithy_client_1.limitedParseDouble)(output.score),
227
234
  };
228
235
  };
@@ -28,5 +28,6 @@ export { ResourceNotFoundException };
28
28
  export var GetPersonalizedRankingRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
29
29
  export var PredictedItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
30
30
  export var GetPersonalizedRankingResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
31
- export var GetRecommendationsRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
31
+ export var PromotionFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
32
+ export var GetRecommendationsRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING })), (obj.promotions && { promotions: obj.promotions.map(function (item) { return PromotionFilterSensitiveLog(item); }) }))); };
32
33
  export var GetRecommendationsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, } from "@aws-sdk/smithy-client";
3
+ 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";
4
4
  import { InvalidInputException, ResourceNotFoundException } from "../models/models_0";
5
5
  import { PersonalizeRuntimeServiceException as __BaseException } from "../models/PersonalizeRuntimeServiceException";
6
6
  export var serializeAws_restJson1GetPersonalizedRankingCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -40,9 +40,9 @@ export var serializeAws_restJson1GetRecommendationsCommand = function (input, co
40
40
  "content-type": "application/json",
41
41
  };
42
42
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/recommendations";
43
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn != null && { campaignArn: input.campaignArn })), (input.context != null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
43
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn != null && { campaignArn: input.campaignArn })), (input.context != null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
44
44
  filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
45
- })), (input.itemId != null && { itemId: input.itemId })), (input.numResults != null && { numResults: input.numResults })), (input.recommenderArn != null && { recommenderArn: input.recommenderArn })), (input.userId != null && { userId: input.userId })));
45
+ })), (input.itemId != null && { itemId: input.itemId })), (input.numResults != null && { numResults: input.numResults })), (input.promotions != null && { promotions: serializeAws_restJson1PromotionList(input.promotions, context) })), (input.recommenderArn != null && { recommenderArn: input.recommenderArn })), (input.userId != null && { userId: input.userId })));
46
46
  return [2, new __HttpRequest({
47
47
  protocol: protocol,
48
48
  hostname: hostname,
@@ -63,28 +63,26 @@ export var deserializeAws_restJson1GetPersonalizedRankingCommand = function (out
63
63
  if (output.statusCode !== 200 && output.statusCode >= 300) {
64
64
  return [2, deserializeAws_restJson1GetPersonalizedRankingCommandError(output, context)];
65
65
  }
66
- contents = {
66
+ contents = map({
67
67
  $metadata: deserializeMetadata(output),
68
- personalizedRanking: undefined,
69
- recommendationId: undefined,
70
- };
68
+ });
71
69
  _a = __expectNonNull;
72
70
  _b = __expectObject;
73
71
  return [4, parseBody(output.body, context)];
74
72
  case 1:
75
73
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
76
- if (data.personalizedRanking !== undefined && data.personalizedRanking !== null) {
74
+ if (data.personalizedRanking != null) {
77
75
  contents.personalizedRanking = deserializeAws_restJson1ItemList(data.personalizedRanking, context);
78
76
  }
79
- if (data.recommendationId !== undefined && data.recommendationId !== null) {
77
+ if (data.recommendationId != null) {
80
78
  contents.recommendationId = __expectString(data.recommendationId);
81
79
  }
82
- return [2, Promise.resolve(contents)];
80
+ return [2, contents];
83
81
  }
84
82
  });
85
83
  }); };
86
84
  var deserializeAws_restJson1GetPersonalizedRankingCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
87
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
85
+ var parsedOutput, _a, errorCode, _b, parsedBody;
88
86
  var _c;
89
87
  return __generator(this, function (_d) {
90
88
  switch (_d.label) {
@@ -109,14 +107,14 @@ var deserializeAws_restJson1GetPersonalizedRankingCommandError = function (outpu
109
107
  case 5: throw _d.sent();
110
108
  case 6:
111
109
  parsedBody = parsedOutput.body;
112
- $metadata = deserializeMetadata(output);
113
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
114
- response = new __BaseException({
115
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
116
- $fault: "client",
117
- $metadata: $metadata,
110
+ throwDefaultError({
111
+ output: output,
112
+ parsedBody: parsedBody,
113
+ exceptionCtor: __BaseException,
114
+ errorCode: errorCode,
118
115
  });
119
- throw __decorateServiceException(response, parsedBody);
116
+ _d.label = 7;
117
+ case 7: return [2];
120
118
  }
121
119
  });
122
120
  }); };
@@ -128,28 +126,26 @@ export var deserializeAws_restJson1GetRecommendationsCommand = function (output,
128
126
  if (output.statusCode !== 200 && output.statusCode >= 300) {
129
127
  return [2, deserializeAws_restJson1GetRecommendationsCommandError(output, context)];
130
128
  }
131
- contents = {
129
+ contents = map({
132
130
  $metadata: deserializeMetadata(output),
133
- itemList: undefined,
134
- recommendationId: undefined,
135
- };
131
+ });
136
132
  _a = __expectNonNull;
137
133
  _b = __expectObject;
138
134
  return [4, parseBody(output.body, context)];
139
135
  case 1:
140
136
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
141
- if (data.itemList !== undefined && data.itemList !== null) {
137
+ if (data.itemList != null) {
142
138
  contents.itemList = deserializeAws_restJson1ItemList(data.itemList, context);
143
139
  }
144
- if (data.recommendationId !== undefined && data.recommendationId !== null) {
140
+ if (data.recommendationId != null) {
145
141
  contents.recommendationId = __expectString(data.recommendationId);
146
142
  }
147
- return [2, Promise.resolve(contents)];
143
+ return [2, contents];
148
144
  }
149
145
  });
150
146
  }); };
151
147
  var deserializeAws_restJson1GetRecommendationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
152
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
148
+ var parsedOutput, _a, errorCode, _b, parsedBody;
153
149
  var _c;
154
150
  return __generator(this, function (_d) {
155
151
  switch (_d.label) {
@@ -174,23 +170,24 @@ var deserializeAws_restJson1GetRecommendationsCommandError = function (output, c
174
170
  case 5: throw _d.sent();
175
171
  case 6:
176
172
  parsedBody = parsedOutput.body;
177
- $metadata = deserializeMetadata(output);
178
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
179
- response = new __BaseException({
180
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
181
- $fault: "client",
182
- $metadata: $metadata,
173
+ throwDefaultError({
174
+ output: output,
175
+ parsedBody: parsedBody,
176
+ exceptionCtor: __BaseException,
177
+ errorCode: errorCode,
183
178
  });
184
- throw __decorateServiceException(response, parsedBody);
179
+ _d.label = 7;
180
+ case 7: return [2];
185
181
  }
186
182
  });
187
183
  }); };
184
+ var map = __map;
188
185
  var deserializeAws_restJson1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
189
186
  var contents, data, exception;
190
187
  return __generator(this, function (_a) {
191
- contents = {};
188
+ contents = map({});
192
189
  data = parsedOutput.body;
193
- if (data.message !== undefined && data.message !== null) {
190
+ if (data.message != null) {
194
191
  contents.message = __expectString(data.message);
195
192
  }
196
193
  exception = new InvalidInputException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -200,9 +197,9 @@ var deserializeAws_restJson1InvalidInputExceptionResponse = function (parsedOutp
200
197
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
201
198
  var contents, data, exception;
202
199
  return __generator(this, function (_a) {
203
- contents = {};
200
+ contents = map({});
204
201
  data = parsedOutput.body;
205
- if (data.message !== undefined && data.message !== null) {
202
+ if (data.message != null) {
206
203
  contents.message = __expectString(data.message);
207
204
  }
208
205
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -233,12 +230,21 @@ var serializeAws_restJson1InputList = function (input, context) {
233
230
  return input
234
231
  .filter(function (e) { return e != null; })
235
232
  .map(function (entry) {
236
- if (entry === null) {
237
- return null;
238
- }
239
233
  return entry;
240
234
  });
241
235
  };
236
+ var serializeAws_restJson1Promotion = function (input, context) {
237
+ return __assign(__assign(__assign(__assign({}, (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
238
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
239
+ })), (input.name != null && { name: input.name })), (input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }));
240
+ };
241
+ var serializeAws_restJson1PromotionList = function (input, context) {
242
+ return input
243
+ .filter(function (e) { return e != null; })
244
+ .map(function (entry) {
245
+ return serializeAws_restJson1Promotion(entry, context);
246
+ });
247
+ };
242
248
  var deserializeAws_restJson1ItemList = function (output, context) {
243
249
  var retVal = (output || [])
244
250
  .filter(function (e) { return e != null; })
@@ -253,6 +259,7 @@ var deserializeAws_restJson1ItemList = function (output, context) {
253
259
  var deserializeAws_restJson1PredictedItem = function (output, context) {
254
260
  return {
255
261
  itemId: __expectString(output.itemId),
262
+ promotionName: __expectString(output.promotionName),
256
263
  score: __limitedParseDouble(output.score),
257
264
  };
258
265
  };
@@ -56,6 +56,10 @@ export interface PredictedItem {
56
56
  * selection. For more information on scoring logic, see <a>how-scores-work</a>.</p>
57
57
  */
58
58
  score?: number;
59
+ /**
60
+ * <p>The name of the promotion that included the predicted item.</p>
61
+ */
62
+ promotionName?: string;
59
63
  }
60
64
  export interface GetPersonalizedRankingResponse {
61
65
  /**
@@ -89,6 +93,37 @@ export declare class ResourceNotFoundException extends __BaseException {
89
93
  */
90
94
  constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
91
95
  }
96
+ /**
97
+ * <p>Contains information on a promotion. A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>
98
+ */
99
+ export interface Promotion {
100
+ /**
101
+ * <p>The name of the promotion.</p>
102
+ */
103
+ name?: string;
104
+ /**
105
+ * <p>The percentage of recommended items to apply the promotion to.</p>
106
+ */
107
+ percentPromotedItems?: number;
108
+ /**
109
+ * <p>The Amazon Resource Name (ARN) of the filter used by the promotion. This filter defines the criteria for promoted items. For more information, see
110
+ * <a href="https://docs.aws.amazon.com/personalize/latest/dg/promoting-items.html#promotion-filters">Promotion filters</a>.</p>
111
+ */
112
+ filterArn?: string;
113
+ /**
114
+ * <p>The values to use when promoting items.
115
+ * For each placeholder parameter in your promotion's filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
116
+ * </p>
117
+ * <p>For filter expressions that use an <code>INCLUDE</code> element to include items,
118
+ * you must provide values for all parameters that are defined in the expression. For
119
+ * filters with expressions that use an <code>EXCLUDE</code> element to exclude items, you
120
+ * can omit the <code>filter-values</code>. In this case, Amazon Personalize doesn't use that portion of
121
+ * the expression to filter recommendations.</p>
122
+ * <p>For more information on creating filters, see
123
+ * <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering recommendations and user segments</a>.</p>
124
+ */
125
+ filterValues?: Record<string, string>;
126
+ }
92
127
  export interface GetRecommendationsRequest {
93
128
  /**
94
129
  * <p>The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.</p>
@@ -130,7 +165,7 @@ export interface GetRecommendationsRequest {
130
165
  * can omit the <code>filter-values</code>.In this case, Amazon Personalize doesn't use that portion of
131
166
  * the expression to filter recommendations.</p>
132
167
  * <p>For more information, see
133
- * <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering Recommendations</a>.</p>
168
+ * <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering recommendations and user segments</a>.</p>
134
169
  */
135
170
  filterValues?: Record<string, string>;
136
171
  /**
@@ -138,6 +173,11 @@ export interface GetRecommendationsRequest {
138
173
  * created a Domain dataset group with a recommender for a domain use case.</p>
139
174
  */
140
175
  recommenderArn?: string;
176
+ /**
177
+ * <p>The promotions to apply to the recommendation request.
178
+ * A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>
179
+ */
180
+ promotions?: Promotion[];
141
181
  }
142
182
  export interface GetRecommendationsResponse {
143
183
  /**
@@ -162,6 +202,10 @@ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => an
162
202
  * @internal
163
203
  */
164
204
  export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
205
+ /**
206
+ * @internal
207
+ */
208
+ export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
165
209
  /**
166
210
  * @internal
167
211
  */
@@ -20,6 +20,8 @@ export interface PredictedItem {
20
20
  itemId?: string;
21
21
 
22
22
  score?: number;
23
+
24
+ promotionName?: string;
23
25
  }
24
26
  export interface GetPersonalizedRankingResponse {
25
27
 
@@ -41,6 +43,17 @@ export declare class ResourceNotFoundException extends __BaseException {
41
43
 
42
44
  constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
43
45
  }
46
+
47
+ export interface Promotion {
48
+
49
+ name?: string;
50
+
51
+ percentPromotedItems?: number;
52
+
53
+ filterArn?: string;
54
+
55
+ filterValues?: Record<string, string>;
56
+ }
44
57
  export interface GetRecommendationsRequest {
45
58
 
46
59
  campaignArn?: string;
@@ -58,6 +71,8 @@ export interface GetRecommendationsRequest {
58
71
  filterValues?: Record<string, string>;
59
72
 
60
73
  recommenderArn?: string;
74
+
75
+ promotions?: Promotion[];
61
76
  }
62
77
  export interface GetRecommendationsResponse {
63
78
 
@@ -72,6 +87,8 @@ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => an
72
87
 
73
88
  export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
74
89
 
90
+ export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
91
+
75
92
  export declare const GetRecommendationsRequestFilterSensitiveLog: (obj: GetRecommendationsRequest) => any;
76
93
 
77
94
  export declare const GetRecommendationsResponseFilterSensitiveLog: (obj: GetRecommendationsResponse) => any;
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.141.0",
4
+ "version": "3.149.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",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.141.0",
21
+ "@aws-sdk/client-sts": "3.145.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.141.0",
23
+ "@aws-sdk/credential-provider-node": "3.145.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.131.0",
25
25
  "@aws-sdk/hash-node": "3.127.0",
26
26
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -36,15 +36,15 @@
36
36
  "@aws-sdk/node-config-provider": "3.127.0",
37
37
  "@aws-sdk/node-http-handler": "3.127.0",
38
38
  "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.137.0",
39
+ "@aws-sdk/smithy-client": "3.142.0",
40
40
  "@aws-sdk/types": "3.127.0",
41
41
  "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
48
  "@aws-sdk/util-user-agent-browser": "3.127.0",
49
49
  "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",
@@ -61,6 +61,11 @@
61
61
  "typedoc": "0.19.2",
62
62
  "typescript": "~4.6.2"
63
63
  },
64
+ "overrides": {
65
+ "typedoc": {
66
+ "typescript": "~4.6.2"
67
+ }
68
+ },
64
69
  "engines": {
65
70
  "node": ">=12.0.0"
66
71
  },