@aws-sdk/client-personalize-events 3.312.0 → 3.316.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.
@@ -1,52 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PersonalizeEvents = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const PutEventsCommand_1 = require("./commands/PutEventsCommand");
5
6
  const PutItemsCommand_1 = require("./commands/PutItemsCommand");
6
7
  const PutUsersCommand_1 = require("./commands/PutUsersCommand");
7
8
  const PersonalizeEventsClient_1 = require("./PersonalizeEventsClient");
9
+ const commands = {
10
+ PutEventsCommand: PutEventsCommand_1.PutEventsCommand,
11
+ PutItemsCommand: PutItemsCommand_1.PutItemsCommand,
12
+ PutUsersCommand: PutUsersCommand_1.PutUsersCommand,
13
+ };
8
14
  class PersonalizeEvents extends PersonalizeEventsClient_1.PersonalizeEventsClient {
9
- putEvents(args, optionsOrCb, cb) {
10
- const command = new PutEventsCommand_1.PutEventsCommand(args);
11
- if (typeof optionsOrCb === "function") {
12
- this.send(command, optionsOrCb);
13
- }
14
- else if (typeof cb === "function") {
15
- if (typeof optionsOrCb !== "object")
16
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
17
- this.send(command, optionsOrCb || {}, cb);
18
- }
19
- else {
20
- return this.send(command, optionsOrCb);
21
- }
22
- }
23
- putItems(args, optionsOrCb, cb) {
24
- const command = new PutItemsCommand_1.PutItemsCommand(args);
25
- if (typeof optionsOrCb === "function") {
26
- this.send(command, optionsOrCb);
27
- }
28
- else if (typeof cb === "function") {
29
- if (typeof optionsOrCb !== "object")
30
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
31
- this.send(command, optionsOrCb || {}, cb);
32
- }
33
- else {
34
- return this.send(command, optionsOrCb);
35
- }
36
- }
37
- putUsers(args, optionsOrCb, cb) {
38
- const command = new PutUsersCommand_1.PutUsersCommand(args);
39
- if (typeof optionsOrCb === "function") {
40
- this.send(command, optionsOrCb);
41
- }
42
- else if (typeof cb === "function") {
43
- if (typeof optionsOrCb !== "object")
44
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
45
- this.send(command, optionsOrCb || {}, cb);
46
- }
47
- else {
48
- return this.send(command, optionsOrCb);
49
- }
50
- }
51
15
  }
52
16
  exports.PersonalizeEvents = PersonalizeEvents;
17
+ (0, smithy_client_1.createAggregatedClient)(commands, PersonalizeEvents);
@@ -12,12 +12,12 @@ const se_PutEventsCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/events";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.eventList != null && { eventList: se_EventList(input.eventList, context) }),
17
- ...(input.sessionId != null && { sessionId: input.sessionId }),
18
- ...(input.trackingId != null && { trackingId: input.trackingId }),
19
- ...(input.userId != null && { userId: input.userId }),
20
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ eventList: (_) => se_EventList(_, context),
17
+ sessionId: [],
18
+ trackingId: [],
19
+ userId: [],
20
+ }));
21
21
  return new protocol_http_1.HttpRequest({
22
22
  protocol,
23
23
  hostname,
@@ -36,10 +36,10 @@ const se_PutItemsCommand = async (input, context) => {
36
36
  };
37
37
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/items";
38
38
  let body;
39
- body = JSON.stringify({
40
- ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
41
- ...(input.items != null && { items: se_ItemList(input.items, context) }),
42
- });
39
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
40
+ datasetArn: [],
41
+ items: (_) => se_ItemList(_, context),
42
+ }));
43
43
  return new protocol_http_1.HttpRequest({
44
44
  protocol,
45
45
  hostname,
@@ -58,10 +58,10 @@ const se_PutUsersCommand = async (input, context) => {
58
58
  };
59
59
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/users";
60
60
  let body;
61
- body = JSON.stringify({
62
- ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
63
- ...(input.users != null && { users: se_UserList(input.users, context) }),
64
- });
61
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
62
+ datasetArn: [],
63
+ users: (_) => se_UserList(_, context),
64
+ }));
65
65
  return new protocol_http_1.HttpRequest({
66
66
  protocol,
67
67
  hostname,
@@ -77,7 +77,7 @@ const de_PutEventsCommand = async (output, context) => {
77
77
  if (output.statusCode !== 200 && output.statusCode >= 300) {
78
78
  return de_PutEventsCommandError(output, context);
79
79
  }
80
- const contents = map({
80
+ const contents = (0, smithy_client_1.map)({
81
81
  $metadata: deserializeMetadata(output),
82
82
  });
83
83
  await collectBody(output.body, context);
@@ -96,10 +96,9 @@ const de_PutEventsCommandError = async (output, context) => {
96
96
  throw await de_InvalidInputExceptionRes(parsedOutput, context);
97
97
  default:
98
98
  const parsedBody = parsedOutput.body;
99
- (0, smithy_client_1.throwDefaultError)({
99
+ return throwDefaultError({
100
100
  output,
101
101
  parsedBody,
102
- exceptionCtor: PersonalizeEventsServiceException_1.PersonalizeEventsServiceException,
103
102
  errorCode,
104
103
  });
105
104
  }
@@ -108,7 +107,7 @@ const de_PutItemsCommand = async (output, context) => {
108
107
  if (output.statusCode !== 200 && output.statusCode >= 300) {
109
108
  return de_PutItemsCommandError(output, context);
110
109
  }
111
- const contents = map({
110
+ const contents = (0, smithy_client_1.map)({
112
111
  $metadata: deserializeMetadata(output),
113
112
  });
114
113
  await collectBody(output.body, context);
@@ -133,10 +132,9 @@ const de_PutItemsCommandError = async (output, context) => {
133
132
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
134
133
  default:
135
134
  const parsedBody = parsedOutput.body;
136
- (0, smithy_client_1.throwDefaultError)({
135
+ return throwDefaultError({
137
136
  output,
138
137
  parsedBody,
139
- exceptionCtor: PersonalizeEventsServiceException_1.PersonalizeEventsServiceException,
140
138
  errorCode,
141
139
  });
142
140
  }
@@ -145,7 +143,7 @@ const de_PutUsersCommand = async (output, context) => {
145
143
  if (output.statusCode !== 200 && output.statusCode >= 300) {
146
144
  return de_PutUsersCommandError(output, context);
147
145
  }
148
- const contents = map({
146
+ const contents = (0, smithy_client_1.map)({
149
147
  $metadata: deserializeMetadata(output),
150
148
  });
151
149
  await collectBody(output.body, context);
@@ -170,21 +168,21 @@ const de_PutUsersCommandError = async (output, context) => {
170
168
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
171
169
  default:
172
170
  const parsedBody = parsedOutput.body;
173
- (0, smithy_client_1.throwDefaultError)({
171
+ return throwDefaultError({
174
172
  output,
175
173
  parsedBody,
176
- exceptionCtor: PersonalizeEventsServiceException_1.PersonalizeEventsServiceException,
177
174
  errorCode,
178
175
  });
179
176
  }
180
177
  };
181
- const map = smithy_client_1.map;
178
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(PersonalizeEventsServiceException_1.PersonalizeEventsServiceException);
182
179
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
183
- const contents = map({});
180
+ const contents = (0, smithy_client_1.map)({});
184
181
  const data = parsedOutput.body;
185
- if (data.message != null) {
186
- contents.message = (0, smithy_client_1.expectString)(data.message);
187
- }
182
+ const doc = (0, smithy_client_1.take)(data, {
183
+ message: smithy_client_1.expectString,
184
+ });
185
+ Object.assign(contents, doc);
188
186
  const exception = new models_0_1.InvalidInputException({
189
187
  $metadata: deserializeMetadata(parsedOutput),
190
188
  ...contents,
@@ -192,11 +190,12 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
192
190
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
193
191
  };
194
192
  const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
195
- const contents = map({});
193
+ const contents = (0, smithy_client_1.map)({});
196
194
  const data = parsedOutput.body;
197
- if (data.message != null) {
198
- contents.message = (0, smithy_client_1.expectString)(data.message);
199
- }
195
+ const doc = (0, smithy_client_1.take)(data, {
196
+ message: smithy_client_1.expectString,
197
+ });
198
+ Object.assign(contents, doc);
200
199
  const exception = new models_0_1.ResourceInUseException({
201
200
  $metadata: deserializeMetadata(parsedOutput),
202
201
  ...contents,
@@ -204,11 +203,12 @@ const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
204
203
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
205
204
  };
206
205
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
207
- const contents = map({});
206
+ const contents = (0, smithy_client_1.map)({});
208
207
  const data = parsedOutput.body;
209
- if (data.message != null) {
210
- contents.message = (0, smithy_client_1.expectString)(data.message);
211
- }
208
+ const doc = (0, smithy_client_1.take)(data, {
209
+ message: smithy_client_1.expectString,
210
+ });
211
+ Object.assign(contents, doc);
212
212
  const exception = new models_0_1.ResourceNotFoundException({
213
213
  $metadata: deserializeMetadata(parsedOutput),
214
214
  ...contents,
@@ -216,19 +216,17 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
216
216
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
217
217
  };
218
218
  const se_Event = (input, context) => {
219
- return {
220
- ...(input.eventId != null && { eventId: input.eventId }),
221
- ...(input.eventType != null && { eventType: input.eventType }),
222
- ...(input.eventValue != null && { eventValue: (0, smithy_client_1.serializeFloat)(input.eventValue) }),
223
- ...(input.impression != null && { impression: se_Impression(input.impression, context) }),
224
- ...(input.itemId != null && { itemId: input.itemId }),
225
- ...(input.metricAttribution != null && {
226
- metricAttribution: se_MetricAttribution(input.metricAttribution, context),
227
- }),
228
- ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
229
- ...(input.recommendationId != null && { recommendationId: input.recommendationId }),
230
- ...(input.sentAt != null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }),
231
- };
219
+ return (0, smithy_client_1.take)(input, {
220
+ eventId: [],
221
+ eventType: [],
222
+ eventValue: smithy_client_1.serializeFloat,
223
+ impression: smithy_client_1._json,
224
+ itemId: [],
225
+ metricAttribution: smithy_client_1._json,
226
+ properties: smithy_client_1.LazyJsonString.fromObject,
227
+ recommendationId: [],
228
+ sentAt: (_) => Math.round(_.getTime() / 1000),
229
+ });
232
230
  };
233
231
  const se_EventList = (input, context) => {
234
232
  return input
@@ -237,18 +235,11 @@ const se_EventList = (input, context) => {
237
235
  return se_Event(entry, context);
238
236
  });
239
237
  };
240
- const se_Impression = (input, context) => {
241
- return input
242
- .filter((e) => e != null)
243
- .map((entry) => {
244
- return entry;
245
- });
246
- };
247
238
  const se_Item = (input, context) => {
248
- return {
249
- ...(input.itemId != null && { itemId: input.itemId }),
250
- ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
251
- };
239
+ return (0, smithy_client_1.take)(input, {
240
+ itemId: [],
241
+ properties: smithy_client_1.LazyJsonString.fromObject,
242
+ });
252
243
  };
253
244
  const se_ItemList = (input, context) => {
254
245
  return input
@@ -257,16 +248,11 @@ const se_ItemList = (input, context) => {
257
248
  return se_Item(entry, context);
258
249
  });
259
250
  };
260
- const se_MetricAttribution = (input, context) => {
261
- return {
262
- ...(input.eventAttributionSource != null && { eventAttributionSource: input.eventAttributionSource }),
263
- };
264
- };
265
251
  const se_User = (input, context) => {
266
- return {
267
- ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
268
- ...(input.userId != null && { userId: input.userId }),
269
- };
252
+ return (0, smithy_client_1.take)(input, {
253
+ properties: smithy_client_1.LazyJsonString.fromObject,
254
+ userId: [],
255
+ });
270
256
  };
271
257
  const se_UserList = (input, context) => {
272
258
  return input
@@ -1,48 +1,13 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { PutEventsCommand } from "./commands/PutEventsCommand";
2
3
  import { PutItemsCommand } from "./commands/PutItemsCommand";
3
4
  import { PutUsersCommand } from "./commands/PutUsersCommand";
4
5
  import { PersonalizeEventsClient } from "./PersonalizeEventsClient";
6
+ const commands = {
7
+ PutEventsCommand,
8
+ PutItemsCommand,
9
+ PutUsersCommand,
10
+ };
5
11
  export class PersonalizeEvents extends PersonalizeEventsClient {
6
- putEvents(args, optionsOrCb, cb) {
7
- const command = new PutEventsCommand(args);
8
- if (typeof optionsOrCb === "function") {
9
- this.send(command, optionsOrCb);
10
- }
11
- else if (typeof cb === "function") {
12
- if (typeof optionsOrCb !== "object")
13
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
14
- this.send(command, optionsOrCb || {}, cb);
15
- }
16
- else {
17
- return this.send(command, optionsOrCb);
18
- }
19
- }
20
- putItems(args, optionsOrCb, cb) {
21
- const command = new PutItemsCommand(args);
22
- if (typeof optionsOrCb === "function") {
23
- this.send(command, optionsOrCb);
24
- }
25
- else if (typeof cb === "function") {
26
- if (typeof optionsOrCb !== "object")
27
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
28
- this.send(command, optionsOrCb || {}, cb);
29
- }
30
- else {
31
- return this.send(command, optionsOrCb);
32
- }
33
- }
34
- putUsers(args, optionsOrCb, cb) {
35
- const command = new PutUsersCommand(args);
36
- if (typeof optionsOrCb === "function") {
37
- this.send(command, optionsOrCb);
38
- }
39
- else if (typeof cb === "function") {
40
- if (typeof optionsOrCb !== "object")
41
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
42
- this.send(command, optionsOrCb || {}, cb);
43
- }
44
- else {
45
- return this.send(command, optionsOrCb);
46
- }
47
- }
48
12
  }
13
+ createAggregatedClient(commands, PersonalizeEvents);
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, map as __map, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectString as __expectString, LazyJsonString as __LazyJsonString, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { InvalidInputException, ResourceInUseException, ResourceNotFoundException, } from "../models/models_0";
4
4
  import { PersonalizeEventsServiceException as __BaseException } from "../models/PersonalizeEventsServiceException";
5
5
  export const se_PutEventsCommand = async (input, context) => {
@@ -9,12 +9,12 @@ export const se_PutEventsCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/events";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.eventList != null && { eventList: se_EventList(input.eventList, context) }),
14
- ...(input.sessionId != null && { sessionId: input.sessionId }),
15
- ...(input.trackingId != null && { trackingId: input.trackingId }),
16
- ...(input.userId != null && { userId: input.userId }),
17
- });
12
+ body = JSON.stringify(take(input, {
13
+ eventList: (_) => se_EventList(_, context),
14
+ sessionId: [],
15
+ trackingId: [],
16
+ userId: [],
17
+ }));
18
18
  return new __HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -32,10 +32,10 @@ export const se_PutItemsCommand = async (input, context) => {
32
32
  };
33
33
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/items";
34
34
  let body;
35
- body = JSON.stringify({
36
- ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
37
- ...(input.items != null && { items: se_ItemList(input.items, context) }),
38
- });
35
+ body = JSON.stringify(take(input, {
36
+ datasetArn: [],
37
+ items: (_) => se_ItemList(_, context),
38
+ }));
39
39
  return new __HttpRequest({
40
40
  protocol,
41
41
  hostname,
@@ -53,10 +53,10 @@ export const se_PutUsersCommand = async (input, context) => {
53
53
  };
54
54
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/users";
55
55
  let body;
56
- body = JSON.stringify({
57
- ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
58
- ...(input.users != null && { users: se_UserList(input.users, context) }),
59
- });
56
+ body = JSON.stringify(take(input, {
57
+ datasetArn: [],
58
+ users: (_) => se_UserList(_, context),
59
+ }));
60
60
  return new __HttpRequest({
61
61
  protocol,
62
62
  hostname,
@@ -89,10 +89,9 @@ const de_PutEventsCommandError = async (output, context) => {
89
89
  throw await de_InvalidInputExceptionRes(parsedOutput, context);
90
90
  default:
91
91
  const parsedBody = parsedOutput.body;
92
- throwDefaultError({
92
+ return throwDefaultError({
93
93
  output,
94
94
  parsedBody,
95
- exceptionCtor: __BaseException,
96
95
  errorCode,
97
96
  });
98
97
  }
@@ -125,10 +124,9 @@ const de_PutItemsCommandError = async (output, context) => {
125
124
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
126
125
  default:
127
126
  const parsedBody = parsedOutput.body;
128
- throwDefaultError({
127
+ return throwDefaultError({
129
128
  output,
130
129
  parsedBody,
131
- exceptionCtor: __BaseException,
132
130
  errorCode,
133
131
  });
134
132
  }
@@ -161,21 +159,21 @@ const de_PutUsersCommandError = async (output, context) => {
161
159
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
162
160
  default:
163
161
  const parsedBody = parsedOutput.body;
164
- throwDefaultError({
162
+ return throwDefaultError({
165
163
  output,
166
164
  parsedBody,
167
- exceptionCtor: __BaseException,
168
165
  errorCode,
169
166
  });
170
167
  }
171
168
  };
172
- const map = __map;
169
+ const throwDefaultError = withBaseException(__BaseException);
173
170
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
174
171
  const contents = map({});
175
172
  const data = parsedOutput.body;
176
- if (data.message != null) {
177
- contents.message = __expectString(data.message);
178
- }
173
+ const doc = take(data, {
174
+ message: __expectString,
175
+ });
176
+ Object.assign(contents, doc);
179
177
  const exception = new InvalidInputException({
180
178
  $metadata: deserializeMetadata(parsedOutput),
181
179
  ...contents,
@@ -185,9 +183,10 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
185
183
  const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
186
184
  const contents = map({});
187
185
  const data = parsedOutput.body;
188
- if (data.message != null) {
189
- contents.message = __expectString(data.message);
190
- }
186
+ const doc = take(data, {
187
+ message: __expectString,
188
+ });
189
+ Object.assign(contents, doc);
191
190
  const exception = new ResourceInUseException({
192
191
  $metadata: deserializeMetadata(parsedOutput),
193
192
  ...contents,
@@ -197,9 +196,10 @@ const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
197
196
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
198
197
  const contents = map({});
199
198
  const data = parsedOutput.body;
200
- if (data.message != null) {
201
- contents.message = __expectString(data.message);
202
- }
199
+ const doc = take(data, {
200
+ message: __expectString,
201
+ });
202
+ Object.assign(contents, doc);
203
203
  const exception = new ResourceNotFoundException({
204
204
  $metadata: deserializeMetadata(parsedOutput),
205
205
  ...contents,
@@ -207,19 +207,17 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
207
207
  return __decorateServiceException(exception, parsedOutput.body);
208
208
  };
209
209
  const se_Event = (input, context) => {
210
- return {
211
- ...(input.eventId != null && { eventId: input.eventId }),
212
- ...(input.eventType != null && { eventType: input.eventType }),
213
- ...(input.eventValue != null && { eventValue: __serializeFloat(input.eventValue) }),
214
- ...(input.impression != null && { impression: se_Impression(input.impression, context) }),
215
- ...(input.itemId != null && { itemId: input.itemId }),
216
- ...(input.metricAttribution != null && {
217
- metricAttribution: se_MetricAttribution(input.metricAttribution, context),
218
- }),
219
- ...(input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) }),
220
- ...(input.recommendationId != null && { recommendationId: input.recommendationId }),
221
- ...(input.sentAt != null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }),
222
- };
210
+ return take(input, {
211
+ eventId: [],
212
+ eventType: [],
213
+ eventValue: __serializeFloat,
214
+ impression: _json,
215
+ itemId: [],
216
+ metricAttribution: _json,
217
+ properties: __LazyJsonString.fromObject,
218
+ recommendationId: [],
219
+ sentAt: (_) => Math.round(_.getTime() / 1000),
220
+ });
223
221
  };
224
222
  const se_EventList = (input, context) => {
225
223
  return input
@@ -228,18 +226,11 @@ const se_EventList = (input, context) => {
228
226
  return se_Event(entry, context);
229
227
  });
230
228
  };
231
- const se_Impression = (input, context) => {
232
- return input
233
- .filter((e) => e != null)
234
- .map((entry) => {
235
- return entry;
236
- });
237
- };
238
229
  const se_Item = (input, context) => {
239
- return {
240
- ...(input.itemId != null && { itemId: input.itemId }),
241
- ...(input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) }),
242
- };
230
+ return take(input, {
231
+ itemId: [],
232
+ properties: __LazyJsonString.fromObject,
233
+ });
243
234
  };
244
235
  const se_ItemList = (input, context) => {
245
236
  return input
@@ -248,16 +239,11 @@ const se_ItemList = (input, context) => {
248
239
  return se_Item(entry, context);
249
240
  });
250
241
  };
251
- const se_MetricAttribution = (input, context) => {
252
- return {
253
- ...(input.eventAttributionSource != null && { eventAttributionSource: input.eventAttributionSource }),
254
- };
255
- };
256
242
  const se_User = (input, context) => {
257
- return {
258
- ...(input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) }),
259
- ...(input.userId != null && { userId: input.userId }),
260
- };
243
+ return take(input, {
244
+ properties: __LazyJsonString.fromObject,
245
+ userId: [],
246
+ });
261
247
  };
262
248
  const se_UserList = (input, context) => {
263
249
  return input
@@ -3,36 +3,31 @@ import { PutEventsCommandInput, PutEventsCommandOutput } from "./commands/PutEve
3
3
  import { PutItemsCommandInput, PutItemsCommandOutput } from "./commands/PutItemsCommand";
4
4
  import { PutUsersCommandInput, PutUsersCommandOutput } from "./commands/PutUsersCommand";
5
5
  import { PersonalizeEventsClient } from "./PersonalizeEventsClient";
6
- /**
7
- * @public
8
- * <p>Amazon Personalize can consume real-time user event data, such as <i>stream</i> or <i>click</i> data, and use
9
- * it for model training either alone or combined with historical data. For more information see
10
- * <a href="https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html">Recording Events</a>.</p>
11
- */
12
- export declare class PersonalizeEvents extends PersonalizeEventsClient {
6
+ export interface PersonalizeEvents {
13
7
  /**
14
- * @public
15
- * <p>Records user interaction event data. For more information see
16
- * <a href="https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html">Recording Events</a>.</p>
8
+ * @see {@link PutEventsCommand}
17
9
  */
18
10
  putEvents(args: PutEventsCommandInput, options?: __HttpHandlerOptions): Promise<PutEventsCommandOutput>;
19
11
  putEvents(args: PutEventsCommandInput, cb: (err: any, data?: PutEventsCommandOutput) => void): void;
20
12
  putEvents(args: PutEventsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutEventsCommandOutput) => void): void;
21
13
  /**
22
- * @public
23
- * <p>Adds one or more items to an Items dataset. For more information see
24
- * <a href="https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html">Importing Items Incrementally</a>.
25
- * </p>
14
+ * @see {@link PutItemsCommand}
26
15
  */
27
16
  putItems(args: PutItemsCommandInput, options?: __HttpHandlerOptions): Promise<PutItemsCommandOutput>;
28
17
  putItems(args: PutItemsCommandInput, cb: (err: any, data?: PutItemsCommandOutput) => void): void;
29
18
  putItems(args: PutItemsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutItemsCommandOutput) => void): void;
30
19
  /**
31
- * @public
32
- * <p>Adds one or more users to a Users dataset. For more information see
33
- * <a href="https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html">Importing Users Incrementally</a>.</p>
20
+ * @see {@link PutUsersCommand}
34
21
  */
35
22
  putUsers(args: PutUsersCommandInput, options?: __HttpHandlerOptions): Promise<PutUsersCommandOutput>;
36
23
  putUsers(args: PutUsersCommandInput, cb: (err: any, data?: PutUsersCommandOutput) => void): void;
37
24
  putUsers(args: PutUsersCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutUsersCommandOutput) => void): void;
38
25
  }
26
+ /**
27
+ * @public
28
+ * <p>Amazon Personalize can consume real-time user event data, such as <i>stream</i> or <i>click</i> data, and use
29
+ * it for model training either alone or combined with historical data. For more information see
30
+ * <a href="https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html">Recording Events</a>.</p>
31
+ */
32
+ export declare class PersonalizeEvents extends PersonalizeEventsClient implements PersonalizeEvents {
33
+ }
@@ -12,7 +12,7 @@ import {
12
12
  PutUsersCommandOutput,
13
13
  } from "./commands/PutUsersCommand";
14
14
  import { PersonalizeEventsClient } from "./PersonalizeEventsClient";
15
- export declare class PersonalizeEvents extends PersonalizeEventsClient {
15
+ export interface PersonalizeEvents {
16
16
  putEvents(
17
17
  args: PutEventsCommandInput,
18
18
  options?: __HttpHandlerOptions
@@ -53,3 +53,6 @@ export declare class PersonalizeEvents extends PersonalizeEventsClient {
53
53
  cb: (err: any, data?: PutUsersCommandOutput) => void
54
54
  ): void;
55
55
  }
56
+ export declare class PersonalizeEvents
57
+ extends PersonalizeEventsClient
58
+ implements PersonalizeEvents {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-personalize-events",
3
3
  "description": "AWS SDK for JavaScript Personalize Events Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.316.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.312.0",
24
+ "@aws-sdk/client-sts": "3.316.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.316.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.316.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.316.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.316.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",