@aws-sdk/client-personalize-events 3.899.0 → 3.906.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +576 -684
- package/package.json +37 -37
package/dist-cjs/index.js
CHANGED
|
@@ -1,710 +1,602 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
|
|
4
|
+
var middlewareLogger = require('@aws-sdk/middleware-logger');
|
|
5
|
+
var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
|
|
6
|
+
var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
|
|
7
|
+
var configResolver = require('@smithy/config-resolver');
|
|
8
|
+
var core = require('@smithy/core');
|
|
9
|
+
var middlewareContentLength = require('@smithy/middleware-content-length');
|
|
10
|
+
var middlewareEndpoint = require('@smithy/middleware-endpoint');
|
|
11
|
+
var middlewareRetry = require('@smithy/middleware-retry');
|
|
12
|
+
var smithyClient = require('@smithy/smithy-client');
|
|
13
|
+
var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
|
|
14
|
+
var runtimeConfig = require('./runtimeConfig');
|
|
15
|
+
var regionConfigResolver = require('@aws-sdk/region-config-resolver');
|
|
16
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
17
|
+
var middlewareSerde = require('@smithy/middleware-serde');
|
|
18
|
+
var core$1 = require('@aws-sdk/core');
|
|
19
|
+
|
|
20
|
+
const resolveClientEndpointParameters = (options) => {
|
|
21
|
+
return Object.assign(options, {
|
|
22
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
23
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
24
|
+
defaultSigningName: "personalize",
|
|
25
|
+
});
|
|
10
26
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
27
|
+
const commonParams = {
|
|
28
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
29
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
30
|
+
Region: { type: "builtInParams", name: "region" },
|
|
31
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
18
32
|
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
ActionFilterSensitiveLog: () => ActionFilterSensitiveLog,
|
|
25
|
-
ActionInteractionFilterSensitiveLog: () => ActionInteractionFilterSensitiveLog,
|
|
26
|
-
EventFilterSensitiveLog: () => EventFilterSensitiveLog,
|
|
27
|
-
InvalidInputException: () => InvalidInputException,
|
|
28
|
-
ItemFilterSensitiveLog: () => ItemFilterSensitiveLog,
|
|
29
|
-
PersonalizeEvents: () => PersonalizeEvents,
|
|
30
|
-
PersonalizeEventsClient: () => PersonalizeEventsClient,
|
|
31
|
-
PersonalizeEventsServiceException: () => PersonalizeEventsServiceException,
|
|
32
|
-
PutActionInteractionsCommand: () => PutActionInteractionsCommand,
|
|
33
|
-
PutActionInteractionsRequestFilterSensitiveLog: () => PutActionInteractionsRequestFilterSensitiveLog,
|
|
34
|
-
PutActionsCommand: () => PutActionsCommand,
|
|
35
|
-
PutActionsRequestFilterSensitiveLog: () => PutActionsRequestFilterSensitiveLog,
|
|
36
|
-
PutEventsCommand: () => PutEventsCommand,
|
|
37
|
-
PutEventsRequestFilterSensitiveLog: () => PutEventsRequestFilterSensitiveLog,
|
|
38
|
-
PutItemsCommand: () => PutItemsCommand,
|
|
39
|
-
PutItemsRequestFilterSensitiveLog: () => PutItemsRequestFilterSensitiveLog,
|
|
40
|
-
PutUsersCommand: () => PutUsersCommand,
|
|
41
|
-
PutUsersRequestFilterSensitiveLog: () => PutUsersRequestFilterSensitiveLog,
|
|
42
|
-
ResourceInUseException: () => ResourceInUseException,
|
|
43
|
-
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
44
|
-
UserFilterSensitiveLog: () => UserFilterSensitiveLog,
|
|
45
|
-
__Client: () => import_smithy_client.Client
|
|
46
|
-
});
|
|
47
|
-
module.exports = __toCommonJS(index_exports);
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
35
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
36
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
37
|
+
let _credentials = runtimeConfig.credentials;
|
|
38
|
+
return {
|
|
39
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
40
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
41
|
+
if (index === -1) {
|
|
42
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
httpAuthSchemes() {
|
|
49
|
+
return _httpAuthSchemes;
|
|
50
|
+
},
|
|
51
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
52
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
53
|
+
},
|
|
54
|
+
httpAuthSchemeProvider() {
|
|
55
|
+
return _httpAuthSchemeProvider;
|
|
56
|
+
},
|
|
57
|
+
setCredentials(credentials) {
|
|
58
|
+
_credentials = credentials;
|
|
59
|
+
},
|
|
60
|
+
credentials() {
|
|
61
|
+
return _credentials;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
66
|
+
return {
|
|
67
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
68
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
69
|
+
credentials: config.credentials(),
|
|
70
|
+
};
|
|
75
71
|
};
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var import_protocol_http = require("@smithy/protocol-http");
|
|
83
|
-
var import_smithy_client = require("@smithy/smithy-client");
|
|
73
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
74
|
+
const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
75
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
76
|
+
return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
77
|
+
};
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
79
|
+
class PersonalizeEventsClient extends smithyClient.Client {
|
|
80
|
+
config;
|
|
81
|
+
constructor(...[configuration]) {
|
|
82
|
+
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
|
|
83
|
+
super(_config_0);
|
|
84
|
+
this.initConfig = _config_0;
|
|
85
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
86
|
+
const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
|
|
87
|
+
const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
|
|
88
|
+
const _config_4 = configResolver.resolveRegionConfig(_config_3);
|
|
89
|
+
const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
|
|
90
|
+
const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
|
|
91
|
+
const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
|
|
92
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
93
|
+
this.config = _config_8;
|
|
94
|
+
this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
|
|
95
|
+
this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
|
|
96
|
+
this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
|
|
97
|
+
this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
|
|
98
|
+
this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
|
|
99
|
+
this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
|
|
100
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
101
|
+
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultPersonalizeEventsHttpAuthSchemeParametersProvider,
|
|
102
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
103
|
+
"aws.auth#sigv4": config.credentials,
|
|
104
|
+
}),
|
|
105
|
+
}));
|
|
106
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
107
|
+
}
|
|
108
|
+
destroy() {
|
|
109
|
+
super.destroy();
|
|
113
110
|
}
|
|
114
|
-
|
|
115
|
-
}, "getHttpAuthExtensionConfiguration");
|
|
116
|
-
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
|
|
117
|
-
return {
|
|
118
|
-
httpAuthSchemes: config.httpAuthSchemes(),
|
|
119
|
-
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
120
|
-
credentials: config.credentials()
|
|
121
|
-
};
|
|
122
|
-
}, "resolveHttpAuthRuntimeConfig");
|
|
111
|
+
}
|
|
123
112
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
113
|
+
class PersonalizeEventsServiceException extends smithyClient.ServiceException {
|
|
114
|
+
constructor(options) {
|
|
115
|
+
super(options);
|
|
116
|
+
Object.setPrototypeOf(this, PersonalizeEventsServiceException.prototype);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
class InvalidInputException extends PersonalizeEventsServiceException {
|
|
121
|
+
name = "InvalidInputException";
|
|
122
|
+
$fault = "client";
|
|
123
|
+
constructor(opts) {
|
|
124
|
+
super({
|
|
125
|
+
name: "InvalidInputException",
|
|
126
|
+
$fault: "client",
|
|
127
|
+
...opts,
|
|
128
|
+
});
|
|
129
|
+
Object.setPrototypeOf(this, InvalidInputException.prototype);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
class ResourceInUseException extends PersonalizeEventsServiceException {
|
|
133
|
+
name = "ResourceInUseException";
|
|
134
|
+
$fault = "client";
|
|
135
|
+
constructor(opts) {
|
|
136
|
+
super({
|
|
137
|
+
name: "ResourceInUseException",
|
|
138
|
+
$fault: "client",
|
|
139
|
+
...opts,
|
|
140
|
+
});
|
|
141
|
+
Object.setPrototypeOf(this, ResourceInUseException.prototype);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
class ResourceNotFoundException extends PersonalizeEventsServiceException {
|
|
145
|
+
name = "ResourceNotFoundException";
|
|
146
|
+
$fault = "client";
|
|
147
|
+
constructor(opts) {
|
|
148
|
+
super({
|
|
149
|
+
name: "ResourceNotFoundException",
|
|
150
|
+
$fault: "client",
|
|
151
|
+
...opts,
|
|
152
|
+
});
|
|
153
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const ActionFilterSensitiveLog = (obj) => ({
|
|
157
|
+
...obj,
|
|
158
|
+
...(obj.properties && { properties: smithyClient.SENSITIVE_STRING }),
|
|
159
|
+
});
|
|
160
|
+
const ActionInteractionFilterSensitiveLog = (obj) => ({
|
|
161
|
+
...obj,
|
|
162
|
+
...(obj.actionId && { actionId: smithyClient.SENSITIVE_STRING }),
|
|
163
|
+
...(obj.userId && { userId: smithyClient.SENSITIVE_STRING }),
|
|
164
|
+
...(obj.impression && { impression: smithyClient.SENSITIVE_STRING }),
|
|
165
|
+
...(obj.properties && { properties: smithyClient.SENSITIVE_STRING }),
|
|
166
|
+
});
|
|
167
|
+
const PutActionInteractionsRequestFilterSensitiveLog = (obj) => ({
|
|
168
|
+
...obj,
|
|
169
|
+
...(obj.actionInteractions && {
|
|
170
|
+
actionInteractions: obj.actionInteractions.map((item) => ActionInteractionFilterSensitiveLog(item)),
|
|
171
|
+
}),
|
|
172
|
+
});
|
|
173
|
+
const PutActionsRequestFilterSensitiveLog = (obj) => ({
|
|
174
|
+
...obj,
|
|
175
|
+
...(obj.actions && { actions: obj.actions.map((item) => ActionFilterSensitiveLog(item)) }),
|
|
176
|
+
});
|
|
177
|
+
const EventFilterSensitiveLog = (obj) => ({
|
|
178
|
+
...obj,
|
|
179
|
+
...(obj.itemId && { itemId: smithyClient.SENSITIVE_STRING }),
|
|
180
|
+
...(obj.properties && { properties: smithyClient.SENSITIVE_STRING }),
|
|
181
|
+
...(obj.impression && { impression: smithyClient.SENSITIVE_STRING }),
|
|
182
|
+
});
|
|
183
|
+
const PutEventsRequestFilterSensitiveLog = (obj) => ({
|
|
184
|
+
...obj,
|
|
185
|
+
...(obj.userId && { userId: smithyClient.SENSITIVE_STRING }),
|
|
186
|
+
...(obj.eventList && { eventList: smithyClient.SENSITIVE_STRING }),
|
|
187
|
+
});
|
|
188
|
+
const ItemFilterSensitiveLog = (obj) => ({
|
|
189
|
+
...obj,
|
|
190
|
+
...(obj.properties && { properties: smithyClient.SENSITIVE_STRING }),
|
|
191
|
+
});
|
|
192
|
+
const PutItemsRequestFilterSensitiveLog = (obj) => ({
|
|
193
|
+
...obj,
|
|
194
|
+
...(obj.items && { items: obj.items.map((item) => ItemFilterSensitiveLog(item)) }),
|
|
195
|
+
});
|
|
196
|
+
const UserFilterSensitiveLog = (obj) => ({
|
|
197
|
+
...obj,
|
|
198
|
+
...(obj.properties && { properties: smithyClient.SENSITIVE_STRING }),
|
|
199
|
+
});
|
|
200
|
+
const PutUsersRequestFilterSensitiveLog = (obj) => ({
|
|
201
|
+
...obj,
|
|
202
|
+
...(obj.users && { users: obj.users.map((item) => UserFilterSensitiveLog(item)) }),
|
|
203
|
+
});
|
|
141
204
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
156
|
-
const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
|
|
157
|
-
const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
|
|
158
|
-
const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
|
|
159
|
-
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
|
160
|
-
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
|
|
161
|
-
const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
|
|
162
|
-
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
163
|
-
this.config = _config_8;
|
|
164
|
-
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
|
|
165
|
-
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
|
|
166
|
-
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
|
|
167
|
-
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
|
168
|
-
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
|
169
|
-
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
|
170
|
-
this.middlewareStack.use(
|
|
171
|
-
(0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
|
|
172
|
-
httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultPersonalizeEventsHttpAuthSchemeParametersProvider,
|
|
173
|
-
identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
|
|
174
|
-
"aws.auth#sigv4": config.credentials
|
|
175
|
-
}), "identityProviderConfigProvider")
|
|
176
|
-
})
|
|
177
|
-
);
|
|
178
|
-
this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
182
|
-
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
183
|
-
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
184
|
-
*/
|
|
185
|
-
destroy() {
|
|
186
|
-
super.destroy();
|
|
187
|
-
}
|
|
205
|
+
const se_PutActionInteractionsCommand = async (input, context) => {
|
|
206
|
+
const b = core.requestBuilder(input, context);
|
|
207
|
+
const headers = {
|
|
208
|
+
"content-type": "application/json",
|
|
209
|
+
};
|
|
210
|
+
b.bp("/action-interactions");
|
|
211
|
+
let body;
|
|
212
|
+
body = JSON.stringify(smithyClient.take(input, {
|
|
213
|
+
actionInteractions: (_) => se_ActionInteractionsList(_),
|
|
214
|
+
trackingId: [],
|
|
215
|
+
}));
|
|
216
|
+
b.m("POST").h(headers).b(body);
|
|
217
|
+
return b.build();
|
|
188
218
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var PersonalizeEventsServiceException = class _PersonalizeEventsServiceException extends import_smithy_client.ServiceException {
|
|
204
|
-
static {
|
|
205
|
-
__name(this, "PersonalizeEventsServiceException");
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* @internal
|
|
209
|
-
*/
|
|
210
|
-
constructor(options) {
|
|
211
|
-
super(options);
|
|
212
|
-
Object.setPrototypeOf(this, _PersonalizeEventsServiceException.prototype);
|
|
213
|
-
}
|
|
219
|
+
const se_PutActionsCommand = async (input, context) => {
|
|
220
|
+
const b = core.requestBuilder(input, context);
|
|
221
|
+
const headers = {
|
|
222
|
+
"content-type": "application/json",
|
|
223
|
+
};
|
|
224
|
+
b.bp("/actions");
|
|
225
|
+
let body;
|
|
226
|
+
body = JSON.stringify(smithyClient.take(input, {
|
|
227
|
+
actions: (_) => se_ActionList(_),
|
|
228
|
+
datasetArn: [],
|
|
229
|
+
}));
|
|
230
|
+
b.m("POST").h(headers).b(body);
|
|
231
|
+
return b.build();
|
|
214
232
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
233
|
+
const se_PutEventsCommand = async (input, context) => {
|
|
234
|
+
const b = core.requestBuilder(input, context);
|
|
235
|
+
const headers = {
|
|
236
|
+
"content-type": "application/json",
|
|
237
|
+
};
|
|
238
|
+
b.bp("/events");
|
|
239
|
+
let body;
|
|
240
|
+
body = JSON.stringify(smithyClient.take(input, {
|
|
241
|
+
eventList: (_) => se_EventList(_),
|
|
242
|
+
sessionId: [],
|
|
243
|
+
trackingId: [],
|
|
244
|
+
userId: [],
|
|
245
|
+
}));
|
|
246
|
+
b.m("POST").h(headers).b(body);
|
|
247
|
+
return b.build();
|
|
248
|
+
};
|
|
249
|
+
const se_PutItemsCommand = async (input, context) => {
|
|
250
|
+
const b = core.requestBuilder(input, context);
|
|
251
|
+
const headers = {
|
|
252
|
+
"content-type": "application/json",
|
|
253
|
+
};
|
|
254
|
+
b.bp("/items");
|
|
255
|
+
let body;
|
|
256
|
+
body = JSON.stringify(smithyClient.take(input, {
|
|
257
|
+
datasetArn: [],
|
|
258
|
+
items: (_) => se_ItemList(_),
|
|
259
|
+
}));
|
|
260
|
+
b.m("POST").h(headers).b(body);
|
|
261
|
+
return b.build();
|
|
262
|
+
};
|
|
263
|
+
const se_PutUsersCommand = async (input, context) => {
|
|
264
|
+
const b = core.requestBuilder(input, context);
|
|
265
|
+
const headers = {
|
|
266
|
+
"content-type": "application/json",
|
|
267
|
+
};
|
|
268
|
+
b.bp("/users");
|
|
269
|
+
let body;
|
|
270
|
+
body = JSON.stringify(smithyClient.take(input, {
|
|
271
|
+
datasetArn: [],
|
|
272
|
+
users: (_) => se_UserList(_),
|
|
273
|
+
}));
|
|
274
|
+
b.m("POST").h(headers).b(body);
|
|
275
|
+
return b.build();
|
|
276
|
+
};
|
|
277
|
+
const de_PutActionInteractionsCommand = async (output, context) => {
|
|
278
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
279
|
+
return de_CommandError(output, context);
|
|
280
|
+
}
|
|
281
|
+
const contents = smithyClient.map({
|
|
282
|
+
$metadata: deserializeMetadata(output),
|
|
231
283
|
});
|
|
232
|
-
|
|
233
|
-
|
|
284
|
+
await smithyClient.collectBody(output.body, context);
|
|
285
|
+
return contents;
|
|
234
286
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* @internal
|
|
243
|
-
*/
|
|
244
|
-
constructor(opts) {
|
|
245
|
-
super({
|
|
246
|
-
name: "ResourceInUseException",
|
|
247
|
-
$fault: "client",
|
|
248
|
-
...opts
|
|
287
|
+
const de_PutActionsCommand = async (output, context) => {
|
|
288
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
289
|
+
return de_CommandError(output, context);
|
|
290
|
+
}
|
|
291
|
+
const contents = smithyClient.map({
|
|
292
|
+
$metadata: deserializeMetadata(output),
|
|
249
293
|
});
|
|
250
|
-
|
|
251
|
-
|
|
294
|
+
await smithyClient.collectBody(output.body, context);
|
|
295
|
+
return contents;
|
|
252
296
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* @internal
|
|
261
|
-
*/
|
|
262
|
-
constructor(opts) {
|
|
263
|
-
super({
|
|
264
|
-
name: "ResourceNotFoundException",
|
|
265
|
-
$fault: "client",
|
|
266
|
-
...opts
|
|
297
|
+
const de_PutEventsCommand = async (output, context) => {
|
|
298
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
299
|
+
return de_CommandError(output, context);
|
|
300
|
+
}
|
|
301
|
+
const contents = smithyClient.map({
|
|
302
|
+
$metadata: deserializeMetadata(output),
|
|
267
303
|
});
|
|
268
|
-
|
|
269
|
-
|
|
304
|
+
await smithyClient.collectBody(output.body, context);
|
|
305
|
+
return contents;
|
|
270
306
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
...obj.properties && { properties: import_smithy_client.SENSITIVE_STRING }
|
|
281
|
-
}), "ActionInteractionFilterSensitiveLog");
|
|
282
|
-
var PutActionInteractionsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
283
|
-
...obj,
|
|
284
|
-
...obj.actionInteractions && {
|
|
285
|
-
actionInteractions: obj.actionInteractions.map((item) => ActionInteractionFilterSensitiveLog(item))
|
|
286
|
-
}
|
|
287
|
-
}), "PutActionInteractionsRequestFilterSensitiveLog");
|
|
288
|
-
var PutActionsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
289
|
-
...obj,
|
|
290
|
-
...obj.actions && { actions: obj.actions.map((item) => ActionFilterSensitiveLog(item)) }
|
|
291
|
-
}), "PutActionsRequestFilterSensitiveLog");
|
|
292
|
-
var EventFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
293
|
-
...obj,
|
|
294
|
-
...obj.itemId && { itemId: import_smithy_client.SENSITIVE_STRING },
|
|
295
|
-
...obj.properties && { properties: import_smithy_client.SENSITIVE_STRING },
|
|
296
|
-
...obj.impression && { impression: import_smithy_client.SENSITIVE_STRING }
|
|
297
|
-
}), "EventFilterSensitiveLog");
|
|
298
|
-
var PutEventsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
299
|
-
...obj,
|
|
300
|
-
...obj.userId && { userId: import_smithy_client.SENSITIVE_STRING },
|
|
301
|
-
...obj.eventList && { eventList: import_smithy_client.SENSITIVE_STRING }
|
|
302
|
-
}), "PutEventsRequestFilterSensitiveLog");
|
|
303
|
-
var ItemFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
304
|
-
...obj,
|
|
305
|
-
...obj.properties && { properties: import_smithy_client.SENSITIVE_STRING }
|
|
306
|
-
}), "ItemFilterSensitiveLog");
|
|
307
|
-
var PutItemsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
308
|
-
...obj,
|
|
309
|
-
...obj.items && { items: obj.items.map((item) => ItemFilterSensitiveLog(item)) }
|
|
310
|
-
}), "PutItemsRequestFilterSensitiveLog");
|
|
311
|
-
var UserFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
312
|
-
...obj,
|
|
313
|
-
...obj.properties && { properties: import_smithy_client.SENSITIVE_STRING }
|
|
314
|
-
}), "UserFilterSensitiveLog");
|
|
315
|
-
var PutUsersRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
316
|
-
...obj,
|
|
317
|
-
...obj.users && { users: obj.users.map((item) => UserFilterSensitiveLog(item)) }
|
|
318
|
-
}), "PutUsersRequestFilterSensitiveLog");
|
|
319
|
-
|
|
320
|
-
// src/protocols/Aws_restJson1.ts
|
|
321
|
-
var import_core2 = require("@aws-sdk/core");
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
var se_PutActionInteractionsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
325
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
326
|
-
const headers = {
|
|
327
|
-
"content-type": "application/json"
|
|
328
|
-
};
|
|
329
|
-
b.bp("/action-interactions");
|
|
330
|
-
let body;
|
|
331
|
-
body = JSON.stringify(
|
|
332
|
-
(0, import_smithy_client.take)(input, {
|
|
333
|
-
actionInteractions: /* @__PURE__ */ __name((_) => se_ActionInteractionsList(_, context), "actionInteractions"),
|
|
334
|
-
trackingId: []
|
|
335
|
-
})
|
|
336
|
-
);
|
|
337
|
-
b.m("POST").h(headers).b(body);
|
|
338
|
-
return b.build();
|
|
339
|
-
}, "se_PutActionInteractionsCommand");
|
|
340
|
-
var se_PutActionsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
341
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
342
|
-
const headers = {
|
|
343
|
-
"content-type": "application/json"
|
|
344
|
-
};
|
|
345
|
-
b.bp("/actions");
|
|
346
|
-
let body;
|
|
347
|
-
body = JSON.stringify(
|
|
348
|
-
(0, import_smithy_client.take)(input, {
|
|
349
|
-
actions: /* @__PURE__ */ __name((_) => se_ActionList(_, context), "actions"),
|
|
350
|
-
datasetArn: []
|
|
351
|
-
})
|
|
352
|
-
);
|
|
353
|
-
b.m("POST").h(headers).b(body);
|
|
354
|
-
return b.build();
|
|
355
|
-
}, "se_PutActionsCommand");
|
|
356
|
-
var se_PutEventsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
357
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
358
|
-
const headers = {
|
|
359
|
-
"content-type": "application/json"
|
|
360
|
-
};
|
|
361
|
-
b.bp("/events");
|
|
362
|
-
let body;
|
|
363
|
-
body = JSON.stringify(
|
|
364
|
-
(0, import_smithy_client.take)(input, {
|
|
365
|
-
eventList: /* @__PURE__ */ __name((_) => se_EventList(_, context), "eventList"),
|
|
366
|
-
sessionId: [],
|
|
367
|
-
trackingId: [],
|
|
368
|
-
userId: []
|
|
369
|
-
})
|
|
370
|
-
);
|
|
371
|
-
b.m("POST").h(headers).b(body);
|
|
372
|
-
return b.build();
|
|
373
|
-
}, "se_PutEventsCommand");
|
|
374
|
-
var se_PutItemsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
375
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
376
|
-
const headers = {
|
|
377
|
-
"content-type": "application/json"
|
|
378
|
-
};
|
|
379
|
-
b.bp("/items");
|
|
380
|
-
let body;
|
|
381
|
-
body = JSON.stringify(
|
|
382
|
-
(0, import_smithy_client.take)(input, {
|
|
383
|
-
datasetArn: [],
|
|
384
|
-
items: /* @__PURE__ */ __name((_) => se_ItemList(_, context), "items")
|
|
385
|
-
})
|
|
386
|
-
);
|
|
387
|
-
b.m("POST").h(headers).b(body);
|
|
388
|
-
return b.build();
|
|
389
|
-
}, "se_PutItemsCommand");
|
|
390
|
-
var se_PutUsersCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
391
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
392
|
-
const headers = {
|
|
393
|
-
"content-type": "application/json"
|
|
394
|
-
};
|
|
395
|
-
b.bp("/users");
|
|
396
|
-
let body;
|
|
397
|
-
body = JSON.stringify(
|
|
398
|
-
(0, import_smithy_client.take)(input, {
|
|
399
|
-
datasetArn: [],
|
|
400
|
-
users: /* @__PURE__ */ __name((_) => se_UserList(_, context), "users")
|
|
401
|
-
})
|
|
402
|
-
);
|
|
403
|
-
b.m("POST").h(headers).b(body);
|
|
404
|
-
return b.build();
|
|
405
|
-
}, "se_PutUsersCommand");
|
|
406
|
-
var de_PutActionInteractionsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
407
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
408
|
-
return de_CommandError(output, context);
|
|
409
|
-
}
|
|
410
|
-
const contents = (0, import_smithy_client.map)({
|
|
411
|
-
$metadata: deserializeMetadata(output)
|
|
412
|
-
});
|
|
413
|
-
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
414
|
-
return contents;
|
|
415
|
-
}, "de_PutActionInteractionsCommand");
|
|
416
|
-
var de_PutActionsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
417
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
418
|
-
return de_CommandError(output, context);
|
|
419
|
-
}
|
|
420
|
-
const contents = (0, import_smithy_client.map)({
|
|
421
|
-
$metadata: deserializeMetadata(output)
|
|
422
|
-
});
|
|
423
|
-
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
424
|
-
return contents;
|
|
425
|
-
}, "de_PutActionsCommand");
|
|
426
|
-
var de_PutEventsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
427
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
428
|
-
return de_CommandError(output, context);
|
|
429
|
-
}
|
|
430
|
-
const contents = (0, import_smithy_client.map)({
|
|
431
|
-
$metadata: deserializeMetadata(output)
|
|
432
|
-
});
|
|
433
|
-
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
434
|
-
return contents;
|
|
435
|
-
}, "de_PutEventsCommand");
|
|
436
|
-
var de_PutItemsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
437
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
438
|
-
return de_CommandError(output, context);
|
|
439
|
-
}
|
|
440
|
-
const contents = (0, import_smithy_client.map)({
|
|
441
|
-
$metadata: deserializeMetadata(output)
|
|
442
|
-
});
|
|
443
|
-
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
444
|
-
return contents;
|
|
445
|
-
}, "de_PutItemsCommand");
|
|
446
|
-
var de_PutUsersCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
447
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
448
|
-
return de_CommandError(output, context);
|
|
449
|
-
}
|
|
450
|
-
const contents = (0, import_smithy_client.map)({
|
|
451
|
-
$metadata: deserializeMetadata(output)
|
|
452
|
-
});
|
|
453
|
-
await (0, import_smithy_client.collectBody)(output.body, context);
|
|
454
|
-
return contents;
|
|
455
|
-
}, "de_PutUsersCommand");
|
|
456
|
-
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
457
|
-
const parsedOutput = {
|
|
458
|
-
...output,
|
|
459
|
-
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
460
|
-
};
|
|
461
|
-
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
462
|
-
switch (errorCode) {
|
|
463
|
-
case "InvalidInputException":
|
|
464
|
-
case "com.amazonaws.personalizeevents#InvalidInputException":
|
|
465
|
-
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
466
|
-
case "ResourceInUseException":
|
|
467
|
-
case "com.amazonaws.personalizeevents#ResourceInUseException":
|
|
468
|
-
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
|
|
469
|
-
case "ResourceNotFoundException":
|
|
470
|
-
case "com.amazonaws.personalizeevents#ResourceNotFoundException":
|
|
471
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
472
|
-
default:
|
|
473
|
-
const parsedBody = parsedOutput.body;
|
|
474
|
-
return throwDefaultError({
|
|
475
|
-
output,
|
|
476
|
-
parsedBody,
|
|
477
|
-
errorCode
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}, "de_CommandError");
|
|
481
|
-
var throwDefaultError = (0, import_smithy_client.withBaseException)(PersonalizeEventsServiceException);
|
|
482
|
-
var de_InvalidInputExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
483
|
-
const contents = (0, import_smithy_client.map)({});
|
|
484
|
-
const data = parsedOutput.body;
|
|
485
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
486
|
-
message: import_smithy_client.expectString
|
|
487
|
-
});
|
|
488
|
-
Object.assign(contents, doc);
|
|
489
|
-
const exception = new InvalidInputException({
|
|
490
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
491
|
-
...contents
|
|
492
|
-
});
|
|
493
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
494
|
-
}, "de_InvalidInputExceptionRes");
|
|
495
|
-
var de_ResourceInUseExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
496
|
-
const contents = (0, import_smithy_client.map)({});
|
|
497
|
-
const data = parsedOutput.body;
|
|
498
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
499
|
-
message: import_smithy_client.expectString
|
|
500
|
-
});
|
|
501
|
-
Object.assign(contents, doc);
|
|
502
|
-
const exception = new ResourceInUseException({
|
|
503
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
504
|
-
...contents
|
|
505
|
-
});
|
|
506
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
507
|
-
}, "de_ResourceInUseExceptionRes");
|
|
508
|
-
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
509
|
-
const contents = (0, import_smithy_client.map)({});
|
|
510
|
-
const data = parsedOutput.body;
|
|
511
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
512
|
-
message: import_smithy_client.expectString
|
|
513
|
-
});
|
|
514
|
-
Object.assign(contents, doc);
|
|
515
|
-
const exception = new ResourceNotFoundException({
|
|
516
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
517
|
-
...contents
|
|
518
|
-
});
|
|
519
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
520
|
-
}, "de_ResourceNotFoundExceptionRes");
|
|
521
|
-
var se_Action = /* @__PURE__ */ __name((input, context) => {
|
|
522
|
-
return (0, import_smithy_client.take)(input, {
|
|
523
|
-
actionId: [],
|
|
524
|
-
properties: import_smithy_client.LazyJsonString.from
|
|
525
|
-
});
|
|
526
|
-
}, "se_Action");
|
|
527
|
-
var se_ActionInteraction = /* @__PURE__ */ __name((input, context) => {
|
|
528
|
-
return (0, import_smithy_client.take)(input, {
|
|
529
|
-
actionId: [],
|
|
530
|
-
eventId: [],
|
|
531
|
-
eventType: [],
|
|
532
|
-
impression: import_smithy_client._json,
|
|
533
|
-
properties: import_smithy_client.LazyJsonString.from,
|
|
534
|
-
recommendationId: [],
|
|
535
|
-
sessionId: [],
|
|
536
|
-
timestamp: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "timestamp"),
|
|
537
|
-
userId: []
|
|
538
|
-
});
|
|
539
|
-
}, "se_ActionInteraction");
|
|
540
|
-
var se_ActionInteractionsList = /* @__PURE__ */ __name((input, context) => {
|
|
541
|
-
return input.filter((e) => e != null).map((entry) => {
|
|
542
|
-
return se_ActionInteraction(entry, context);
|
|
543
|
-
});
|
|
544
|
-
}, "se_ActionInteractionsList");
|
|
545
|
-
var se_ActionList = /* @__PURE__ */ __name((input, context) => {
|
|
546
|
-
return input.filter((e) => e != null).map((entry) => {
|
|
547
|
-
return se_Action(entry, context);
|
|
548
|
-
});
|
|
549
|
-
}, "se_ActionList");
|
|
550
|
-
var se_Event = /* @__PURE__ */ __name((input, context) => {
|
|
551
|
-
return (0, import_smithy_client.take)(input, {
|
|
552
|
-
eventId: [],
|
|
553
|
-
eventType: [],
|
|
554
|
-
eventValue: import_smithy_client.serializeFloat,
|
|
555
|
-
impression: import_smithy_client._json,
|
|
556
|
-
itemId: [],
|
|
557
|
-
metricAttribution: import_smithy_client._json,
|
|
558
|
-
properties: import_smithy_client.LazyJsonString.from,
|
|
559
|
-
recommendationId: [],
|
|
560
|
-
sentAt: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "sentAt")
|
|
561
|
-
});
|
|
562
|
-
}, "se_Event");
|
|
563
|
-
var se_EventList = /* @__PURE__ */ __name((input, context) => {
|
|
564
|
-
return input.filter((e) => e != null).map((entry) => {
|
|
565
|
-
return se_Event(entry, context);
|
|
566
|
-
});
|
|
567
|
-
}, "se_EventList");
|
|
568
|
-
var se_Item = /* @__PURE__ */ __name((input, context) => {
|
|
569
|
-
return (0, import_smithy_client.take)(input, {
|
|
570
|
-
itemId: [],
|
|
571
|
-
properties: import_smithy_client.LazyJsonString.from
|
|
572
|
-
});
|
|
573
|
-
}, "se_Item");
|
|
574
|
-
var se_ItemList = /* @__PURE__ */ __name((input, context) => {
|
|
575
|
-
return input.filter((e) => e != null).map((entry) => {
|
|
576
|
-
return se_Item(entry, context);
|
|
577
|
-
});
|
|
578
|
-
}, "se_ItemList");
|
|
579
|
-
var se_User = /* @__PURE__ */ __name((input, context) => {
|
|
580
|
-
return (0, import_smithy_client.take)(input, {
|
|
581
|
-
properties: import_smithy_client.LazyJsonString.from,
|
|
582
|
-
userId: []
|
|
583
|
-
});
|
|
584
|
-
}, "se_User");
|
|
585
|
-
var se_UserList = /* @__PURE__ */ __name((input, context) => {
|
|
586
|
-
return input.filter((e) => e != null).map((entry) => {
|
|
587
|
-
return se_User(entry, context);
|
|
588
|
-
});
|
|
589
|
-
}, "se_UserList");
|
|
590
|
-
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
591
|
-
httpStatusCode: output.statusCode,
|
|
592
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
593
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
594
|
-
cfId: output.headers["x-amz-cf-id"]
|
|
595
|
-
}), "deserializeMetadata");
|
|
596
|
-
|
|
597
|
-
// src/commands/PutActionInteractionsCommand.ts
|
|
598
|
-
var PutActionInteractionsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
|
|
599
|
-
return [
|
|
600
|
-
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
601
|
-
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
602
|
-
];
|
|
603
|
-
}).s("AmazonPersonalizeEvents", "PutActionInteractions", {}).n("PersonalizeEventsClient", "PutActionInteractionsCommand").f(PutActionInteractionsRequestFilterSensitiveLog, void 0).ser(se_PutActionInteractionsCommand).de(de_PutActionInteractionsCommand).build() {
|
|
604
|
-
static {
|
|
605
|
-
__name(this, "PutActionInteractionsCommand");
|
|
606
|
-
}
|
|
307
|
+
const de_PutItemsCommand = async (output, context) => {
|
|
308
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
309
|
+
return de_CommandError(output, context);
|
|
310
|
+
}
|
|
311
|
+
const contents = smithyClient.map({
|
|
312
|
+
$metadata: deserializeMetadata(output),
|
|
313
|
+
});
|
|
314
|
+
await smithyClient.collectBody(output.body, context);
|
|
315
|
+
return contents;
|
|
607
316
|
};
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
];
|
|
618
|
-
}).s("AmazonPersonalizeEvents", "PutActions", {}).n("PersonalizeEventsClient", "PutActionsCommand").f(PutActionsRequestFilterSensitiveLog, void 0).ser(se_PutActionsCommand).de(de_PutActionsCommand).build() {
|
|
619
|
-
static {
|
|
620
|
-
__name(this, "PutActionsCommand");
|
|
621
|
-
}
|
|
317
|
+
const de_PutUsersCommand = async (output, context) => {
|
|
318
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
319
|
+
return de_CommandError(output, context);
|
|
320
|
+
}
|
|
321
|
+
const contents = smithyClient.map({
|
|
322
|
+
$metadata: deserializeMetadata(output),
|
|
323
|
+
});
|
|
324
|
+
await smithyClient.collectBody(output.body, context);
|
|
325
|
+
return contents;
|
|
622
326
|
};
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
327
|
+
const de_CommandError = async (output, context) => {
|
|
328
|
+
const parsedOutput = {
|
|
329
|
+
...output,
|
|
330
|
+
body: await core$1.parseJsonErrorBody(output.body, context),
|
|
331
|
+
};
|
|
332
|
+
const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
|
|
333
|
+
switch (errorCode) {
|
|
334
|
+
case "InvalidInputException":
|
|
335
|
+
case "com.amazonaws.personalizeevents#InvalidInputException":
|
|
336
|
+
throw await de_InvalidInputExceptionRes(parsedOutput);
|
|
337
|
+
case "ResourceInUseException":
|
|
338
|
+
case "com.amazonaws.personalizeevents#ResourceInUseException":
|
|
339
|
+
throw await de_ResourceInUseExceptionRes(parsedOutput);
|
|
340
|
+
case "ResourceNotFoundException":
|
|
341
|
+
case "com.amazonaws.personalizeevents#ResourceNotFoundException":
|
|
342
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput);
|
|
343
|
+
default:
|
|
344
|
+
const parsedBody = parsedOutput.body;
|
|
345
|
+
return throwDefaultError({
|
|
346
|
+
output,
|
|
347
|
+
parsedBody,
|
|
348
|
+
errorCode,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
637
351
|
};
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
352
|
+
const throwDefaultError = smithyClient.withBaseException(PersonalizeEventsServiceException);
|
|
353
|
+
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
354
|
+
const contents = smithyClient.map({});
|
|
355
|
+
const data = parsedOutput.body;
|
|
356
|
+
const doc = smithyClient.take(data, {
|
|
357
|
+
message: smithyClient.expectString,
|
|
358
|
+
});
|
|
359
|
+
Object.assign(contents, doc);
|
|
360
|
+
const exception = new InvalidInputException({
|
|
361
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
362
|
+
...contents,
|
|
363
|
+
});
|
|
364
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
652
365
|
};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
})
|
|
664
|
-
|
|
665
|
-
__name(this, "PutUsersCommand");
|
|
666
|
-
}
|
|
366
|
+
const de_ResourceInUseExceptionRes = async (parsedOutput, context) => {
|
|
367
|
+
const contents = smithyClient.map({});
|
|
368
|
+
const data = parsedOutput.body;
|
|
369
|
+
const doc = smithyClient.take(data, {
|
|
370
|
+
message: smithyClient.expectString,
|
|
371
|
+
});
|
|
372
|
+
Object.assign(contents, doc);
|
|
373
|
+
const exception = new ResourceInUseException({
|
|
374
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
375
|
+
...contents,
|
|
376
|
+
});
|
|
377
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
667
378
|
};
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
379
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
380
|
+
const contents = smithyClient.map({});
|
|
381
|
+
const data = parsedOutput.body;
|
|
382
|
+
const doc = smithyClient.take(data, {
|
|
383
|
+
message: smithyClient.expectString,
|
|
384
|
+
});
|
|
385
|
+
Object.assign(contents, doc);
|
|
386
|
+
const exception = new ResourceNotFoundException({
|
|
387
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
388
|
+
...contents,
|
|
389
|
+
});
|
|
390
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
676
391
|
};
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
392
|
+
const se_Action = (input, context) => {
|
|
393
|
+
return smithyClient.take(input, {
|
|
394
|
+
actionId: [],
|
|
395
|
+
properties: smithyClient.LazyJsonString.from,
|
|
396
|
+
});
|
|
681
397
|
};
|
|
682
|
-
(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
398
|
+
const se_ActionInteraction = (input, context) => {
|
|
399
|
+
return smithyClient.take(input, {
|
|
400
|
+
actionId: [],
|
|
401
|
+
eventId: [],
|
|
402
|
+
eventType: [],
|
|
403
|
+
impression: smithyClient._json,
|
|
404
|
+
properties: smithyClient.LazyJsonString.from,
|
|
405
|
+
recommendationId: [],
|
|
406
|
+
sessionId: [],
|
|
407
|
+
timestamp: (_) => _.getTime() / 1_000,
|
|
408
|
+
userId: [],
|
|
409
|
+
});
|
|
410
|
+
};
|
|
411
|
+
const se_ActionInteractionsList = (input, context) => {
|
|
412
|
+
return input
|
|
413
|
+
.filter((e) => e != null)
|
|
414
|
+
.map((entry) => {
|
|
415
|
+
return se_ActionInteraction(entry);
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
const se_ActionList = (input, context) => {
|
|
419
|
+
return input
|
|
420
|
+
.filter((e) => e != null)
|
|
421
|
+
.map((entry) => {
|
|
422
|
+
return se_Action(entry);
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
const se_Event = (input, context) => {
|
|
426
|
+
return smithyClient.take(input, {
|
|
427
|
+
eventId: [],
|
|
428
|
+
eventType: [],
|
|
429
|
+
eventValue: smithyClient.serializeFloat,
|
|
430
|
+
impression: smithyClient._json,
|
|
431
|
+
itemId: [],
|
|
432
|
+
metricAttribution: smithyClient._json,
|
|
433
|
+
properties: smithyClient.LazyJsonString.from,
|
|
434
|
+
recommendationId: [],
|
|
435
|
+
sentAt: (_) => _.getTime() / 1_000,
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
const se_EventList = (input, context) => {
|
|
439
|
+
return input
|
|
440
|
+
.filter((e) => e != null)
|
|
441
|
+
.map((entry) => {
|
|
442
|
+
return se_Event(entry);
|
|
443
|
+
});
|
|
444
|
+
};
|
|
445
|
+
const se_Item = (input, context) => {
|
|
446
|
+
return smithyClient.take(input, {
|
|
447
|
+
itemId: [],
|
|
448
|
+
properties: smithyClient.LazyJsonString.from,
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
const se_ItemList = (input, context) => {
|
|
452
|
+
return input
|
|
453
|
+
.filter((e) => e != null)
|
|
454
|
+
.map((entry) => {
|
|
455
|
+
return se_Item(entry);
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
const se_User = (input, context) => {
|
|
459
|
+
return smithyClient.take(input, {
|
|
460
|
+
properties: smithyClient.LazyJsonString.from,
|
|
461
|
+
userId: [],
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
const se_UserList = (input, context) => {
|
|
465
|
+
return input
|
|
466
|
+
.filter((e) => e != null)
|
|
467
|
+
.map((entry) => {
|
|
468
|
+
return se_User(entry);
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
const deserializeMetadata = (output) => ({
|
|
472
|
+
httpStatusCode: output.statusCode,
|
|
473
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
474
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
475
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
709
476
|
});
|
|
710
477
|
|
|
478
|
+
class PutActionInteractionsCommand extends smithyClient.Command
|
|
479
|
+
.classBuilder()
|
|
480
|
+
.ep(commonParams)
|
|
481
|
+
.m(function (Command, cs, config, o) {
|
|
482
|
+
return [
|
|
483
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
484
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
485
|
+
];
|
|
486
|
+
})
|
|
487
|
+
.s("AmazonPersonalizeEvents", "PutActionInteractions", {})
|
|
488
|
+
.n("PersonalizeEventsClient", "PutActionInteractionsCommand")
|
|
489
|
+
.f(PutActionInteractionsRequestFilterSensitiveLog, void 0)
|
|
490
|
+
.ser(se_PutActionInteractionsCommand)
|
|
491
|
+
.de(de_PutActionInteractionsCommand)
|
|
492
|
+
.build() {
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
class PutActionsCommand extends smithyClient.Command
|
|
496
|
+
.classBuilder()
|
|
497
|
+
.ep(commonParams)
|
|
498
|
+
.m(function (Command, cs, config, o) {
|
|
499
|
+
return [
|
|
500
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
501
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
502
|
+
];
|
|
503
|
+
})
|
|
504
|
+
.s("AmazonPersonalizeEvents", "PutActions", {})
|
|
505
|
+
.n("PersonalizeEventsClient", "PutActionsCommand")
|
|
506
|
+
.f(PutActionsRequestFilterSensitiveLog, void 0)
|
|
507
|
+
.ser(se_PutActionsCommand)
|
|
508
|
+
.de(de_PutActionsCommand)
|
|
509
|
+
.build() {
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
class PutEventsCommand extends smithyClient.Command
|
|
513
|
+
.classBuilder()
|
|
514
|
+
.ep(commonParams)
|
|
515
|
+
.m(function (Command, cs, config, o) {
|
|
516
|
+
return [
|
|
517
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
518
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
519
|
+
];
|
|
520
|
+
})
|
|
521
|
+
.s("AmazonPersonalizeEvents", "PutEvents", {})
|
|
522
|
+
.n("PersonalizeEventsClient", "PutEventsCommand")
|
|
523
|
+
.f(PutEventsRequestFilterSensitiveLog, void 0)
|
|
524
|
+
.ser(se_PutEventsCommand)
|
|
525
|
+
.de(de_PutEventsCommand)
|
|
526
|
+
.build() {
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
class PutItemsCommand extends smithyClient.Command
|
|
530
|
+
.classBuilder()
|
|
531
|
+
.ep(commonParams)
|
|
532
|
+
.m(function (Command, cs, config, o) {
|
|
533
|
+
return [
|
|
534
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
535
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
536
|
+
];
|
|
537
|
+
})
|
|
538
|
+
.s("AmazonPersonalizeEvents", "PutItems", {})
|
|
539
|
+
.n("PersonalizeEventsClient", "PutItemsCommand")
|
|
540
|
+
.f(PutItemsRequestFilterSensitiveLog, void 0)
|
|
541
|
+
.ser(se_PutItemsCommand)
|
|
542
|
+
.de(de_PutItemsCommand)
|
|
543
|
+
.build() {
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
class PutUsersCommand extends smithyClient.Command
|
|
547
|
+
.classBuilder()
|
|
548
|
+
.ep(commonParams)
|
|
549
|
+
.m(function (Command, cs, config, o) {
|
|
550
|
+
return [
|
|
551
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
552
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
553
|
+
];
|
|
554
|
+
})
|
|
555
|
+
.s("AmazonPersonalizeEvents", "PutUsers", {})
|
|
556
|
+
.n("PersonalizeEventsClient", "PutUsersCommand")
|
|
557
|
+
.f(PutUsersRequestFilterSensitiveLog, void 0)
|
|
558
|
+
.ser(se_PutUsersCommand)
|
|
559
|
+
.de(de_PutUsersCommand)
|
|
560
|
+
.build() {
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const commands = {
|
|
564
|
+
PutActionInteractionsCommand,
|
|
565
|
+
PutActionsCommand,
|
|
566
|
+
PutEventsCommand,
|
|
567
|
+
PutItemsCommand,
|
|
568
|
+
PutUsersCommand,
|
|
569
|
+
};
|
|
570
|
+
class PersonalizeEvents extends PersonalizeEventsClient {
|
|
571
|
+
}
|
|
572
|
+
smithyClient.createAggregatedClient(commands, PersonalizeEvents);
|
|
573
|
+
|
|
574
|
+
Object.defineProperty(exports, "$Command", {
|
|
575
|
+
enumerable: true,
|
|
576
|
+
get: function () { return smithyClient.Command; }
|
|
577
|
+
});
|
|
578
|
+
Object.defineProperty(exports, "__Client", {
|
|
579
|
+
enumerable: true,
|
|
580
|
+
get: function () { return smithyClient.Client; }
|
|
581
|
+
});
|
|
582
|
+
exports.ActionFilterSensitiveLog = ActionFilterSensitiveLog;
|
|
583
|
+
exports.ActionInteractionFilterSensitiveLog = ActionInteractionFilterSensitiveLog;
|
|
584
|
+
exports.EventFilterSensitiveLog = EventFilterSensitiveLog;
|
|
585
|
+
exports.InvalidInputException = InvalidInputException;
|
|
586
|
+
exports.ItemFilterSensitiveLog = ItemFilterSensitiveLog;
|
|
587
|
+
exports.PersonalizeEvents = PersonalizeEvents;
|
|
588
|
+
exports.PersonalizeEventsClient = PersonalizeEventsClient;
|
|
589
|
+
exports.PersonalizeEventsServiceException = PersonalizeEventsServiceException;
|
|
590
|
+
exports.PutActionInteractionsCommand = PutActionInteractionsCommand;
|
|
591
|
+
exports.PutActionInteractionsRequestFilterSensitiveLog = PutActionInteractionsRequestFilterSensitiveLog;
|
|
592
|
+
exports.PutActionsCommand = PutActionsCommand;
|
|
593
|
+
exports.PutActionsRequestFilterSensitiveLog = PutActionsRequestFilterSensitiveLog;
|
|
594
|
+
exports.PutEventsCommand = PutEventsCommand;
|
|
595
|
+
exports.PutEventsRequestFilterSensitiveLog = PutEventsRequestFilterSensitiveLog;
|
|
596
|
+
exports.PutItemsCommand = PutItemsCommand;
|
|
597
|
+
exports.PutItemsRequestFilterSensitiveLog = PutItemsRequestFilterSensitiveLog;
|
|
598
|
+
exports.PutUsersCommand = PutUsersCommand;
|
|
599
|
+
exports.PutUsersRequestFilterSensitiveLog = PutUsersRequestFilterSensitiveLog;
|
|
600
|
+
exports.ResourceInUseException = ResourceInUseException;
|
|
601
|
+
exports.ResourceNotFoundException = ResourceNotFoundException;
|
|
602
|
+
exports.UserFilterSensitiveLog = UserFilterSensitiveLog;
|