@aws-sdk/client-connectparticipant 3.185.0 → 3.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist-es/ConnectParticipant.js +34 -41
- package/dist-es/ConnectParticipantClient.js +23 -29
- package/dist-es/commands/CompleteAttachmentUploadCommand.js +21 -28
- package/dist-es/commands/CreateParticipantConnectionCommand.js +21 -28
- package/dist-es/commands/DisconnectParticipantCommand.js +21 -28
- package/dist-es/commands/GetAttachmentCommand.js +21 -28
- package/dist-es/commands/GetTranscriptCommand.js +21 -28
- package/dist-es/commands/SendEventCommand.js +21 -28
- package/dist-es/commands/SendMessageCommand.js +21 -28
- package/dist-es/commands/StartAttachmentUploadCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/ConnectParticipantServiceException.js +5 -10
- package/dist-es/models/models_0.js +138 -95
- package/dist-es/pagination/GetTranscriptPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +656 -902
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,878 +1,649 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
4
|
import { ConnectParticipantServiceException as __BaseException } from "../models/ConnectParticipantServiceException";
|
|
6
5
|
import { AccessDeniedException, ConflictException, InternalServerException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
path: resolvedPath,
|
|
30
|
-
body: body,
|
|
31
|
-
})];
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}); };
|
|
35
|
-
export var serializeAws_restJson1CreateParticipantConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
36
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
37
|
-
return __generator(this, function (_c) {
|
|
38
|
-
switch (_c.label) {
|
|
39
|
-
case 0: return [4, context.endpoint()];
|
|
40
|
-
case 1:
|
|
41
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
42
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
43
|
-
"content-type": "application/json",
|
|
44
|
-
"x-amz-bearer": input.ParticipantToken,
|
|
45
|
-
});
|
|
46
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/connection";
|
|
47
|
-
body = JSON.stringify(__assign(__assign({}, (input.ConnectParticipant != null && { ConnectParticipant: input.ConnectParticipant })), (input.Type != null && { Type: serializeAws_restJson1ConnectionTypeList(input.Type, context) })));
|
|
48
|
-
return [2, new __HttpRequest({
|
|
49
|
-
protocol: protocol,
|
|
50
|
-
hostname: hostname,
|
|
51
|
-
port: port,
|
|
52
|
-
method: "POST",
|
|
53
|
-
headers: headers,
|
|
54
|
-
path: resolvedPath,
|
|
55
|
-
body: body,
|
|
56
|
-
})];
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}); };
|
|
60
|
-
export var serializeAws_restJson1DisconnectParticipantCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
62
|
-
var _c;
|
|
63
|
-
return __generator(this, function (_d) {
|
|
64
|
-
switch (_d.label) {
|
|
65
|
-
case 0: return [4, context.endpoint()];
|
|
66
|
-
case 1:
|
|
67
|
-
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
68
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
69
|
-
"content-type": "application/json",
|
|
70
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
71
|
-
});
|
|
72
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/disconnect";
|
|
73
|
-
body = JSON.stringify({
|
|
74
|
-
ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken(),
|
|
75
|
-
});
|
|
76
|
-
return [2, new __HttpRequest({
|
|
77
|
-
protocol: protocol,
|
|
78
|
-
hostname: hostname,
|
|
79
|
-
port: port,
|
|
80
|
-
method: "POST",
|
|
81
|
-
headers: headers,
|
|
82
|
-
path: resolvedPath,
|
|
83
|
-
body: body,
|
|
84
|
-
})];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}); };
|
|
88
|
-
export var serializeAws_restJson1GetAttachmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
90
|
-
return __generator(this, function (_c) {
|
|
91
|
-
switch (_c.label) {
|
|
92
|
-
case 0: return [4, context.endpoint()];
|
|
93
|
-
case 1:
|
|
94
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
95
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
96
|
-
"content-type": "application/json",
|
|
97
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
98
|
-
});
|
|
99
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/attachment";
|
|
100
|
-
body = JSON.stringify(__assign({}, (input.AttachmentId != null && { AttachmentId: input.AttachmentId })));
|
|
101
|
-
return [2, new __HttpRequest({
|
|
102
|
-
protocol: protocol,
|
|
103
|
-
hostname: hostname,
|
|
104
|
-
port: port,
|
|
105
|
-
method: "POST",
|
|
106
|
-
headers: headers,
|
|
107
|
-
path: resolvedPath,
|
|
108
|
-
body: body,
|
|
109
|
-
})];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}); };
|
|
113
|
-
export var serializeAws_restJson1GetTranscriptCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
115
|
-
return __generator(this, function (_c) {
|
|
116
|
-
switch (_c.label) {
|
|
117
|
-
case 0: return [4, context.endpoint()];
|
|
118
|
-
case 1:
|
|
119
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
120
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
121
|
-
"content-type": "application/json",
|
|
122
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
123
|
-
});
|
|
124
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/transcript";
|
|
125
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ContactId != null && { ContactId: input.ContactId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.ScanDirection != null && { ScanDirection: input.ScanDirection })), (input.SortOrder != null && { SortOrder: input.SortOrder })), (input.StartPosition != null && {
|
|
126
|
-
StartPosition: serializeAws_restJson1StartPosition(input.StartPosition, context),
|
|
127
|
-
})));
|
|
128
|
-
return [2, new __HttpRequest({
|
|
129
|
-
protocol: protocol,
|
|
130
|
-
hostname: hostname,
|
|
131
|
-
port: port,
|
|
132
|
-
method: "POST",
|
|
133
|
-
headers: headers,
|
|
134
|
-
path: resolvedPath,
|
|
135
|
-
body: body,
|
|
136
|
-
})];
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}); };
|
|
140
|
-
export var serializeAws_restJson1SendEventCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
141
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
142
|
-
var _c;
|
|
143
|
-
return __generator(this, function (_d) {
|
|
144
|
-
switch (_d.label) {
|
|
145
|
-
case 0: return [4, context.endpoint()];
|
|
146
|
-
case 1:
|
|
147
|
-
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
148
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
149
|
-
"content-type": "application/json",
|
|
150
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
151
|
-
});
|
|
152
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/event";
|
|
153
|
-
body = JSON.stringify(__assign(__assign({ ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Content != null && { Content: input.Content })), (input.ContentType != null && { ContentType: input.ContentType })));
|
|
154
|
-
return [2, new __HttpRequest({
|
|
155
|
-
protocol: protocol,
|
|
156
|
-
hostname: hostname,
|
|
157
|
-
port: port,
|
|
158
|
-
method: "POST",
|
|
159
|
-
headers: headers,
|
|
160
|
-
path: resolvedPath,
|
|
161
|
-
body: body,
|
|
162
|
-
})];
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}); };
|
|
166
|
-
export var serializeAws_restJson1SendMessageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
167
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
168
|
-
var _c;
|
|
169
|
-
return __generator(this, function (_d) {
|
|
170
|
-
switch (_d.label) {
|
|
171
|
-
case 0: return [4, context.endpoint()];
|
|
172
|
-
case 1:
|
|
173
|
-
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
174
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
175
|
-
"content-type": "application/json",
|
|
176
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
177
|
-
});
|
|
178
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/message";
|
|
179
|
-
body = JSON.stringify(__assign(__assign({ ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.Content != null && { Content: input.Content })), (input.ContentType != null && { ContentType: input.ContentType })));
|
|
180
|
-
return [2, new __HttpRequest({
|
|
181
|
-
protocol: protocol,
|
|
182
|
-
hostname: hostname,
|
|
183
|
-
port: port,
|
|
184
|
-
method: "POST",
|
|
185
|
-
headers: headers,
|
|
186
|
-
path: resolvedPath,
|
|
187
|
-
body: body,
|
|
188
|
-
})];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}); };
|
|
192
|
-
export var serializeAws_restJson1StartAttachmentUploadCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
194
|
-
var _c;
|
|
195
|
-
return __generator(this, function (_d) {
|
|
196
|
-
switch (_d.label) {
|
|
197
|
-
case 0: return [4, context.endpoint()];
|
|
198
|
-
case 1:
|
|
199
|
-
_a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
200
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
201
|
-
"content-type": "application/json",
|
|
202
|
-
"x-amz-bearer": input.ConnectionToken,
|
|
203
|
-
});
|
|
204
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/participant/start-attachment-upload";
|
|
205
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.AttachmentName != null && { AttachmentName: input.AttachmentName })), (input.AttachmentSizeInBytes != null && { AttachmentSizeInBytes: input.AttachmentSizeInBytes })), { ClientToken: (_c = input.ClientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.ContentType != null && { ContentType: input.ContentType })));
|
|
206
|
-
return [2, new __HttpRequest({
|
|
207
|
-
protocol: protocol,
|
|
208
|
-
hostname: hostname,
|
|
209
|
-
port: port,
|
|
210
|
-
method: "POST",
|
|
211
|
-
headers: headers,
|
|
212
|
-
path: resolvedPath,
|
|
213
|
-
body: body,
|
|
214
|
-
})];
|
|
215
|
-
}
|
|
6
|
+
export const serializeAws_restJson1CompleteAttachmentUploadCommand = async (input, context) => {
|
|
7
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
8
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
11
|
+
});
|
|
12
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/complete-attachment-upload";
|
|
13
|
+
let body;
|
|
14
|
+
body = JSON.stringify({
|
|
15
|
+
...(input.AttachmentIds != null && {
|
|
16
|
+
AttachmentIds: serializeAws_restJson1AttachmentIdList(input.AttachmentIds, context),
|
|
17
|
+
}),
|
|
18
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
19
|
+
});
|
|
20
|
+
return new __HttpRequest({
|
|
21
|
+
protocol,
|
|
22
|
+
hostname,
|
|
23
|
+
port,
|
|
24
|
+
method: "POST",
|
|
25
|
+
headers,
|
|
26
|
+
path: resolvedPath,
|
|
27
|
+
body,
|
|
216
28
|
});
|
|
217
|
-
}
|
|
218
|
-
export
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var _c;
|
|
239
|
-
return __generator(this, function (_d) {
|
|
240
|
-
switch (_d.label) {
|
|
241
|
-
case 0:
|
|
242
|
-
_a = [__assign({}, output)];
|
|
243
|
-
_c = {};
|
|
244
|
-
return [4, parseErrorBody(output.body, context)];
|
|
245
|
-
case 1:
|
|
246
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
247
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
248
|
-
_b = errorCode;
|
|
249
|
-
switch (_b) {
|
|
250
|
-
case "AccessDeniedException": return [3, 2];
|
|
251
|
-
case "com.amazonaws.connectparticipant#AccessDeniedException": return [3, 2];
|
|
252
|
-
case "ConflictException": return [3, 4];
|
|
253
|
-
case "com.amazonaws.connectparticipant#ConflictException": return [3, 4];
|
|
254
|
-
case "InternalServerException": return [3, 6];
|
|
255
|
-
case "com.amazonaws.connectparticipant#InternalServerException": return [3, 6];
|
|
256
|
-
case "ServiceQuotaExceededException": return [3, 8];
|
|
257
|
-
case "com.amazonaws.connectparticipant#ServiceQuotaExceededException": return [3, 8];
|
|
258
|
-
case "ThrottlingException": return [3, 10];
|
|
259
|
-
case "com.amazonaws.connectparticipant#ThrottlingException": return [3, 10];
|
|
260
|
-
case "ValidationException": return [3, 12];
|
|
261
|
-
case "com.amazonaws.connectparticipant#ValidationException": return [3, 12];
|
|
262
|
-
}
|
|
263
|
-
return [3, 14];
|
|
264
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
265
|
-
case 3: throw _d.sent();
|
|
266
|
-
case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
267
|
-
case 5: throw _d.sent();
|
|
268
|
-
case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
269
|
-
case 7: throw _d.sent();
|
|
270
|
-
case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
271
|
-
case 9: throw _d.sent();
|
|
272
|
-
case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
273
|
-
case 11: throw _d.sent();
|
|
274
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
275
|
-
case 13: throw _d.sent();
|
|
276
|
-
case 14:
|
|
277
|
-
parsedBody = parsedOutput.body;
|
|
278
|
-
throwDefaultError({
|
|
279
|
-
output: output,
|
|
280
|
-
parsedBody: parsedBody,
|
|
281
|
-
exceptionCtor: __BaseException,
|
|
282
|
-
errorCode: errorCode,
|
|
283
|
-
});
|
|
284
|
-
_d.label = 15;
|
|
285
|
-
case 15: return [2];
|
|
286
|
-
}
|
|
29
|
+
};
|
|
30
|
+
export const serializeAws_restJson1CreateParticipantConnectionCommand = async (input, context) => {
|
|
31
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
"x-amz-bearer": input.ParticipantToken,
|
|
35
|
+
});
|
|
36
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/connection";
|
|
37
|
+
let body;
|
|
38
|
+
body = JSON.stringify({
|
|
39
|
+
...(input.ConnectParticipant != null && { ConnectParticipant: input.ConnectParticipant }),
|
|
40
|
+
...(input.Type != null && { Type: serializeAws_restJson1ConnectionTypeList(input.Type, context) }),
|
|
41
|
+
});
|
|
42
|
+
return new __HttpRequest({
|
|
43
|
+
protocol,
|
|
44
|
+
hostname,
|
|
45
|
+
port,
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers,
|
|
48
|
+
path: resolvedPath,
|
|
49
|
+
body,
|
|
287
50
|
});
|
|
288
|
-
}
|
|
289
|
-
export
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
if (data.Websocket != null) {
|
|
309
|
-
contents.Websocket = deserializeAws_restJson1Websocket(data.Websocket, context);
|
|
310
|
-
}
|
|
311
|
-
return [2, contents];
|
|
312
|
-
}
|
|
51
|
+
};
|
|
52
|
+
export const serializeAws_restJson1DisconnectParticipantCommand = async (input, context) => {
|
|
53
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
54
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
55
|
+
"content-type": "application/json",
|
|
56
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
57
|
+
});
|
|
58
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/disconnect";
|
|
59
|
+
let body;
|
|
60
|
+
body = JSON.stringify({
|
|
61
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
62
|
+
});
|
|
63
|
+
return new __HttpRequest({
|
|
64
|
+
protocol,
|
|
65
|
+
hostname,
|
|
66
|
+
port,
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers,
|
|
69
|
+
path: resolvedPath,
|
|
70
|
+
body,
|
|
313
71
|
});
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
case "com.amazonaws.connectparticipant#ThrottlingException": return [3, 6];
|
|
335
|
-
case "ValidationException": return [3, 8];
|
|
336
|
-
case "com.amazonaws.connectparticipant#ValidationException": return [3, 8];
|
|
337
|
-
}
|
|
338
|
-
return [3, 10];
|
|
339
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
340
|
-
case 3: throw _d.sent();
|
|
341
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
342
|
-
case 5: throw _d.sent();
|
|
343
|
-
case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
344
|
-
case 7: throw _d.sent();
|
|
345
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
346
|
-
case 9: throw _d.sent();
|
|
347
|
-
case 10:
|
|
348
|
-
parsedBody = parsedOutput.body;
|
|
349
|
-
throwDefaultError({
|
|
350
|
-
output: output,
|
|
351
|
-
parsedBody: parsedBody,
|
|
352
|
-
exceptionCtor: __BaseException,
|
|
353
|
-
errorCode: errorCode,
|
|
354
|
-
});
|
|
355
|
-
_d.label = 11;
|
|
356
|
-
case 11: return [2];
|
|
357
|
-
}
|
|
72
|
+
};
|
|
73
|
+
export const serializeAws_restJson1GetAttachmentCommand = async (input, context) => {
|
|
74
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
75
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
76
|
+
"content-type": "application/json",
|
|
77
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
78
|
+
});
|
|
79
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/attachment";
|
|
80
|
+
let body;
|
|
81
|
+
body = JSON.stringify({
|
|
82
|
+
...(input.AttachmentId != null && { AttachmentId: input.AttachmentId }),
|
|
83
|
+
});
|
|
84
|
+
return new __HttpRequest({
|
|
85
|
+
protocol,
|
|
86
|
+
hostname,
|
|
87
|
+
port,
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers,
|
|
90
|
+
path: resolvedPath,
|
|
91
|
+
body,
|
|
358
92
|
});
|
|
359
|
-
}
|
|
360
|
-
export
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
93
|
+
};
|
|
94
|
+
export const serializeAws_restJson1GetTranscriptCommand = async (input, context) => {
|
|
95
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
96
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
97
|
+
"content-type": "application/json",
|
|
98
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
99
|
+
});
|
|
100
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/transcript";
|
|
101
|
+
let body;
|
|
102
|
+
body = JSON.stringify({
|
|
103
|
+
...(input.ContactId != null && { ContactId: input.ContactId }),
|
|
104
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
105
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
106
|
+
...(input.ScanDirection != null && { ScanDirection: input.ScanDirection }),
|
|
107
|
+
...(input.SortOrder != null && { SortOrder: input.SortOrder }),
|
|
108
|
+
...(input.StartPosition != null && {
|
|
109
|
+
StartPosition: serializeAws_restJson1StartPosition(input.StartPosition, context),
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
return new __HttpRequest({
|
|
113
|
+
protocol,
|
|
114
|
+
hostname,
|
|
115
|
+
port,
|
|
116
|
+
method: "POST",
|
|
117
|
+
headers,
|
|
118
|
+
path: resolvedPath,
|
|
119
|
+
body,
|
|
376
120
|
});
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
case "com.amazonaws.connectparticipant#ValidationException": return [3, 8];
|
|
400
|
-
}
|
|
401
|
-
return [3, 10];
|
|
402
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
403
|
-
case 3: throw _d.sent();
|
|
404
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
405
|
-
case 5: throw _d.sent();
|
|
406
|
-
case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
407
|
-
case 7: throw _d.sent();
|
|
408
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
409
|
-
case 9: throw _d.sent();
|
|
410
|
-
case 10:
|
|
411
|
-
parsedBody = parsedOutput.body;
|
|
412
|
-
throwDefaultError({
|
|
413
|
-
output: output,
|
|
414
|
-
parsedBody: parsedBody,
|
|
415
|
-
exceptionCtor: __BaseException,
|
|
416
|
-
errorCode: errorCode,
|
|
417
|
-
});
|
|
418
|
-
_d.label = 11;
|
|
419
|
-
case 11: return [2];
|
|
420
|
-
}
|
|
121
|
+
};
|
|
122
|
+
export const serializeAws_restJson1SendEventCommand = async (input, context) => {
|
|
123
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
124
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
125
|
+
"content-type": "application/json",
|
|
126
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
127
|
+
});
|
|
128
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/event";
|
|
129
|
+
let body;
|
|
130
|
+
body = JSON.stringify({
|
|
131
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
132
|
+
...(input.Content != null && { Content: input.Content }),
|
|
133
|
+
...(input.ContentType != null && { ContentType: input.ContentType }),
|
|
134
|
+
});
|
|
135
|
+
return new __HttpRequest({
|
|
136
|
+
protocol,
|
|
137
|
+
hostname,
|
|
138
|
+
port,
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers,
|
|
141
|
+
path: resolvedPath,
|
|
142
|
+
body,
|
|
421
143
|
});
|
|
422
|
-
}
|
|
423
|
-
export
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
return [2, contents];
|
|
446
|
-
}
|
|
144
|
+
};
|
|
145
|
+
export const serializeAws_restJson1SendMessageCommand = async (input, context) => {
|
|
146
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
147
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
148
|
+
"content-type": "application/json",
|
|
149
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
150
|
+
});
|
|
151
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/message";
|
|
152
|
+
let body;
|
|
153
|
+
body = JSON.stringify({
|
|
154
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
155
|
+
...(input.Content != null && { Content: input.Content }),
|
|
156
|
+
...(input.ContentType != null && { ContentType: input.ContentType }),
|
|
157
|
+
});
|
|
158
|
+
return new __HttpRequest({
|
|
159
|
+
protocol,
|
|
160
|
+
hostname,
|
|
161
|
+
port,
|
|
162
|
+
method: "POST",
|
|
163
|
+
headers,
|
|
164
|
+
path: resolvedPath,
|
|
165
|
+
body,
|
|
447
166
|
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
return [3, 10];
|
|
473
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
474
|
-
case 3: throw _d.sent();
|
|
475
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
476
|
-
case 5: throw _d.sent();
|
|
477
|
-
case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
478
|
-
case 7: throw _d.sent();
|
|
479
|
-
case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
480
|
-
case 9: throw _d.sent();
|
|
481
|
-
case 10:
|
|
482
|
-
parsedBody = parsedOutput.body;
|
|
483
|
-
throwDefaultError({
|
|
484
|
-
output: output,
|
|
485
|
-
parsedBody: parsedBody,
|
|
486
|
-
exceptionCtor: __BaseException,
|
|
487
|
-
errorCode: errorCode,
|
|
488
|
-
});
|
|
489
|
-
_d.label = 11;
|
|
490
|
-
case 11: return [2];
|
|
491
|
-
}
|
|
167
|
+
};
|
|
168
|
+
export const serializeAws_restJson1StartAttachmentUploadCommand = async (input, context) => {
|
|
169
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
170
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
171
|
+
"content-type": "application/json",
|
|
172
|
+
"x-amz-bearer": input.ConnectionToken,
|
|
173
|
+
});
|
|
174
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/start-attachment-upload";
|
|
175
|
+
let body;
|
|
176
|
+
body = JSON.stringify({
|
|
177
|
+
...(input.AttachmentName != null && { AttachmentName: input.AttachmentName }),
|
|
178
|
+
...(input.AttachmentSizeInBytes != null && { AttachmentSizeInBytes: input.AttachmentSizeInBytes }),
|
|
179
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
180
|
+
...(input.ContentType != null && { ContentType: input.ContentType }),
|
|
181
|
+
});
|
|
182
|
+
return new __HttpRequest({
|
|
183
|
+
protocol,
|
|
184
|
+
hostname,
|
|
185
|
+
port,
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers,
|
|
188
|
+
path: resolvedPath,
|
|
189
|
+
body,
|
|
492
190
|
});
|
|
493
|
-
}
|
|
494
|
-
export
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
return [2, deserializeAws_restJson1GetTranscriptCommandError(output, context)];
|
|
501
|
-
}
|
|
502
|
-
contents = map({
|
|
503
|
-
$metadata: deserializeMetadata(output),
|
|
504
|
-
});
|
|
505
|
-
_a = __expectNonNull;
|
|
506
|
-
_b = __expectObject;
|
|
507
|
-
return [4, parseBody(output.body, context)];
|
|
508
|
-
case 1:
|
|
509
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
510
|
-
if (data.InitialContactId != null) {
|
|
511
|
-
contents.InitialContactId = __expectString(data.InitialContactId);
|
|
512
|
-
}
|
|
513
|
-
if (data.NextToken != null) {
|
|
514
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
515
|
-
}
|
|
516
|
-
if (data.Transcript != null) {
|
|
517
|
-
contents.Transcript = deserializeAws_restJson1Transcript(data.Transcript, context);
|
|
518
|
-
}
|
|
519
|
-
return [2, contents];
|
|
520
|
-
}
|
|
191
|
+
};
|
|
192
|
+
export const deserializeAws_restJson1CompleteAttachmentUploadCommand = async (output, context) => {
|
|
193
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
194
|
+
return deserializeAws_restJson1CompleteAttachmentUploadCommandError(output, context);
|
|
195
|
+
}
|
|
196
|
+
const contents = map({
|
|
197
|
+
$metadata: deserializeMetadata(output),
|
|
521
198
|
});
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
199
|
+
await collectBody(output.body, context);
|
|
200
|
+
return contents;
|
|
201
|
+
};
|
|
202
|
+
const deserializeAws_restJson1CompleteAttachmentUploadCommandError = async (output, context) => {
|
|
203
|
+
const parsedOutput = {
|
|
204
|
+
...output,
|
|
205
|
+
body: await parseErrorBody(output.body, context),
|
|
206
|
+
};
|
|
207
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
208
|
+
switch (errorCode) {
|
|
209
|
+
case "AccessDeniedException":
|
|
210
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
211
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
212
|
+
case "ConflictException":
|
|
213
|
+
case "com.amazonaws.connectparticipant#ConflictException":
|
|
214
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
215
|
+
case "InternalServerException":
|
|
216
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
217
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
218
|
+
case "ServiceQuotaExceededException":
|
|
219
|
+
case "com.amazonaws.connectparticipant#ServiceQuotaExceededException":
|
|
220
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
221
|
+
case "ThrottlingException":
|
|
222
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
223
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
224
|
+
case "ValidationException":
|
|
225
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
226
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
227
|
+
default:
|
|
228
|
+
const parsedBody = parsedOutput.body;
|
|
229
|
+
throwDefaultError({
|
|
230
|
+
output,
|
|
231
|
+
parsedBody,
|
|
232
|
+
exceptionCtor: __BaseException,
|
|
233
|
+
errorCode,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
export const deserializeAws_restJson1CreateParticipantConnectionCommand = async (output, context) => {
|
|
238
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
239
|
+
return deserializeAws_restJson1CreateParticipantConnectionCommandError(output, context);
|
|
240
|
+
}
|
|
241
|
+
const contents = map({
|
|
242
|
+
$metadata: deserializeMetadata(output),
|
|
566
243
|
});
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
244
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
245
|
+
if (data.ConnectionCredentials != null) {
|
|
246
|
+
contents.ConnectionCredentials = deserializeAws_restJson1ConnectionCredentials(data.ConnectionCredentials, context);
|
|
247
|
+
}
|
|
248
|
+
if (data.Websocket != null) {
|
|
249
|
+
contents.Websocket = deserializeAws_restJson1Websocket(data.Websocket, context);
|
|
250
|
+
}
|
|
251
|
+
return contents;
|
|
252
|
+
};
|
|
253
|
+
const deserializeAws_restJson1CreateParticipantConnectionCommandError = async (output, context) => {
|
|
254
|
+
const parsedOutput = {
|
|
255
|
+
...output,
|
|
256
|
+
body: await parseErrorBody(output.body, context),
|
|
257
|
+
};
|
|
258
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
259
|
+
switch (errorCode) {
|
|
260
|
+
case "AccessDeniedException":
|
|
261
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
262
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
263
|
+
case "InternalServerException":
|
|
264
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
265
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
266
|
+
case "ThrottlingException":
|
|
267
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
268
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
269
|
+
case "ValidationException":
|
|
270
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
271
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
272
|
+
default:
|
|
273
|
+
const parsedBody = parsedOutput.body;
|
|
274
|
+
throwDefaultError({
|
|
275
|
+
output,
|
|
276
|
+
parsedBody,
|
|
277
|
+
exceptionCtor: __BaseException,
|
|
278
|
+
errorCode,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
export const deserializeAws_restJson1DisconnectParticipantCommand = async (output, context) => {
|
|
283
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
284
|
+
return deserializeAws_restJson1DisconnectParticipantCommandError(output, context);
|
|
285
|
+
}
|
|
286
|
+
const contents = map({
|
|
287
|
+
$metadata: deserializeMetadata(output),
|
|
592
288
|
});
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
exceptionCtor: __BaseException,
|
|
632
|
-
errorCode: errorCode,
|
|
633
|
-
});
|
|
634
|
-
_d.label = 11;
|
|
635
|
-
case 11: return [2];
|
|
636
|
-
}
|
|
289
|
+
await collectBody(output.body, context);
|
|
290
|
+
return contents;
|
|
291
|
+
};
|
|
292
|
+
const deserializeAws_restJson1DisconnectParticipantCommandError = async (output, context) => {
|
|
293
|
+
const parsedOutput = {
|
|
294
|
+
...output,
|
|
295
|
+
body: await parseErrorBody(output.body, context),
|
|
296
|
+
};
|
|
297
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
298
|
+
switch (errorCode) {
|
|
299
|
+
case "AccessDeniedException":
|
|
300
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
301
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
302
|
+
case "InternalServerException":
|
|
303
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
304
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
305
|
+
case "ThrottlingException":
|
|
306
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
307
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
308
|
+
case "ValidationException":
|
|
309
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
310
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
311
|
+
default:
|
|
312
|
+
const parsedBody = parsedOutput.body;
|
|
313
|
+
throwDefaultError({
|
|
314
|
+
output,
|
|
315
|
+
parsedBody,
|
|
316
|
+
exceptionCtor: __BaseException,
|
|
317
|
+
errorCode,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
export const deserializeAws_restJson1GetAttachmentCommand = async (output, context) => {
|
|
322
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
323
|
+
return deserializeAws_restJson1GetAttachmentCommandError(output, context);
|
|
324
|
+
}
|
|
325
|
+
const contents = map({
|
|
326
|
+
$metadata: deserializeMetadata(output),
|
|
637
327
|
});
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
328
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
329
|
+
if (data.Url != null) {
|
|
330
|
+
contents.Url = __expectString(data.Url);
|
|
331
|
+
}
|
|
332
|
+
if (data.UrlExpiry != null) {
|
|
333
|
+
contents.UrlExpiry = __expectString(data.UrlExpiry);
|
|
334
|
+
}
|
|
335
|
+
return contents;
|
|
336
|
+
};
|
|
337
|
+
const deserializeAws_restJson1GetAttachmentCommandError = async (output, context) => {
|
|
338
|
+
const parsedOutput = {
|
|
339
|
+
...output,
|
|
340
|
+
body: await parseErrorBody(output.body, context),
|
|
341
|
+
};
|
|
342
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
343
|
+
switch (errorCode) {
|
|
344
|
+
case "AccessDeniedException":
|
|
345
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
346
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
347
|
+
case "InternalServerException":
|
|
348
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
349
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
350
|
+
case "ThrottlingException":
|
|
351
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
352
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
353
|
+
case "ValidationException":
|
|
354
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
355
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
356
|
+
default:
|
|
357
|
+
const parsedBody = parsedOutput.body;
|
|
358
|
+
throwDefaultError({
|
|
359
|
+
output,
|
|
360
|
+
parsedBody,
|
|
361
|
+
exceptionCtor: __BaseException,
|
|
362
|
+
errorCode,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
export const deserializeAws_restJson1GetTranscriptCommand = async (output, context) => {
|
|
367
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
368
|
+
return deserializeAws_restJson1GetTranscriptCommandError(output, context);
|
|
369
|
+
}
|
|
370
|
+
const contents = map({
|
|
371
|
+
$metadata: deserializeMetadata(output),
|
|
663
372
|
});
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
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
|
-
|
|
373
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
374
|
+
if (data.InitialContactId != null) {
|
|
375
|
+
contents.InitialContactId = __expectString(data.InitialContactId);
|
|
376
|
+
}
|
|
377
|
+
if (data.NextToken != null) {
|
|
378
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
379
|
+
}
|
|
380
|
+
if (data.Transcript != null) {
|
|
381
|
+
contents.Transcript = deserializeAws_restJson1Transcript(data.Transcript, context);
|
|
382
|
+
}
|
|
383
|
+
return contents;
|
|
384
|
+
};
|
|
385
|
+
const deserializeAws_restJson1GetTranscriptCommandError = async (output, context) => {
|
|
386
|
+
const parsedOutput = {
|
|
387
|
+
...output,
|
|
388
|
+
body: await parseErrorBody(output.body, context),
|
|
389
|
+
};
|
|
390
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
391
|
+
switch (errorCode) {
|
|
392
|
+
case "AccessDeniedException":
|
|
393
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
394
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
395
|
+
case "InternalServerException":
|
|
396
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
397
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
398
|
+
case "ThrottlingException":
|
|
399
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
400
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
401
|
+
case "ValidationException":
|
|
402
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
403
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
404
|
+
default:
|
|
405
|
+
const parsedBody = parsedOutput.body;
|
|
406
|
+
throwDefaultError({
|
|
407
|
+
output,
|
|
408
|
+
parsedBody,
|
|
409
|
+
exceptionCtor: __BaseException,
|
|
410
|
+
errorCode,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
export const deserializeAws_restJson1SendEventCommand = async (output, context) => {
|
|
415
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
416
|
+
return deserializeAws_restJson1SendEventCommandError(output, context);
|
|
417
|
+
}
|
|
418
|
+
const contents = map({
|
|
419
|
+
$metadata: deserializeMetadata(output),
|
|
708
420
|
});
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
421
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
422
|
+
if (data.AbsoluteTime != null) {
|
|
423
|
+
contents.AbsoluteTime = __expectString(data.AbsoluteTime);
|
|
424
|
+
}
|
|
425
|
+
if (data.Id != null) {
|
|
426
|
+
contents.Id = __expectString(data.Id);
|
|
427
|
+
}
|
|
428
|
+
return contents;
|
|
429
|
+
};
|
|
430
|
+
const deserializeAws_restJson1SendEventCommandError = async (output, context) => {
|
|
431
|
+
const parsedOutput = {
|
|
432
|
+
...output,
|
|
433
|
+
body: await parseErrorBody(output.body, context),
|
|
434
|
+
};
|
|
435
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
436
|
+
switch (errorCode) {
|
|
437
|
+
case "AccessDeniedException":
|
|
438
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
439
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
440
|
+
case "InternalServerException":
|
|
441
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
442
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
443
|
+
case "ThrottlingException":
|
|
444
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
445
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
446
|
+
case "ValidationException":
|
|
447
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
448
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
449
|
+
default:
|
|
450
|
+
const parsedBody = parsedOutput.body;
|
|
451
|
+
throwDefaultError({
|
|
452
|
+
output,
|
|
453
|
+
parsedBody,
|
|
454
|
+
exceptionCtor: __BaseException,
|
|
455
|
+
errorCode,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
export const deserializeAws_restJson1SendMessageCommand = async (output, context) => {
|
|
460
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
461
|
+
return deserializeAws_restJson1SendMessageCommandError(output, context);
|
|
462
|
+
}
|
|
463
|
+
const contents = map({
|
|
464
|
+
$metadata: deserializeMetadata(output),
|
|
734
465
|
});
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
});
|
|
780
|
-
_d.label = 13;
|
|
781
|
-
case 13: return [2];
|
|
782
|
-
}
|
|
466
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
467
|
+
if (data.AbsoluteTime != null) {
|
|
468
|
+
contents.AbsoluteTime = __expectString(data.AbsoluteTime);
|
|
469
|
+
}
|
|
470
|
+
if (data.Id != null) {
|
|
471
|
+
contents.Id = __expectString(data.Id);
|
|
472
|
+
}
|
|
473
|
+
return contents;
|
|
474
|
+
};
|
|
475
|
+
const deserializeAws_restJson1SendMessageCommandError = async (output, context) => {
|
|
476
|
+
const parsedOutput = {
|
|
477
|
+
...output,
|
|
478
|
+
body: await parseErrorBody(output.body, context),
|
|
479
|
+
};
|
|
480
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
481
|
+
switch (errorCode) {
|
|
482
|
+
case "AccessDeniedException":
|
|
483
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
484
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
485
|
+
case "InternalServerException":
|
|
486
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
487
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
488
|
+
case "ThrottlingException":
|
|
489
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
490
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
491
|
+
case "ValidationException":
|
|
492
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
493
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
494
|
+
default:
|
|
495
|
+
const parsedBody = parsedOutput.body;
|
|
496
|
+
throwDefaultError({
|
|
497
|
+
output,
|
|
498
|
+
parsedBody,
|
|
499
|
+
exceptionCtor: __BaseException,
|
|
500
|
+
errorCode,
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
export const deserializeAws_restJson1StartAttachmentUploadCommand = async (output, context) => {
|
|
505
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
506
|
+
return deserializeAws_restJson1StartAttachmentUploadCommandError(output, context);
|
|
507
|
+
}
|
|
508
|
+
const contents = map({
|
|
509
|
+
$metadata: deserializeMetadata(output),
|
|
783
510
|
});
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
contents =
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
511
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
512
|
+
if (data.AttachmentId != null) {
|
|
513
|
+
contents.AttachmentId = __expectString(data.AttachmentId);
|
|
514
|
+
}
|
|
515
|
+
if (data.UploadMetadata != null) {
|
|
516
|
+
contents.UploadMetadata = deserializeAws_restJson1UploadMetadata(data.UploadMetadata, context);
|
|
517
|
+
}
|
|
518
|
+
return contents;
|
|
519
|
+
};
|
|
520
|
+
const deserializeAws_restJson1StartAttachmentUploadCommandError = async (output, context) => {
|
|
521
|
+
const parsedOutput = {
|
|
522
|
+
...output,
|
|
523
|
+
body: await parseErrorBody(output.body, context),
|
|
524
|
+
};
|
|
525
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
526
|
+
switch (errorCode) {
|
|
527
|
+
case "AccessDeniedException":
|
|
528
|
+
case "com.amazonaws.connectparticipant#AccessDeniedException":
|
|
529
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
530
|
+
case "InternalServerException":
|
|
531
|
+
case "com.amazonaws.connectparticipant#InternalServerException":
|
|
532
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
533
|
+
case "ServiceQuotaExceededException":
|
|
534
|
+
case "com.amazonaws.connectparticipant#ServiceQuotaExceededException":
|
|
535
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
536
|
+
case "ThrottlingException":
|
|
537
|
+
case "com.amazonaws.connectparticipant#ThrottlingException":
|
|
538
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
539
|
+
case "ValidationException":
|
|
540
|
+
case "com.amazonaws.connectparticipant#ValidationException":
|
|
541
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
542
|
+
default:
|
|
543
|
+
const parsedBody = parsedOutput.body;
|
|
544
|
+
throwDefaultError({
|
|
545
|
+
output,
|
|
546
|
+
parsedBody,
|
|
547
|
+
exceptionCtor: __BaseException,
|
|
548
|
+
errorCode,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
const map = __map;
|
|
553
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
554
|
+
const contents = map({});
|
|
555
|
+
const data = parsedOutput.body;
|
|
556
|
+
if (data.Message != null) {
|
|
557
|
+
contents.Message = __expectString(data.Message);
|
|
558
|
+
}
|
|
559
|
+
const exception = new AccessDeniedException({
|
|
560
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
561
|
+
...contents,
|
|
796
562
|
});
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
563
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
564
|
+
};
|
|
565
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
566
|
+
const contents = map({});
|
|
567
|
+
const data = parsedOutput.body;
|
|
568
|
+
if (data.Message != null) {
|
|
569
|
+
contents.Message = __expectString(data.Message);
|
|
570
|
+
}
|
|
571
|
+
const exception = new ConflictException({
|
|
572
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
573
|
+
...contents,
|
|
808
574
|
});
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
575
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
576
|
+
};
|
|
577
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
578
|
+
const contents = map({});
|
|
579
|
+
const data = parsedOutput.body;
|
|
580
|
+
if (data.Message != null) {
|
|
581
|
+
contents.Message = __expectString(data.Message);
|
|
582
|
+
}
|
|
583
|
+
const exception = new InternalServerException({
|
|
584
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
585
|
+
...contents,
|
|
820
586
|
});
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
587
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
588
|
+
};
|
|
589
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
590
|
+
const contents = map({});
|
|
591
|
+
const data = parsedOutput.body;
|
|
592
|
+
if (data.Message != null) {
|
|
593
|
+
contents.Message = __expectString(data.Message);
|
|
594
|
+
}
|
|
595
|
+
const exception = new ServiceQuotaExceededException({
|
|
596
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
597
|
+
...contents,
|
|
832
598
|
});
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
599
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
600
|
+
};
|
|
601
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
602
|
+
const contents = map({});
|
|
603
|
+
const data = parsedOutput.body;
|
|
604
|
+
if (data.Message != null) {
|
|
605
|
+
contents.Message = __expectString(data.Message);
|
|
606
|
+
}
|
|
607
|
+
const exception = new ThrottlingException({
|
|
608
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
609
|
+
...contents,
|
|
844
610
|
});
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
611
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
612
|
+
};
|
|
613
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
614
|
+
const contents = map({});
|
|
615
|
+
const data = parsedOutput.body;
|
|
616
|
+
if (data.Message != null) {
|
|
617
|
+
contents.Message = __expectString(data.Message);
|
|
618
|
+
}
|
|
619
|
+
const exception = new ValidationException({
|
|
620
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
621
|
+
...contents,
|
|
856
622
|
});
|
|
857
|
-
|
|
858
|
-
|
|
623
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
624
|
+
};
|
|
625
|
+
const serializeAws_restJson1AttachmentIdList = (input, context) => {
|
|
859
626
|
return input
|
|
860
|
-
.filter(
|
|
861
|
-
.map(
|
|
627
|
+
.filter((e) => e != null)
|
|
628
|
+
.map((entry) => {
|
|
862
629
|
return entry;
|
|
863
630
|
});
|
|
864
631
|
};
|
|
865
|
-
|
|
632
|
+
const serializeAws_restJson1ConnectionTypeList = (input, context) => {
|
|
866
633
|
return input
|
|
867
|
-
.filter(
|
|
868
|
-
.map(
|
|
634
|
+
.filter((e) => e != null)
|
|
635
|
+
.map((entry) => {
|
|
869
636
|
return entry;
|
|
870
637
|
});
|
|
871
638
|
};
|
|
872
|
-
|
|
873
|
-
return
|
|
639
|
+
const serializeAws_restJson1StartPosition = (input, context) => {
|
|
640
|
+
return {
|
|
641
|
+
...(input.AbsoluteTime != null && { AbsoluteTime: input.AbsoluteTime }),
|
|
642
|
+
...(input.Id != null && { Id: input.Id }),
|
|
643
|
+
...(input.MostRecent != null && { MostRecent: input.MostRecent }),
|
|
644
|
+
};
|
|
874
645
|
};
|
|
875
|
-
|
|
646
|
+
const deserializeAws_restJson1AttachmentItem = (output, context) => {
|
|
876
647
|
return {
|
|
877
648
|
AttachmentId: __expectString(output.AttachmentId),
|
|
878
649
|
AttachmentName: __expectString(output.AttachmentName),
|
|
@@ -880,10 +651,10 @@ var deserializeAws_restJson1AttachmentItem = function (output, context) {
|
|
|
880
651
|
Status: __expectString(output.Status),
|
|
881
652
|
};
|
|
882
653
|
};
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
.filter(
|
|
886
|
-
.map(
|
|
654
|
+
const deserializeAws_restJson1Attachments = (output, context) => {
|
|
655
|
+
const retVal = (output || [])
|
|
656
|
+
.filter((e) => e != null)
|
|
657
|
+
.map((entry) => {
|
|
887
658
|
if (entry === null) {
|
|
888
659
|
return null;
|
|
889
660
|
}
|
|
@@ -891,13 +662,13 @@ var deserializeAws_restJson1Attachments = function (output, context) {
|
|
|
891
662
|
});
|
|
892
663
|
return retVal;
|
|
893
664
|
};
|
|
894
|
-
|
|
665
|
+
const deserializeAws_restJson1ConnectionCredentials = (output, context) => {
|
|
895
666
|
return {
|
|
896
667
|
ConnectionToken: __expectString(output.ConnectionToken),
|
|
897
668
|
Expiry: __expectString(output.Expiry),
|
|
898
669
|
};
|
|
899
670
|
};
|
|
900
|
-
|
|
671
|
+
const deserializeAws_restJson1Item = (output, context) => {
|
|
901
672
|
return {
|
|
902
673
|
AbsoluteTime: __expectString(output.AbsoluteTime),
|
|
903
674
|
Attachments: output.Attachments != null ? deserializeAws_restJson1Attachments(output.Attachments, context) : undefined,
|
|
@@ -910,10 +681,10 @@ var deserializeAws_restJson1Item = function (output, context) {
|
|
|
910
681
|
Type: __expectString(output.Type),
|
|
911
682
|
};
|
|
912
683
|
};
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
.filter(
|
|
916
|
-
.map(
|
|
684
|
+
const deserializeAws_restJson1Transcript = (output, context) => {
|
|
685
|
+
const retVal = (output || [])
|
|
686
|
+
.filter((e) => e != null)
|
|
687
|
+
.map((entry) => {
|
|
917
688
|
if (entry === null) {
|
|
918
689
|
return null;
|
|
919
690
|
}
|
|
@@ -921,7 +692,7 @@ var deserializeAws_restJson1Transcript = function (output, context) {
|
|
|
921
692
|
});
|
|
922
693
|
return retVal;
|
|
923
694
|
};
|
|
924
|
-
|
|
695
|
+
const deserializeAws_restJson1UploadMetadata = (output, context) => {
|
|
925
696
|
return {
|
|
926
697
|
HeadersToInclude: output.HeadersToInclude != null
|
|
927
698
|
? deserializeAws_restJson1UploadMetadataSignedHeaders(output.HeadersToInclude, context)
|
|
@@ -930,73 +701,56 @@ var deserializeAws_restJson1UploadMetadata = function (output, context) {
|
|
|
930
701
|
UrlExpiry: __expectString(output.UrlExpiry),
|
|
931
702
|
};
|
|
932
703
|
};
|
|
933
|
-
|
|
934
|
-
return Object.entries(output).reduce(
|
|
935
|
-
var _b;
|
|
936
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
704
|
+
const deserializeAws_restJson1UploadMetadataSignedHeaders = (output, context) => {
|
|
705
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
937
706
|
if (value === null) {
|
|
938
707
|
return acc;
|
|
939
708
|
}
|
|
940
|
-
return
|
|
709
|
+
return {
|
|
710
|
+
...acc,
|
|
711
|
+
[key]: __expectString(value),
|
|
712
|
+
};
|
|
941
713
|
}, {});
|
|
942
714
|
};
|
|
943
|
-
|
|
715
|
+
const deserializeAws_restJson1Websocket = (output, context) => {
|
|
944
716
|
return {
|
|
945
717
|
ConnectionExpiry: __expectString(output.ConnectionExpiry),
|
|
946
718
|
Url: __expectString(output.Url),
|
|
947
719
|
};
|
|
948
720
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
});
|
|
957
|
-
};
|
|
958
|
-
var collectBody = function (streamBody, context) {
|
|
959
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
721
|
+
const deserializeMetadata = (output) => ({
|
|
722
|
+
httpStatusCode: output.statusCode,
|
|
723
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
724
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
725
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
726
|
+
});
|
|
727
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
960
728
|
if (streamBody instanceof Uint8Array) {
|
|
961
729
|
return Promise.resolve(streamBody);
|
|
962
730
|
}
|
|
963
731
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
964
732
|
};
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
});
|
|
733
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
734
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
735
|
+
value !== null &&
|
|
736
|
+
value !== "" &&
|
|
737
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
738
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
739
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
740
|
+
if (encoded.length) {
|
|
741
|
+
return JSON.parse(encoded);
|
|
742
|
+
}
|
|
743
|
+
return {};
|
|
744
|
+
});
|
|
745
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
746
|
+
const value = await parseBody(errorBody, context);
|
|
747
|
+
value.message = value.message ?? value.Message;
|
|
748
|
+
return value;
|
|
982
749
|
};
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
switch (_b.label) {
|
|
988
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
989
|
-
case 1:
|
|
990
|
-
value = _b.sent();
|
|
991
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
992
|
-
return [2, value];
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
}); };
|
|
996
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
997
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
998
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
999
|
-
var cleanValue = rawValue;
|
|
750
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
751
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
752
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
753
|
+
let cleanValue = rawValue;
|
|
1000
754
|
if (typeof cleanValue === "number") {
|
|
1001
755
|
cleanValue = cleanValue.toString();
|
|
1002
756
|
}
|
|
@@ -1011,7 +765,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
1011
765
|
}
|
|
1012
766
|
return cleanValue;
|
|
1013
767
|
};
|
|
1014
|
-
|
|
768
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1015
769
|
if (headerKey !== undefined) {
|
|
1016
770
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1017
771
|
}
|