@aws-sdk/client-personalize-runtime 3.131.0 → 3.142.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,39 @@
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.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **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))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * **clients:** update client endpoints as of 2022-08-01 ([aaf49f2](https://github.com/aws/aws-sdk-js-v3/commit/aaf49f21b371412e6ea7e00890b71a7b31991b66))
23
+
24
+
25
+
26
+
27
+
28
+ # [3.137.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.136.1...v3.137.0) (2022-07-26)
29
+
30
+
31
+ ### Features
32
+
33
+ * **namespaces:** remove namespaces with only a log filter ([#3823](https://github.com/aws/aws-sdk-js-v3/issues/3823)) ([33e6822](https://github.com/aws/aws-sdk-js-v3/commit/33e68228fb64c53dd8f89e6be76dd5f46edc3cfd))
34
+
35
+
36
+
37
+
38
+
6
39
  # [3.131.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.130.0...v3.131.0) (2022-07-15)
7
40
 
8
41
  **Note:** Version bump only for package @aws-sdk/client-personalize-runtime
package/README.md CHANGED
@@ -165,7 +165,7 @@ try {
165
165
  const data = await client.send(command);
166
166
  // process data.
167
167
  } catch (error) {
168
- const { requestId, cfId, extendedRequestId } = error.$metadata;
168
+ const { requestId, cfId, extendedRequestId } = error.$$metadata;
169
169
  console.log({ requestId, cfId, extendedRequestId });
170
170
  /**
171
171
  * The keys within exceptions are also parsed.
@@ -20,8 +20,8 @@ class GetPersonalizedRankingCommand extends smithy_client_1.Command {
20
20
  logger,
21
21
  clientName,
22
22
  commandName,
23
- inputFilterSensitiveLog: models_0_1.GetPersonalizedRankingRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: models_0_1.GetPersonalizedRankingResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: models_0_1.GetPersonalizedRankingRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.GetPersonalizedRankingResponseFilterSensitiveLog,
25
25
  };
26
26
  const { requestHandler } = configuration;
27
27
  return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
@@ -20,8 +20,8 @@ class GetRecommendationsCommand extends smithy_client_1.Command {
20
20
  logger,
21
21
  clientName,
22
22
  commandName,
23
- inputFilterSensitiveLog: models_0_1.GetRecommendationsRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: models_0_1.GetRecommendationsResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: models_0_1.GetRecommendationsRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.GetRecommendationsResponseFilterSensitiveLog,
25
25
  };
26
26
  const { requestHandler } = configuration;
27
27
  return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
@@ -1,28 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetRecommendationsResponse = exports.GetRecommendationsRequest = exports.ResourceNotFoundException = exports.InvalidInputException = exports.GetPersonalizedRankingResponse = exports.PredictedItem = exports.GetPersonalizedRankingRequest = void 0;
3
+ exports.GetRecommendationsResponseFilterSensitiveLog = exports.GetRecommendationsRequestFilterSensitiveLog = 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
- var GetPersonalizedRankingRequest;
7
- (function (GetPersonalizedRankingRequest) {
8
- GetPersonalizedRankingRequest.filterSensitiveLog = (obj) => ({
9
- ...obj,
10
- ...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
11
- ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
12
- });
13
- })(GetPersonalizedRankingRequest = exports.GetPersonalizedRankingRequest || (exports.GetPersonalizedRankingRequest = {}));
14
- var PredictedItem;
15
- (function (PredictedItem) {
16
- PredictedItem.filterSensitiveLog = (obj) => ({
17
- ...obj,
18
- });
19
- })(PredictedItem = exports.PredictedItem || (exports.PredictedItem = {}));
20
- var GetPersonalizedRankingResponse;
21
- (function (GetPersonalizedRankingResponse) {
22
- GetPersonalizedRankingResponse.filterSensitiveLog = (obj) => ({
23
- ...obj,
24
- });
25
- })(GetPersonalizedRankingResponse = exports.GetPersonalizedRankingResponse || (exports.GetPersonalizedRankingResponse = {}));
26
6
  class InvalidInputException extends PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException {
27
7
  constructor(opts) {
28
8
  super({
@@ -49,17 +29,27 @@ class ResourceNotFoundException extends PersonalizeRuntimeServiceException_1.Per
49
29
  }
50
30
  }
51
31
  exports.ResourceNotFoundException = ResourceNotFoundException;
52
- var GetRecommendationsRequest;
53
- (function (GetRecommendationsRequest) {
54
- GetRecommendationsRequest.filterSensitiveLog = (obj) => ({
55
- ...obj,
56
- ...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
57
- ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
58
- });
59
- })(GetRecommendationsRequest = exports.GetRecommendationsRequest || (exports.GetRecommendationsRequest = {}));
60
- var GetRecommendationsResponse;
61
- (function (GetRecommendationsResponse) {
62
- GetRecommendationsResponse.filterSensitiveLog = (obj) => ({
63
- ...obj,
64
- });
65
- })(GetRecommendationsResponse = exports.GetRecommendationsResponse || (exports.GetRecommendationsResponse = {}));
32
+ const GetPersonalizedRankingRequestFilterSensitiveLog = (obj) => ({
33
+ ...obj,
34
+ ...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
35
+ ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
36
+ });
37
+ exports.GetPersonalizedRankingRequestFilterSensitiveLog = GetPersonalizedRankingRequestFilterSensitiveLog;
38
+ const PredictedItemFilterSensitiveLog = (obj) => ({
39
+ ...obj,
40
+ });
41
+ exports.PredictedItemFilterSensitiveLog = PredictedItemFilterSensitiveLog;
42
+ const GetPersonalizedRankingResponseFilterSensitiveLog = (obj) => ({
43
+ ...obj,
44
+ });
45
+ exports.GetPersonalizedRankingResponseFilterSensitiveLog = GetPersonalizedRankingResponseFilterSensitiveLog;
46
+ const GetRecommendationsRequestFilterSensitiveLog = (obj) => ({
47
+ ...obj,
48
+ ...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
49
+ ...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
50
+ });
51
+ exports.GetRecommendationsRequestFilterSensitiveLog = GetRecommendationsRequestFilterSensitiveLog;
52
+ const GetRecommendationsResponseFilterSensitiveLog = (obj) => ({
53
+ ...obj,
54
+ });
55
+ exports.GetRecommendationsResponseFilterSensitiveLog = GetRecommendationsResponseFilterSensitiveLog;
@@ -67,19 +67,17 @@ const deserializeAws_restJson1GetPersonalizedRankingCommand = async (output, con
67
67
  if (output.statusCode !== 200 && output.statusCode >= 300) {
68
68
  return deserializeAws_restJson1GetPersonalizedRankingCommandError(output, context);
69
69
  }
70
- const contents = {
70
+ const contents = map({
71
71
  $metadata: deserializeMetadata(output),
72
- personalizedRanking: undefined,
73
- recommendationId: undefined,
74
- };
72
+ });
75
73
  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) {
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 = (0, smithy_client_1.expectString)(data.recommendationId);
81
79
  }
82
- return Promise.resolve(contents);
80
+ return contents;
83
81
  };
84
82
  exports.deserializeAws_restJson1GetPersonalizedRankingCommand = deserializeAws_restJson1GetPersonalizedRankingCommand;
85
83
  const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output, context) => {
@@ -87,7 +85,6 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
87
85
  ...output,
88
86
  body: await parseBody(output.body, context),
89
87
  };
90
- let response;
91
88
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
92
89
  switch (errorCode) {
93
90
  case "InvalidInputException":
@@ -98,33 +95,29 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
98
95
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
99
96
  default:
100
97
  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,
98
+ (0, smithy_client_1.throwDefaultError)({
99
+ output,
100
+ parsedBody,
101
+ exceptionCtor: PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException,
102
+ errorCode,
107
103
  });
108
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
109
104
  }
110
105
  };
111
106
  const deserializeAws_restJson1GetRecommendationsCommand = async (output, context) => {
112
107
  if (output.statusCode !== 200 && output.statusCode >= 300) {
113
108
  return deserializeAws_restJson1GetRecommendationsCommandError(output, context);
114
109
  }
115
- const contents = {
110
+ const contents = map({
116
111
  $metadata: deserializeMetadata(output),
117
- itemList: undefined,
118
- recommendationId: undefined,
119
- };
112
+ });
120
113
  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) {
114
+ if (data.itemList != null) {
122
115
  contents.itemList = deserializeAws_restJson1ItemList(data.itemList, context);
123
116
  }
124
- if (data.recommendationId !== undefined && data.recommendationId !== null) {
117
+ if (data.recommendationId != null) {
125
118
  contents.recommendationId = (0, smithy_client_1.expectString)(data.recommendationId);
126
119
  }
127
- return Promise.resolve(contents);
120
+ return contents;
128
121
  };
129
122
  exports.deserializeAws_restJson1GetRecommendationsCommand = deserializeAws_restJson1GetRecommendationsCommand;
130
123
  const deserializeAws_restJson1GetRecommendationsCommandError = async (output, context) => {
@@ -132,7 +125,6 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
132
125
  ...output,
133
126
  body: await parseBody(output.body, context),
134
127
  };
135
- let response;
136
128
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
137
129
  switch (errorCode) {
138
130
  case "InvalidInputException":
@@ -143,20 +135,19 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
143
135
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
144
136
  default:
145
137
  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,
138
+ (0, smithy_client_1.throwDefaultError)({
139
+ output,
140
+ parsedBody,
141
+ exceptionCtor: PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException,
142
+ errorCode,
152
143
  });
153
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
154
144
  }
155
145
  };
146
+ const map = smithy_client_1.map;
156
147
  const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutput, context) => {
157
- const contents = {};
148
+ const contents = map({});
158
149
  const data = parsedOutput.body;
159
- if (data.message !== undefined && data.message !== null) {
150
+ if (data.message != null) {
160
151
  contents.message = (0, smithy_client_1.expectString)(data.message);
161
152
  }
162
153
  const exception = new models_0_1.InvalidInputException({
@@ -166,9 +157,9 @@ const deserializeAws_restJson1InvalidInputExceptionResponse = async (parsedOutpu
166
157
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
167
158
  };
168
159
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
169
- const contents = {};
160
+ const contents = map({});
170
161
  const data = parsedOutput.body;
171
- if (data.message !== undefined && data.message !== null) {
162
+ if (data.message != null) {
172
163
  contents.message = (0, smithy_client_1.expectString)(data.message);
173
164
  }
174
165
  const exception = new models_0_1.ResourceNotFoundException({
@@ -203,9 +194,6 @@ const serializeAws_restJson1InputList = (input, context) => {
203
194
  return input
204
195
  .filter((e) => e != null)
205
196
  .map((entry) => {
206
- if (entry === null) {
207
- return null;
208
- }
209
197
  return entry;
210
198
  });
211
199
  };
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { GetPersonalizedRankingRequest, GetPersonalizedRankingResponse } from "../models/models_0";
4
+ import { GetPersonalizedRankingRequestFilterSensitiveLog, GetPersonalizedRankingResponseFilterSensitiveLog, } from "../models/models_0";
5
5
  import { deserializeAws_restJson1GetPersonalizedRankingCommand, serializeAws_restJson1GetPersonalizedRankingCommand, } from "../protocols/Aws_restJson1";
6
6
  var GetPersonalizedRankingCommand = (function (_super) {
7
7
  __extends(GetPersonalizedRankingCommand, _super);
@@ -20,8 +20,8 @@ var GetPersonalizedRankingCommand = (function (_super) {
20
20
  logger: logger,
21
21
  clientName: clientName,
22
22
  commandName: commandName,
23
- inputFilterSensitiveLog: GetPersonalizedRankingRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: GetPersonalizedRankingResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: GetPersonalizedRankingRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: GetPersonalizedRankingResponseFilterSensitiveLog,
25
25
  };
26
26
  var requestHandler = configuration.requestHandler;
27
27
  return stack.resolve(function (request) {
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
3
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import { GetRecommendationsRequest, GetRecommendationsResponse } from "../models/models_0";
4
+ import { GetRecommendationsRequestFilterSensitiveLog, GetRecommendationsResponseFilterSensitiveLog, } from "../models/models_0";
5
5
  import { deserializeAws_restJson1GetRecommendationsCommand, serializeAws_restJson1GetRecommendationsCommand, } from "../protocols/Aws_restJson1";
6
6
  var GetRecommendationsCommand = (function (_super) {
7
7
  __extends(GetRecommendationsCommand, _super);
@@ -20,8 +20,8 @@ var GetRecommendationsCommand = (function (_super) {
20
20
  logger: logger,
21
21
  clientName: clientName,
22
22
  commandName: commandName,
23
- inputFilterSensitiveLog: GetRecommendationsRequest.filterSensitiveLog,
24
- outputFilterSensitiveLog: GetRecommendationsResponse.filterSensitiveLog,
23
+ inputFilterSensitiveLog: GetRecommendationsRequestFilterSensitiveLog,
24
+ outputFilterSensitiveLog: GetRecommendationsResponseFilterSensitiveLog,
25
25
  };
26
26
  var requestHandler = configuration.requestHandler;
27
27
  return stack.resolve(function (request) {
@@ -1,18 +1,6 @@
1
1
  import { __assign, __extends } from "tslib";
2
2
  import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
3
3
  import { PersonalizeRuntimeServiceException as __BaseException } from "./PersonalizeRuntimeServiceException";
4
- export var GetPersonalizedRankingRequest;
5
- (function (GetPersonalizedRankingRequest) {
6
- GetPersonalizedRankingRequest.filterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
7
- })(GetPersonalizedRankingRequest || (GetPersonalizedRankingRequest = {}));
8
- export var PredictedItem;
9
- (function (PredictedItem) {
10
- PredictedItem.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
11
- })(PredictedItem || (PredictedItem = {}));
12
- export var GetPersonalizedRankingResponse;
13
- (function (GetPersonalizedRankingResponse) {
14
- GetPersonalizedRankingResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
15
- })(GetPersonalizedRankingResponse || (GetPersonalizedRankingResponse = {}));
16
4
  var InvalidInputException = (function (_super) {
17
5
  __extends(InvalidInputException, _super);
18
6
  function InvalidInputException(opts) {
@@ -37,11 +25,8 @@ var ResourceNotFoundException = (function (_super) {
37
25
  return ResourceNotFoundException;
38
26
  }(__BaseException));
39
27
  export { ResourceNotFoundException };
40
- export var GetRecommendationsRequest;
41
- (function (GetRecommendationsRequest) {
42
- GetRecommendationsRequest.filterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
43
- })(GetRecommendationsRequest || (GetRecommendationsRequest = {}));
44
- export var GetRecommendationsResponse;
45
- (function (GetRecommendationsResponse) {
46
- GetRecommendationsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
47
- })(GetRecommendationsResponse || (GetRecommendationsResponse = {}));
28
+ export var GetPersonalizedRankingRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
29
+ export var PredictedItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
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 }))); };
32
+ 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 () {
@@ -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,9 +230,6 @@ 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
  };
@@ -41,12 +41,6 @@ export interface GetPersonalizedRankingRequest {
41
41
  */
42
42
  filterValues?: Record<string, string>;
43
43
  }
44
- export declare namespace GetPersonalizedRankingRequest {
45
- /**
46
- * @internal
47
- */
48
- const filterSensitiveLog: (obj: GetPersonalizedRankingRequest) => any;
49
- }
50
44
  /**
51
45
  * <p>An object that identifies an item.</p>
52
46
  * <p>The and APIs return a list of
@@ -63,12 +57,6 @@ export interface PredictedItem {
63
57
  */
64
58
  score?: number;
65
59
  }
66
- export declare namespace PredictedItem {
67
- /**
68
- * @internal
69
- */
70
- const filterSensitiveLog: (obj: PredictedItem) => any;
71
- }
72
60
  export interface GetPersonalizedRankingResponse {
73
61
  /**
74
62
  * <p>A list of items in order of most likely interest to the user. The maximum is 500.</p>
@@ -79,12 +67,6 @@ export interface GetPersonalizedRankingResponse {
79
67
  */
80
68
  recommendationId?: string;
81
69
  }
82
- export declare namespace GetPersonalizedRankingResponse {
83
- /**
84
- * @internal
85
- */
86
- const filterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
87
- }
88
70
  /**
89
71
  * <p>Provide a valid value for the field or parameter.</p>
90
72
  */
@@ -157,12 +139,6 @@ export interface GetRecommendationsRequest {
157
139
  */
158
140
  recommenderArn?: string;
159
141
  }
160
- export declare namespace GetRecommendationsRequest {
161
- /**
162
- * @internal
163
- */
164
- const filterSensitiveLog: (obj: GetRecommendationsRequest) => any;
165
- }
166
142
  export interface GetRecommendationsResponse {
167
143
  /**
168
144
  * <p>A list of recommendations sorted in descending order by prediction score. There can be a
@@ -174,9 +150,23 @@ export interface GetRecommendationsResponse {
174
150
  */
175
151
  recommendationId?: string;
176
152
  }
177
- export declare namespace GetRecommendationsResponse {
178
- /**
179
- * @internal
180
- */
181
- const filterSensitiveLog: (obj: GetRecommendationsResponse) => any;
182
- }
153
+ /**
154
+ * @internal
155
+ */
156
+ export declare const GetPersonalizedRankingRequestFilterSensitiveLog: (obj: GetPersonalizedRankingRequest) => any;
157
+ /**
158
+ * @internal
159
+ */
160
+ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => any;
161
+ /**
162
+ * @internal
163
+ */
164
+ export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
165
+ /**
166
+ * @internal
167
+ */
168
+ export declare const GetRecommendationsRequestFilterSensitiveLog: (obj: GetRecommendationsRequest) => any;
169
+ /**
170
+ * @internal
171
+ */
172
+ export declare const GetRecommendationsResponseFilterSensitiveLog: (obj: GetRecommendationsResponse) => any;
@@ -14,10 +14,6 @@ export interface GetPersonalizedRankingRequest {
14
14
 
15
15
  filterValues?: Record<string, string>;
16
16
  }
17
- export declare namespace GetPersonalizedRankingRequest {
18
-
19
- const filterSensitiveLog: (obj: GetPersonalizedRankingRequest) => any;
20
- }
21
17
 
22
18
  export interface PredictedItem {
23
19
 
@@ -25,20 +21,12 @@ export interface PredictedItem {
25
21
 
26
22
  score?: number;
27
23
  }
28
- export declare namespace PredictedItem {
29
-
30
- const filterSensitiveLog: (obj: PredictedItem) => any;
31
- }
32
24
  export interface GetPersonalizedRankingResponse {
33
25
 
34
26
  personalizedRanking?: PredictedItem[];
35
27
 
36
28
  recommendationId?: string;
37
29
  }
38
- export declare namespace GetPersonalizedRankingResponse {
39
-
40
- const filterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
41
- }
42
30
 
43
31
  export declare class InvalidInputException extends __BaseException {
44
32
  readonly name: "InvalidInputException";
@@ -71,17 +59,19 @@ export interface GetRecommendationsRequest {
71
59
 
72
60
  recommenderArn?: string;
73
61
  }
74
- export declare namespace GetRecommendationsRequest {
75
-
76
- const filterSensitiveLog: (obj: GetRecommendationsRequest) => any;
77
- }
78
62
  export interface GetRecommendationsResponse {
79
63
 
80
64
  itemList?: PredictedItem[];
81
65
 
82
66
  recommendationId?: string;
83
67
  }
84
- export declare namespace GetRecommendationsResponse {
85
-
86
- const filterSensitiveLog: (obj: GetRecommendationsResponse) => any;
87
- }
68
+
69
+ export declare const GetPersonalizedRankingRequestFilterSensitiveLog: (obj: GetPersonalizedRankingRequest) => any;
70
+
71
+ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => any;
72
+
73
+ export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
74
+
75
+ export declare const GetRecommendationsRequestFilterSensitiveLog: (obj: GetRecommendationsRequest) => any;
76
+
77
+ 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.131.0",
4
+ "version": "3.142.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.131.0",
21
+ "@aws-sdk/client-sts": "3.142.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.131.0",
23
+ "@aws-sdk/credential-provider-node": "3.142.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.127.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.127.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.130.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",