@aws-sdk/client-personalize-events 3.454.0 → 3.458.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/README.md +27 -11
- package/dist-cjs/PersonalizeEvents.js +4 -0
- package/dist-cjs/commands/PutActionInteractionsCommand.js +52 -0
- package/dist-cjs/commands/PutActionsCommand.js +52 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/models_0.js +26 -1
- package/dist-cjs/protocols/Aws_restJson1.js +150 -1
- package/dist-es/PersonalizeEvents.js +4 -0
- package/dist-es/commands/PutActionInteractionsCommand.js +48 -0
- package/dist-es/commands/PutActionsCommand.js +48 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +21 -0
- package/dist-es/protocols/Aws_restJson1.js +145 -0
- package/dist-types/PersonalizeEvents.d.ts +15 -1
- package/dist-types/PersonalizeEventsClient.d.ts +5 -3
- package/dist-types/commands/PutActionInteractionsCommand.d.ts +99 -0
- package/dist-types/commands/PutActionsCommand.d.ts +88 -0
- package/dist-types/commands/PutEventsCommand.d.ts +2 -2
- package/dist-types/commands/PutItemsCommand.d.ts +1 -1
- package/dist-types/commands/PutUsersCommand.d.ts +1 -1
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/index.d.ts +1 -1
- package/dist-types/models/models_0.d.ts +229 -34
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/dist-types/ts3.4/PersonalizeEvents.d.ts +34 -0
- package/dist-types/ts3.4/PersonalizeEventsClient.d.ts +12 -0
- package/dist-types/ts3.4/commands/PutActionInteractionsCommand.d.ts +37 -0
- package/dist-types/ts3.4/commands/PutActionsCommand.d.ts +33 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +47 -14
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ AWS SDK for JavaScript PersonalizeEvents Client for Node.js, Browser and React N
|
|
|
8
8
|
|
|
9
9
|
<p>Amazon Personalize can consume real-time user event data, such as <i>stream</i> or <i>click</i> data, and use
|
|
10
10
|
it for model training either alone or combined with historical data. For more information see
|
|
11
|
-
<a href="https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html">Recording
|
|
11
|
+
<a href="https://docs.aws.amazon.com/personalize/latest/dg/recording-item-interaction-events.html">Recording item interaction events</a>.</p>
|
|
12
12
|
|
|
13
13
|
## Installing
|
|
14
14
|
|
|
@@ -25,16 +25,16 @@ using your favorite package manager:
|
|
|
25
25
|
|
|
26
26
|
The AWS SDK is modulized by clients and commands.
|
|
27
27
|
To send a request, you only need to import the `PersonalizeEventsClient` and
|
|
28
|
-
the commands you need, for example `
|
|
28
|
+
the commands you need, for example `PutActionsCommand`:
|
|
29
29
|
|
|
30
30
|
```js
|
|
31
31
|
// ES5 example
|
|
32
|
-
const { PersonalizeEventsClient,
|
|
32
|
+
const { PersonalizeEventsClient, PutActionsCommand } = require("@aws-sdk/client-personalize-events");
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
// ES6+ example
|
|
37
|
-
import { PersonalizeEventsClient,
|
|
37
|
+
import { PersonalizeEventsClient, PutActionsCommand } from "@aws-sdk/client-personalize-events";
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
### Usage
|
|
@@ -53,7 +53,7 @@ const client = new PersonalizeEventsClient({ region: "REGION" });
|
|
|
53
53
|
const params = {
|
|
54
54
|
/** input parameters */
|
|
55
55
|
};
|
|
56
|
-
const command = new
|
|
56
|
+
const command = new PutActionsCommand(params);
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
#### Async/await
|
|
@@ -132,7 +132,7 @@ const client = new AWS.PersonalizeEvents({ region: "REGION" });
|
|
|
132
132
|
|
|
133
133
|
// async/await.
|
|
134
134
|
try {
|
|
135
|
-
const data = await client.
|
|
135
|
+
const data = await client.putActions(params);
|
|
136
136
|
// process data.
|
|
137
137
|
} catch (error) {
|
|
138
138
|
// error handling.
|
|
@@ -140,7 +140,7 @@ try {
|
|
|
140
140
|
|
|
141
141
|
// Promises.
|
|
142
142
|
client
|
|
143
|
-
.
|
|
143
|
+
.putActions(params)
|
|
144
144
|
.then((data) => {
|
|
145
145
|
// process data.
|
|
146
146
|
})
|
|
@@ -149,7 +149,7 @@ client
|
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
// callbacks.
|
|
152
|
-
client.
|
|
152
|
+
client.putActions(params, (err, data) => {
|
|
153
153
|
// process err and data.
|
|
154
154
|
});
|
|
155
155
|
```
|
|
@@ -205,12 +205,28 @@ see LICENSE for more information.
|
|
|
205
205
|
|
|
206
206
|
## Client Commands (Operations List)
|
|
207
207
|
|
|
208
|
+
<details>
|
|
209
|
+
<summary>
|
|
210
|
+
PutActionInteractions
|
|
211
|
+
</summary>
|
|
212
|
+
|
|
213
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize-events/command/PutActionInteractionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutActionInteractionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutActionInteractionsCommandOutput/)
|
|
214
|
+
|
|
215
|
+
</details>
|
|
216
|
+
<details>
|
|
217
|
+
<summary>
|
|
218
|
+
PutActions
|
|
219
|
+
</summary>
|
|
220
|
+
|
|
221
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize-events/command/PutActionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutActionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutActionsCommandOutput/)
|
|
222
|
+
|
|
223
|
+
</details>
|
|
208
224
|
<details>
|
|
209
225
|
<summary>
|
|
210
226
|
PutEvents
|
|
211
227
|
</summary>
|
|
212
228
|
|
|
213
|
-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/
|
|
229
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize-events/command/PutEventsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutEventsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutEventsCommandOutput/)
|
|
214
230
|
|
|
215
231
|
</details>
|
|
216
232
|
<details>
|
|
@@ -218,7 +234,7 @@ PutEvents
|
|
|
218
234
|
PutItems
|
|
219
235
|
</summary>
|
|
220
236
|
|
|
221
|
-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/
|
|
237
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize-events/command/PutItemsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutItemsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutItemsCommandOutput/)
|
|
222
238
|
|
|
223
239
|
</details>
|
|
224
240
|
<details>
|
|
@@ -226,6 +242,6 @@ PutItems
|
|
|
226
242
|
PutUsers
|
|
227
243
|
</summary>
|
|
228
244
|
|
|
229
|
-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/
|
|
245
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize-events/command/PutUsersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutUsersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize-events/Interface/PutUsersCommandOutput/)
|
|
230
246
|
|
|
231
247
|
</details>
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PersonalizeEvents = void 0;
|
|
4
4
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
const PutActionInteractionsCommand_1 = require("./commands/PutActionInteractionsCommand");
|
|
6
|
+
const PutActionsCommand_1 = require("./commands/PutActionsCommand");
|
|
5
7
|
const PutEventsCommand_1 = require("./commands/PutEventsCommand");
|
|
6
8
|
const PutItemsCommand_1 = require("./commands/PutItemsCommand");
|
|
7
9
|
const PutUsersCommand_1 = require("./commands/PutUsersCommand");
|
|
8
10
|
const PersonalizeEventsClient_1 = require("./PersonalizeEventsClient");
|
|
9
11
|
const commands = {
|
|
12
|
+
PutActionInteractionsCommand: PutActionInteractionsCommand_1.PutActionInteractionsCommand,
|
|
13
|
+
PutActionsCommand: PutActionsCommand_1.PutActionsCommand,
|
|
10
14
|
PutEventsCommand: PutEventsCommand_1.PutEventsCommand,
|
|
11
15
|
PutItemsCommand: PutItemsCommand_1.PutItemsCommand,
|
|
12
16
|
PutUsersCommand: PutUsersCommand_1.PutUsersCommand,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PutActionInteractionsCommand = exports.$Command = void 0;
|
|
4
|
+
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const types_1 = require("@smithy/types");
|
|
9
|
+
const models_0_1 = require("../models/models_0");
|
|
10
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
11
|
+
class PutActionInteractionsCommand extends smithy_client_1.Command {
|
|
12
|
+
static getEndpointParameterInstructions() {
|
|
13
|
+
return {
|
|
14
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
15
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
16
|
+
Region: { type: "builtInParams", name: "region" },
|
|
17
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
constructor(input) {
|
|
21
|
+
super();
|
|
22
|
+
this.input = input;
|
|
23
|
+
}
|
|
24
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
25
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
26
|
+
this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutActionInteractionsCommand.getEndpointParameterInstructions()));
|
|
27
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
28
|
+
const { logger } = configuration;
|
|
29
|
+
const clientName = "PersonalizeEventsClient";
|
|
30
|
+
const commandName = "PutActionInteractionsCommand";
|
|
31
|
+
const handlerExecutionContext = {
|
|
32
|
+
logger,
|
|
33
|
+
clientName,
|
|
34
|
+
commandName,
|
|
35
|
+
inputFilterSensitiveLog: models_0_1.PutActionInteractionsRequestFilterSensitiveLog,
|
|
36
|
+
outputFilterSensitiveLog: (_) => _,
|
|
37
|
+
[types_1.SMITHY_CONTEXT_KEY]: {
|
|
38
|
+
service: "AmazonPersonalizeEvents",
|
|
39
|
+
operation: "PutActionInteractions",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const { requestHandler } = configuration;
|
|
43
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
44
|
+
}
|
|
45
|
+
serialize(input, context) {
|
|
46
|
+
return (0, Aws_restJson1_1.se_PutActionInteractionsCommand)(input, context);
|
|
47
|
+
}
|
|
48
|
+
deserialize(output, context) {
|
|
49
|
+
return (0, Aws_restJson1_1.de_PutActionInteractionsCommand)(output, context);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PutActionInteractionsCommand = PutActionInteractionsCommand;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PutActionsCommand = exports.$Command = void 0;
|
|
4
|
+
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const types_1 = require("@smithy/types");
|
|
9
|
+
const models_0_1 = require("../models/models_0");
|
|
10
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
11
|
+
class PutActionsCommand extends smithy_client_1.Command {
|
|
12
|
+
static getEndpointParameterInstructions() {
|
|
13
|
+
return {
|
|
14
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
15
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
16
|
+
Region: { type: "builtInParams", name: "region" },
|
|
17
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
constructor(input) {
|
|
21
|
+
super();
|
|
22
|
+
this.input = input;
|
|
23
|
+
}
|
|
24
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
25
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
26
|
+
this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, PutActionsCommand.getEndpointParameterInstructions()));
|
|
27
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
28
|
+
const { logger } = configuration;
|
|
29
|
+
const clientName = "PersonalizeEventsClient";
|
|
30
|
+
const commandName = "PutActionsCommand";
|
|
31
|
+
const handlerExecutionContext = {
|
|
32
|
+
logger,
|
|
33
|
+
clientName,
|
|
34
|
+
commandName,
|
|
35
|
+
inputFilterSensitiveLog: models_0_1.PutActionsRequestFilterSensitiveLog,
|
|
36
|
+
outputFilterSensitiveLog: (_) => _,
|
|
37
|
+
[types_1.SMITHY_CONTEXT_KEY]: {
|
|
38
|
+
service: "AmazonPersonalizeEvents",
|
|
39
|
+
operation: "PutActions",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const { requestHandler } = configuration;
|
|
43
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
44
|
+
}
|
|
45
|
+
serialize(input, context) {
|
|
46
|
+
return (0, Aws_restJson1_1.se_PutActionsCommand)(input, context);
|
|
47
|
+
}
|
|
48
|
+
deserialize(output, context) {
|
|
49
|
+
return (0, Aws_restJson1_1.de_PutActionsCommand)(output, context);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PutActionsCommand = PutActionsCommand;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./PutActionInteractionsCommand"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./PutActionsCommand"), exports);
|
|
4
6
|
tslib_1.__exportStar(require("./PutEventsCommand"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./PutItemsCommand"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./PutUsersCommand"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PutUsersRequestFilterSensitiveLog = exports.UserFilterSensitiveLog = exports.PutItemsRequestFilterSensitiveLog = exports.ItemFilterSensitiveLog = exports.PutEventsRequestFilterSensitiveLog = exports.EventFilterSensitiveLog = exports.ResourceNotFoundException = exports.ResourceInUseException = exports.InvalidInputException = void 0;
|
|
3
|
+
exports.PutUsersRequestFilterSensitiveLog = exports.UserFilterSensitiveLog = exports.PutItemsRequestFilterSensitiveLog = exports.ItemFilterSensitiveLog = exports.PutEventsRequestFilterSensitiveLog = exports.EventFilterSensitiveLog = exports.PutActionsRequestFilterSensitiveLog = exports.PutActionInteractionsRequestFilterSensitiveLog = exports.ActionInteractionFilterSensitiveLog = exports.ActionFilterSensitiveLog = exports.ResourceNotFoundException = exports.ResourceInUseException = exports.InvalidInputException = void 0;
|
|
4
4
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
5
|
const PersonalizeEventsServiceException_1 = require("./PersonalizeEventsServiceException");
|
|
6
6
|
class InvalidInputException extends PersonalizeEventsServiceException_1.PersonalizeEventsServiceException {
|
|
@@ -42,6 +42,31 @@ class ResourceNotFoundException extends PersonalizeEventsServiceException_1.Pers
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.ResourceNotFoundException = ResourceNotFoundException;
|
|
45
|
+
const ActionFilterSensitiveLog = (obj) => ({
|
|
46
|
+
...obj,
|
|
47
|
+
...(obj.properties && { properties: smithy_client_1.SENSITIVE_STRING }),
|
|
48
|
+
});
|
|
49
|
+
exports.ActionFilterSensitiveLog = ActionFilterSensitiveLog;
|
|
50
|
+
const ActionInteractionFilterSensitiveLog = (obj) => ({
|
|
51
|
+
...obj,
|
|
52
|
+
...(obj.actionId && { actionId: smithy_client_1.SENSITIVE_STRING }),
|
|
53
|
+
...(obj.userId && { userId: smithy_client_1.SENSITIVE_STRING }),
|
|
54
|
+
...(obj.impression && { impression: smithy_client_1.SENSITIVE_STRING }),
|
|
55
|
+
...(obj.properties && { properties: smithy_client_1.SENSITIVE_STRING }),
|
|
56
|
+
});
|
|
57
|
+
exports.ActionInteractionFilterSensitiveLog = ActionInteractionFilterSensitiveLog;
|
|
58
|
+
const PutActionInteractionsRequestFilterSensitiveLog = (obj) => ({
|
|
59
|
+
...obj,
|
|
60
|
+
...(obj.actionInteractions && {
|
|
61
|
+
actionInteractions: obj.actionInteractions.map((item) => (0, exports.ActionInteractionFilterSensitiveLog)(item)),
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
exports.PutActionInteractionsRequestFilterSensitiveLog = PutActionInteractionsRequestFilterSensitiveLog;
|
|
65
|
+
const PutActionsRequestFilterSensitiveLog = (obj) => ({
|
|
66
|
+
...obj,
|
|
67
|
+
...(obj.actions && { actions: obj.actions.map((item) => (0, exports.ActionFilterSensitiveLog)(item)) }),
|
|
68
|
+
});
|
|
69
|
+
exports.PutActionsRequestFilterSensitiveLog = PutActionsRequestFilterSensitiveLog;
|
|
45
70
|
const EventFilterSensitiveLog = (obj) => ({
|
|
46
71
|
...obj,
|
|
47
72
|
...(obj.itemId && { itemId: smithy_client_1.SENSITIVE_STRING }),
|
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_PutUsersCommand = exports.de_PutItemsCommand = exports.de_PutEventsCommand = exports.se_PutUsersCommand = exports.se_PutItemsCommand = exports.se_PutEventsCommand = void 0;
|
|
3
|
+
exports.de_PutUsersCommand = exports.de_PutItemsCommand = exports.de_PutEventsCommand = exports.de_PutActionsCommand = exports.de_PutActionInteractionsCommand = exports.se_PutUsersCommand = exports.se_PutItemsCommand = exports.se_PutEventsCommand = exports.se_PutActionsCommand = exports.se_PutActionInteractionsCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const PersonalizeEventsServiceException_1 = require("../models/PersonalizeEventsServiceException");
|
|
8
|
+
const se_PutActionInteractionsCommand = async (input, context) => {
|
|
9
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
|
+
const headers = {
|
|
11
|
+
"content-type": "application/json",
|
|
12
|
+
};
|
|
13
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/action-interactions";
|
|
14
|
+
let body;
|
|
15
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
16
|
+
actionInteractions: (_) => se_ActionInteractionsList(_, context),
|
|
17
|
+
trackingId: [],
|
|
18
|
+
}));
|
|
19
|
+
return new protocol_http_1.HttpRequest({
|
|
20
|
+
protocol,
|
|
21
|
+
hostname,
|
|
22
|
+
port,
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers,
|
|
25
|
+
path: resolvedPath,
|
|
26
|
+
body,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.se_PutActionInteractionsCommand = se_PutActionInteractionsCommand;
|
|
30
|
+
const se_PutActionsCommand = async (input, context) => {
|
|
31
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
+
const headers = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
};
|
|
35
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/actions";
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
38
|
+
actions: (_) => se_ActionList(_, context),
|
|
39
|
+
datasetArn: [],
|
|
40
|
+
}));
|
|
41
|
+
return new protocol_http_1.HttpRequest({
|
|
42
|
+
protocol,
|
|
43
|
+
hostname,
|
|
44
|
+
port,
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers,
|
|
47
|
+
path: resolvedPath,
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.se_PutActionsCommand = se_PutActionsCommand;
|
|
8
52
|
const se_PutEventsCommand = async (input, context) => {
|
|
9
53
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
54
|
const headers = {
|
|
@@ -73,6 +117,78 @@ const se_PutUsersCommand = async (input, context) => {
|
|
|
73
117
|
});
|
|
74
118
|
};
|
|
75
119
|
exports.se_PutUsersCommand = se_PutUsersCommand;
|
|
120
|
+
const de_PutActionInteractionsCommand = async (output, context) => {
|
|
121
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
122
|
+
return de_PutActionInteractionsCommandError(output, context);
|
|
123
|
+
}
|
|
124
|
+
const contents = (0, smithy_client_1.map)({
|
|
125
|
+
$metadata: deserializeMetadata(output),
|
|
126
|
+
});
|
|
127
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
128
|
+
return contents;
|
|
129
|
+
};
|
|
130
|
+
exports.de_PutActionInteractionsCommand = de_PutActionInteractionsCommand;
|
|
131
|
+
const de_PutActionInteractionsCommandError = async (output, context) => {
|
|
132
|
+
const parsedOutput = {
|
|
133
|
+
...output,
|
|
134
|
+
body: await parseErrorBody(output.body, context),
|
|
135
|
+
};
|
|
136
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
137
|
+
switch (errorCode) {
|
|
138
|
+
case "InvalidInputException":
|
|
139
|
+
case "com.amazonaws.personalizeevents#InvalidInputException":
|
|
140
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
141
|
+
case "ResourceInUseException":
|
|
142
|
+
case "com.amazonaws.personalizeevents#ResourceInUseException":
|
|
143
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
144
|
+
case "ResourceNotFoundException":
|
|
145
|
+
case "com.amazonaws.personalizeevents#ResourceNotFoundException":
|
|
146
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
147
|
+
default:
|
|
148
|
+
const parsedBody = parsedOutput.body;
|
|
149
|
+
return throwDefaultError({
|
|
150
|
+
output,
|
|
151
|
+
parsedBody,
|
|
152
|
+
errorCode,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const de_PutActionsCommand = async (output, context) => {
|
|
157
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
158
|
+
return de_PutActionsCommandError(output, context);
|
|
159
|
+
}
|
|
160
|
+
const contents = (0, smithy_client_1.map)({
|
|
161
|
+
$metadata: deserializeMetadata(output),
|
|
162
|
+
});
|
|
163
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
164
|
+
return contents;
|
|
165
|
+
};
|
|
166
|
+
exports.de_PutActionsCommand = de_PutActionsCommand;
|
|
167
|
+
const de_PutActionsCommandError = async (output, context) => {
|
|
168
|
+
const parsedOutput = {
|
|
169
|
+
...output,
|
|
170
|
+
body: await parseErrorBody(output.body, context),
|
|
171
|
+
};
|
|
172
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
173
|
+
switch (errorCode) {
|
|
174
|
+
case "InvalidInputException":
|
|
175
|
+
case "com.amazonaws.personalizeevents#InvalidInputException":
|
|
176
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
177
|
+
case "ResourceInUseException":
|
|
178
|
+
case "com.amazonaws.personalizeevents#ResourceInUseException":
|
|
179
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
180
|
+
case "ResourceNotFoundException":
|
|
181
|
+
case "com.amazonaws.personalizeevents#ResourceNotFoundException":
|
|
182
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
183
|
+
default:
|
|
184
|
+
const parsedBody = parsedOutput.body;
|
|
185
|
+
return throwDefaultError({
|
|
186
|
+
output,
|
|
187
|
+
parsedBody,
|
|
188
|
+
errorCode,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
76
192
|
const de_PutEventsCommand = async (output, context) => {
|
|
77
193
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
78
194
|
return de_PutEventsCommandError(output, context);
|
|
@@ -215,6 +331,39 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
215
331
|
});
|
|
216
332
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
217
333
|
};
|
|
334
|
+
const se_Action = (input, context) => {
|
|
335
|
+
return (0, smithy_client_1.take)(input, {
|
|
336
|
+
actionId: [],
|
|
337
|
+
properties: smithy_client_1.LazyJsonString.fromObject,
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
const se_ActionInteraction = (input, context) => {
|
|
341
|
+
return (0, smithy_client_1.take)(input, {
|
|
342
|
+
actionId: [],
|
|
343
|
+
eventId: [],
|
|
344
|
+
eventType: [],
|
|
345
|
+
impression: smithy_client_1._json,
|
|
346
|
+
properties: smithy_client_1.LazyJsonString.fromObject,
|
|
347
|
+
recommendationId: [],
|
|
348
|
+
sessionId: [],
|
|
349
|
+
timestamp: (_) => Math.round(_.getTime() / 1000),
|
|
350
|
+
userId: [],
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
const se_ActionInteractionsList = (input, context) => {
|
|
354
|
+
return input
|
|
355
|
+
.filter((e) => e != null)
|
|
356
|
+
.map((entry) => {
|
|
357
|
+
return se_ActionInteraction(entry, context);
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
const se_ActionList = (input, context) => {
|
|
361
|
+
return input
|
|
362
|
+
.filter((e) => e != null)
|
|
363
|
+
.map((entry) => {
|
|
364
|
+
return se_Action(entry, context);
|
|
365
|
+
});
|
|
366
|
+
};
|
|
218
367
|
const se_Event = (input, context) => {
|
|
219
368
|
return (0, smithy_client_1.take)(input, {
|
|
220
369
|
eventId: [],
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
2
|
+
import { PutActionInteractionsCommand, } from "./commands/PutActionInteractionsCommand";
|
|
3
|
+
import { PutActionsCommand } from "./commands/PutActionsCommand";
|
|
2
4
|
import { PutEventsCommand } from "./commands/PutEventsCommand";
|
|
3
5
|
import { PutItemsCommand } from "./commands/PutItemsCommand";
|
|
4
6
|
import { PutUsersCommand } from "./commands/PutUsersCommand";
|
|
5
7
|
import { PersonalizeEventsClient } from "./PersonalizeEventsClient";
|
|
6
8
|
const commands = {
|
|
9
|
+
PutActionInteractionsCommand,
|
|
10
|
+
PutActionsCommand,
|
|
7
11
|
PutEventsCommand,
|
|
8
12
|
PutItemsCommand,
|
|
9
13
|
PutUsersCommand,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
import { PutActionInteractionsRequestFilterSensitiveLog } from "../models/models_0";
|
|
6
|
+
import { de_PutActionInteractionsCommand, se_PutActionInteractionsCommand } from "../protocols/Aws_restJson1";
|
|
7
|
+
export { $Command };
|
|
8
|
+
export class PutActionInteractionsCommand extends $Command {
|
|
9
|
+
static getEndpointParameterInstructions() {
|
|
10
|
+
return {
|
|
11
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
12
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
13
|
+
Region: { type: "builtInParams", name: "region" },
|
|
14
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
constructor(input) {
|
|
18
|
+
super();
|
|
19
|
+
this.input = input;
|
|
20
|
+
}
|
|
21
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
22
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
23
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, PutActionInteractionsCommand.getEndpointParameterInstructions()));
|
|
24
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
25
|
+
const { logger } = configuration;
|
|
26
|
+
const clientName = "PersonalizeEventsClient";
|
|
27
|
+
const commandName = "PutActionInteractionsCommand";
|
|
28
|
+
const handlerExecutionContext = {
|
|
29
|
+
logger,
|
|
30
|
+
clientName,
|
|
31
|
+
commandName,
|
|
32
|
+
inputFilterSensitiveLog: PutActionInteractionsRequestFilterSensitiveLog,
|
|
33
|
+
outputFilterSensitiveLog: (_) => _,
|
|
34
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
35
|
+
service: "AmazonPersonalizeEvents",
|
|
36
|
+
operation: "PutActionInteractions",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const { requestHandler } = configuration;
|
|
40
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
41
|
+
}
|
|
42
|
+
serialize(input, context) {
|
|
43
|
+
return se_PutActionInteractionsCommand(input, context);
|
|
44
|
+
}
|
|
45
|
+
deserialize(output, context) {
|
|
46
|
+
return de_PutActionInteractionsCommand(output, context);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
import { PutActionsRequestFilterSensitiveLog } from "../models/models_0";
|
|
6
|
+
import { de_PutActionsCommand, se_PutActionsCommand } from "../protocols/Aws_restJson1";
|
|
7
|
+
export { $Command };
|
|
8
|
+
export class PutActionsCommand extends $Command {
|
|
9
|
+
static getEndpointParameterInstructions() {
|
|
10
|
+
return {
|
|
11
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
12
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
13
|
+
Region: { type: "builtInParams", name: "region" },
|
|
14
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
constructor(input) {
|
|
18
|
+
super();
|
|
19
|
+
this.input = input;
|
|
20
|
+
}
|
|
21
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
22
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
23
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, PutActionsCommand.getEndpointParameterInstructions()));
|
|
24
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
25
|
+
const { logger } = configuration;
|
|
26
|
+
const clientName = "PersonalizeEventsClient";
|
|
27
|
+
const commandName = "PutActionsCommand";
|
|
28
|
+
const handlerExecutionContext = {
|
|
29
|
+
logger,
|
|
30
|
+
clientName,
|
|
31
|
+
commandName,
|
|
32
|
+
inputFilterSensitiveLog: PutActionsRequestFilterSensitiveLog,
|
|
33
|
+
outputFilterSensitiveLog: (_) => _,
|
|
34
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
35
|
+
service: "AmazonPersonalizeEvents",
|
|
36
|
+
operation: "PutActions",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const { requestHandler } = configuration;
|
|
40
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
41
|
+
}
|
|
42
|
+
serialize(input, context) {
|
|
43
|
+
return se_PutActionsCommand(input, context);
|
|
44
|
+
}
|
|
45
|
+
deserialize(output, context) {
|
|
46
|
+
return de_PutActionsCommand(output, context);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -36,6 +36,27 @@ export class ResourceNotFoundException extends __BaseException {
|
|
|
36
36
|
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
export const ActionFilterSensitiveLog = (obj) => ({
|
|
40
|
+
...obj,
|
|
41
|
+
...(obj.properties && { properties: SENSITIVE_STRING }),
|
|
42
|
+
});
|
|
43
|
+
export const ActionInteractionFilterSensitiveLog = (obj) => ({
|
|
44
|
+
...obj,
|
|
45
|
+
...(obj.actionId && { actionId: SENSITIVE_STRING }),
|
|
46
|
+
...(obj.userId && { userId: SENSITIVE_STRING }),
|
|
47
|
+
...(obj.impression && { impression: SENSITIVE_STRING }),
|
|
48
|
+
...(obj.properties && { properties: SENSITIVE_STRING }),
|
|
49
|
+
});
|
|
50
|
+
export const PutActionInteractionsRequestFilterSensitiveLog = (obj) => ({
|
|
51
|
+
...obj,
|
|
52
|
+
...(obj.actionInteractions && {
|
|
53
|
+
actionInteractions: obj.actionInteractions.map((item) => ActionInteractionFilterSensitiveLog(item)),
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
export const PutActionsRequestFilterSensitiveLog = (obj) => ({
|
|
57
|
+
...obj,
|
|
58
|
+
...(obj.actions && { actions: obj.actions.map((item) => ActionFilterSensitiveLog(item)) }),
|
|
59
|
+
});
|
|
39
60
|
export const EventFilterSensitiveLog = (obj) => ({
|
|
40
61
|
...obj,
|
|
41
62
|
...(obj.itemId && { itemId: SENSITIVE_STRING }),
|