@aws-sdk/client-voice-id 3.186.0 → 3.190.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist-es/VoiceID.js +86 -93
  3. package/dist-es/VoiceIDClient.js +22 -28
  4. package/dist-es/commands/CreateDomainCommand.js +21 -28
  5. package/dist-es/commands/DeleteDomainCommand.js +22 -29
  6. package/dist-es/commands/DeleteFraudsterCommand.js +22 -29
  7. package/dist-es/commands/DeleteSpeakerCommand.js +22 -29
  8. package/dist-es/commands/DescribeDomainCommand.js +21 -28
  9. package/dist-es/commands/DescribeFraudsterCommand.js +21 -28
  10. package/dist-es/commands/DescribeFraudsterRegistrationJobCommand.js +21 -28
  11. package/dist-es/commands/DescribeSpeakerCommand.js +21 -28
  12. package/dist-es/commands/DescribeSpeakerEnrollmentJobCommand.js +21 -28
  13. package/dist-es/commands/EvaluateSessionCommand.js +21 -28
  14. package/dist-es/commands/ListDomainsCommand.js +21 -28
  15. package/dist-es/commands/ListFraudsterRegistrationJobsCommand.js +21 -28
  16. package/dist-es/commands/ListSpeakerEnrollmentJobsCommand.js +21 -28
  17. package/dist-es/commands/ListSpeakersCommand.js +21 -28
  18. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  19. package/dist-es/commands/OptOutSpeakerCommand.js +21 -28
  20. package/dist-es/commands/StartFraudsterRegistrationJobCommand.js +21 -28
  21. package/dist-es/commands/StartSpeakerEnrollmentJobCommand.js +21 -28
  22. package/dist-es/commands/TagResourceCommand.js +21 -28
  23. package/dist-es/commands/UntagResourceCommand.js +21 -28
  24. package/dist-es/commands/UpdateDomainCommand.js +21 -28
  25. package/dist-es/endpoints.js +8 -8
  26. package/dist-es/models/VoiceIDServiceException.js +5 -10
  27. package/dist-es/models/models_0.js +333 -162
  28. package/dist-es/pagination/ListDomainsPaginator.js +25 -68
  29. package/dist-es/pagination/ListFraudsterRegistrationJobsPaginator.js +25 -68
  30. package/dist-es/pagination/ListSpeakerEnrollmentJobsPaginator.js +25 -68
  31. package/dist-es/pagination/ListSpeakersPaginator.js +25 -68
  32. package/dist-es/protocols/Aws_json1_0.js +1529 -1984
  33. package/dist-es/runtimeConfig.browser.js +26 -12
  34. package/dist-es/runtimeConfig.js +30 -12
  35. package/dist-es/runtimeConfig.native.js +8 -5
  36. package/dist-es/runtimeConfig.shared.js +8 -11
  37. package/package.json +33 -33
@@ -1,1900 +1,1468 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
5
  import { VoiceIDServiceException as __BaseException } from "../models/VoiceIDServiceException";
7
- export var serializeAws_json1_0CreateDomainCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var headers, body;
9
- return __generator(this, function (_a) {
10
- headers = {
11
- "content-type": "application/x-amz-json-1.0",
12
- "x-amz-target": "VoiceID.CreateDomain",
13
- };
14
- body = JSON.stringify(serializeAws_json1_0CreateDomainRequest(input, context));
15
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
16
- });
17
- }); };
18
- export var serializeAws_json1_0DeleteDomainCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
19
- var headers, body;
20
- return __generator(this, function (_a) {
21
- headers = {
22
- "content-type": "application/x-amz-json-1.0",
23
- "x-amz-target": "VoiceID.DeleteDomain",
24
- };
25
- body = JSON.stringify(serializeAws_json1_0DeleteDomainRequest(input, context));
26
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
27
- });
28
- }); };
29
- export var serializeAws_json1_0DeleteFraudsterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
30
- var headers, body;
31
- return __generator(this, function (_a) {
32
- headers = {
33
- "content-type": "application/x-amz-json-1.0",
34
- "x-amz-target": "VoiceID.DeleteFraudster",
35
- };
36
- body = JSON.stringify(serializeAws_json1_0DeleteFraudsterRequest(input, context));
37
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
38
- });
39
- }); };
40
- export var serializeAws_json1_0DeleteSpeakerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
41
- var headers, body;
42
- return __generator(this, function (_a) {
43
- headers = {
44
- "content-type": "application/x-amz-json-1.0",
45
- "x-amz-target": "VoiceID.DeleteSpeaker",
46
- };
47
- body = JSON.stringify(serializeAws_json1_0DeleteSpeakerRequest(input, context));
48
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
49
- });
50
- }); };
51
- export var serializeAws_json1_0DescribeDomainCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
52
- var headers, body;
53
- return __generator(this, function (_a) {
54
- headers = {
55
- "content-type": "application/x-amz-json-1.0",
56
- "x-amz-target": "VoiceID.DescribeDomain",
57
- };
58
- body = JSON.stringify(serializeAws_json1_0DescribeDomainRequest(input, context));
59
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
60
- });
61
- }); };
62
- export var serializeAws_json1_0DescribeFraudsterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
63
- var headers, body;
64
- return __generator(this, function (_a) {
65
- headers = {
66
- "content-type": "application/x-amz-json-1.0",
67
- "x-amz-target": "VoiceID.DescribeFraudster",
68
- };
69
- body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRequest(input, context));
70
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
71
- });
72
- }); };
73
- export var serializeAws_json1_0DescribeFraudsterRegistrationJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
74
- var headers, body;
75
- return __generator(this, function (_a) {
76
- headers = {
77
- "content-type": "application/x-amz-json-1.0",
78
- "x-amz-target": "VoiceID.DescribeFraudsterRegistrationJob",
79
- };
80
- body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRegistrationJobRequest(input, context));
81
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
82
- });
83
- }); };
84
- export var serializeAws_json1_0DescribeSpeakerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
85
- var headers, body;
86
- return __generator(this, function (_a) {
87
- headers = {
88
- "content-type": "application/x-amz-json-1.0",
89
- "x-amz-target": "VoiceID.DescribeSpeaker",
90
- };
91
- body = JSON.stringify(serializeAws_json1_0DescribeSpeakerRequest(input, context));
92
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
93
- });
94
- }); };
95
- export var serializeAws_json1_0DescribeSpeakerEnrollmentJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
96
- var headers, body;
97
- return __generator(this, function (_a) {
98
- headers = {
99
- "content-type": "application/x-amz-json-1.0",
100
- "x-amz-target": "VoiceID.DescribeSpeakerEnrollmentJob",
101
- };
102
- body = JSON.stringify(serializeAws_json1_0DescribeSpeakerEnrollmentJobRequest(input, context));
103
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
104
- });
105
- }); };
106
- export var serializeAws_json1_0EvaluateSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
- var headers, body;
108
- return __generator(this, function (_a) {
109
- headers = {
110
- "content-type": "application/x-amz-json-1.0",
111
- "x-amz-target": "VoiceID.EvaluateSession",
112
- };
113
- body = JSON.stringify(serializeAws_json1_0EvaluateSessionRequest(input, context));
114
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
115
- });
116
- }); };
117
- export var serializeAws_json1_0ListDomainsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
118
- var headers, body;
119
- return __generator(this, function (_a) {
120
- headers = {
121
- "content-type": "application/x-amz-json-1.0",
122
- "x-amz-target": "VoiceID.ListDomains",
123
- };
124
- body = JSON.stringify(serializeAws_json1_0ListDomainsRequest(input, context));
125
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
126
- });
127
- }); };
128
- export var serializeAws_json1_0ListFraudsterRegistrationJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
- var headers, body;
130
- return __generator(this, function (_a) {
131
- headers = {
132
- "content-type": "application/x-amz-json-1.0",
133
- "x-amz-target": "VoiceID.ListFraudsterRegistrationJobs",
134
- };
135
- body = JSON.stringify(serializeAws_json1_0ListFraudsterRegistrationJobsRequest(input, context));
136
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
137
- });
138
- }); };
139
- export var serializeAws_json1_0ListSpeakerEnrollmentJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
- var headers, body;
141
- return __generator(this, function (_a) {
142
- headers = {
143
- "content-type": "application/x-amz-json-1.0",
144
- "x-amz-target": "VoiceID.ListSpeakerEnrollmentJobs",
145
- };
146
- body = JSON.stringify(serializeAws_json1_0ListSpeakerEnrollmentJobsRequest(input, context));
147
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
148
- });
149
- }); };
150
- export var serializeAws_json1_0ListSpeakersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
151
- var headers, body;
152
- return __generator(this, function (_a) {
153
- headers = {
154
- "content-type": "application/x-amz-json-1.0",
155
- "x-amz-target": "VoiceID.ListSpeakers",
156
- };
157
- body = JSON.stringify(serializeAws_json1_0ListSpeakersRequest(input, context));
158
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
159
- });
160
- }); };
161
- export var serializeAws_json1_0ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
162
- var headers, body;
163
- return __generator(this, function (_a) {
164
- headers = {
165
- "content-type": "application/x-amz-json-1.0",
166
- "x-amz-target": "VoiceID.ListTagsForResource",
167
- };
168
- body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
169
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
170
- });
171
- }); };
172
- export var serializeAws_json1_0OptOutSpeakerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
173
- var headers, body;
174
- return __generator(this, function (_a) {
175
- headers = {
176
- "content-type": "application/x-amz-json-1.0",
177
- "x-amz-target": "VoiceID.OptOutSpeaker",
178
- };
179
- body = JSON.stringify(serializeAws_json1_0OptOutSpeakerRequest(input, context));
180
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
181
- });
182
- }); };
183
- export var serializeAws_json1_0StartFraudsterRegistrationJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
184
- var headers, body;
185
- return __generator(this, function (_a) {
186
- headers = {
187
- "content-type": "application/x-amz-json-1.0",
188
- "x-amz-target": "VoiceID.StartFraudsterRegistrationJob",
189
- };
190
- body = JSON.stringify(serializeAws_json1_0StartFraudsterRegistrationJobRequest(input, context));
191
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
192
- });
193
- }); };
194
- export var serializeAws_json1_0StartSpeakerEnrollmentJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
195
- var headers, body;
196
- return __generator(this, function (_a) {
197
- headers = {
198
- "content-type": "application/x-amz-json-1.0",
199
- "x-amz-target": "VoiceID.StartSpeakerEnrollmentJob",
200
- };
201
- body = JSON.stringify(serializeAws_json1_0StartSpeakerEnrollmentJobRequest(input, context));
202
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
203
- });
204
- }); };
205
- export var serializeAws_json1_0TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
206
- var headers, body;
207
- return __generator(this, function (_a) {
208
- headers = {
209
- "content-type": "application/x-amz-json-1.0",
210
- "x-amz-target": "VoiceID.TagResource",
211
- };
212
- body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
213
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
214
- });
215
- }); };
216
- export var serializeAws_json1_0UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
217
- var headers, body;
218
- return __generator(this, function (_a) {
219
- headers = {
220
- "content-type": "application/x-amz-json-1.0",
221
- "x-amz-target": "VoiceID.UntagResource",
222
- };
223
- body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
224
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
225
- });
226
- }); };
227
- export var serializeAws_json1_0UpdateDomainCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
228
- var headers, body;
229
- return __generator(this, function (_a) {
230
- headers = {
231
- "content-type": "application/x-amz-json-1.0",
232
- "x-amz-target": "VoiceID.UpdateDomain",
233
- };
234
- body = JSON.stringify(serializeAws_json1_0UpdateDomainRequest(input, context));
235
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
236
- });
237
- }); };
238
- export var deserializeAws_json1_0CreateDomainCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
239
- var data, contents, response;
240
- return __generator(this, function (_a) {
241
- switch (_a.label) {
242
- case 0:
243
- if (output.statusCode >= 300) {
244
- return [2, deserializeAws_json1_0CreateDomainCommandError(output, context)];
245
- }
246
- return [4, parseBody(output.body, context)];
247
- case 1:
248
- data = _a.sent();
249
- contents = {};
250
- contents = deserializeAws_json1_0CreateDomainResponse(data, context);
251
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
252
- return [2, Promise.resolve(response)];
253
- }
254
- });
255
- }); };
256
- var deserializeAws_json1_0CreateDomainCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
257
- var parsedOutput, _a, errorCode, _b, parsedBody;
258
- var _c;
259
- return __generator(this, function (_d) {
260
- switch (_d.label) {
261
- case 0:
262
- _a = [__assign({}, output)];
263
- _c = {};
264
- return [4, parseErrorBody(output.body, context)];
265
- case 1:
266
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
267
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
268
- _b = errorCode;
269
- switch (_b) {
270
- case "AccessDeniedException": return [3, 2];
271
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
272
- case "ConflictException": return [3, 4];
273
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
274
- case "InternalServerException": return [3, 6];
275
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
276
- case "ResourceNotFoundException": return [3, 8];
277
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
278
- case "ServiceQuotaExceededException": return [3, 10];
279
- case "com.amazonaws.voiceid#ServiceQuotaExceededException": return [3, 10];
280
- case "ThrottlingException": return [3, 12];
281
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 12];
282
- case "ValidationException": return [3, 14];
283
- case "com.amazonaws.voiceid#ValidationException": return [3, 14];
284
- }
285
- return [3, 16];
286
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
287
- case 3: throw _d.sent();
288
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
289
- case 5: throw _d.sent();
290
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
291
- case 7: throw _d.sent();
292
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
293
- case 9: throw _d.sent();
294
- case 10: return [4, deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
295
- case 11: throw _d.sent();
296
- case 12: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
297
- case 13: throw _d.sent();
298
- case 14: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
299
- case 15: throw _d.sent();
300
- case 16:
301
- parsedBody = parsedOutput.body;
302
- throwDefaultError({
303
- output: output,
304
- parsedBody: parsedBody,
305
- exceptionCtor: __BaseException,
306
- errorCode: errorCode,
307
- });
308
- _d.label = 17;
309
- case 17: return [2];
310
- }
311
- });
312
- }); };
313
- export var deserializeAws_json1_0DeleteDomainCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
314
- var response;
315
- return __generator(this, function (_a) {
316
- switch (_a.label) {
317
- case 0:
318
- if (output.statusCode >= 300) {
319
- return [2, deserializeAws_json1_0DeleteDomainCommandError(output, context)];
320
- }
321
- return [4, collectBody(output.body, context)];
322
- case 1:
323
- _a.sent();
324
- response = {
325
- $metadata: deserializeMetadata(output),
326
- };
327
- return [2, Promise.resolve(response)];
328
- }
329
- });
330
- }); };
331
- var deserializeAws_json1_0DeleteDomainCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
332
- var parsedOutput, _a, errorCode, _b, parsedBody;
333
- var _c;
334
- return __generator(this, function (_d) {
335
- switch (_d.label) {
336
- case 0:
337
- _a = [__assign({}, output)];
338
- _c = {};
339
- return [4, parseErrorBody(output.body, context)];
340
- case 1:
341
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
342
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
343
- _b = errorCode;
344
- switch (_b) {
345
- case "AccessDeniedException": return [3, 2];
346
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
347
- case "ConflictException": return [3, 4];
348
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
349
- case "InternalServerException": return [3, 6];
350
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
351
- case "ResourceNotFoundException": return [3, 8];
352
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
353
- case "ThrottlingException": return [3, 10];
354
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
355
- case "ValidationException": return [3, 12];
356
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
357
- }
358
- return [3, 14];
359
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
360
- case 3: throw _d.sent();
361
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
362
- case 5: throw _d.sent();
363
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
364
- case 7: throw _d.sent();
365
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
366
- case 9: throw _d.sent();
367
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
368
- case 11: throw _d.sent();
369
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
370
- case 13: throw _d.sent();
371
- case 14:
372
- parsedBody = parsedOutput.body;
373
- throwDefaultError({
374
- output: output,
375
- parsedBody: parsedBody,
376
- exceptionCtor: __BaseException,
377
- errorCode: errorCode,
378
- });
379
- _d.label = 15;
380
- case 15: return [2];
381
- }
382
- });
383
- }); };
384
- export var deserializeAws_json1_0DeleteFraudsterCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
385
- var response;
386
- return __generator(this, function (_a) {
387
- switch (_a.label) {
388
- case 0:
389
- if (output.statusCode >= 300) {
390
- return [2, deserializeAws_json1_0DeleteFraudsterCommandError(output, context)];
391
- }
392
- return [4, collectBody(output.body, context)];
393
- case 1:
394
- _a.sent();
395
- response = {
396
- $metadata: deserializeMetadata(output),
397
- };
398
- return [2, Promise.resolve(response)];
399
- }
400
- });
401
- }); };
402
- var deserializeAws_json1_0DeleteFraudsterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
403
- var parsedOutput, _a, errorCode, _b, parsedBody;
404
- var _c;
405
- return __generator(this, function (_d) {
406
- switch (_d.label) {
407
- case 0:
408
- _a = [__assign({}, output)];
409
- _c = {};
410
- return [4, parseErrorBody(output.body, context)];
411
- case 1:
412
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
413
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
414
- _b = errorCode;
415
- switch (_b) {
416
- case "AccessDeniedException": return [3, 2];
417
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
418
- case "ConflictException": return [3, 4];
419
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
420
- case "InternalServerException": return [3, 6];
421
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
422
- case "ResourceNotFoundException": return [3, 8];
423
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
424
- case "ThrottlingException": return [3, 10];
425
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
426
- case "ValidationException": return [3, 12];
427
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
428
- }
429
- return [3, 14];
430
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
431
- case 3: throw _d.sent();
432
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
433
- case 5: throw _d.sent();
434
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
435
- case 7: throw _d.sent();
436
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
437
- case 9: throw _d.sent();
438
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
439
- case 11: throw _d.sent();
440
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
441
- case 13: throw _d.sent();
442
- case 14:
443
- parsedBody = parsedOutput.body;
444
- throwDefaultError({
445
- output: output,
446
- parsedBody: parsedBody,
447
- exceptionCtor: __BaseException,
448
- errorCode: errorCode,
449
- });
450
- _d.label = 15;
451
- case 15: return [2];
452
- }
453
- });
454
- }); };
455
- export var deserializeAws_json1_0DeleteSpeakerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
456
- var response;
457
- return __generator(this, function (_a) {
458
- switch (_a.label) {
459
- case 0:
460
- if (output.statusCode >= 300) {
461
- return [2, deserializeAws_json1_0DeleteSpeakerCommandError(output, context)];
462
- }
463
- return [4, collectBody(output.body, context)];
464
- case 1:
465
- _a.sent();
466
- response = {
467
- $metadata: deserializeMetadata(output),
468
- };
469
- return [2, Promise.resolve(response)];
470
- }
471
- });
472
- }); };
473
- var deserializeAws_json1_0DeleteSpeakerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
474
- var parsedOutput, _a, errorCode, _b, parsedBody;
475
- var _c;
476
- return __generator(this, function (_d) {
477
- switch (_d.label) {
478
- case 0:
479
- _a = [__assign({}, output)];
480
- _c = {};
481
- return [4, parseErrorBody(output.body, context)];
482
- case 1:
483
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
484
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
485
- _b = errorCode;
486
- switch (_b) {
487
- case "AccessDeniedException": return [3, 2];
488
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
489
- case "ConflictException": return [3, 4];
490
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
491
- case "InternalServerException": return [3, 6];
492
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
493
- case "ResourceNotFoundException": return [3, 8];
494
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
495
- case "ThrottlingException": return [3, 10];
496
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
497
- case "ValidationException": return [3, 12];
498
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
499
- }
500
- return [3, 14];
501
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
502
- case 3: throw _d.sent();
503
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
504
- case 5: throw _d.sent();
505
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
506
- case 7: throw _d.sent();
507
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
508
- case 9: throw _d.sent();
509
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
510
- case 11: throw _d.sent();
511
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
512
- case 13: throw _d.sent();
513
- case 14:
514
- parsedBody = parsedOutput.body;
515
- throwDefaultError({
516
- output: output,
517
- parsedBody: parsedBody,
518
- exceptionCtor: __BaseException,
519
- errorCode: errorCode,
520
- });
521
- _d.label = 15;
522
- case 15: return [2];
523
- }
524
- });
525
- }); };
526
- export var deserializeAws_json1_0DescribeDomainCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
527
- var data, contents, response;
528
- return __generator(this, function (_a) {
529
- switch (_a.label) {
530
- case 0:
531
- if (output.statusCode >= 300) {
532
- return [2, deserializeAws_json1_0DescribeDomainCommandError(output, context)];
533
- }
534
- return [4, parseBody(output.body, context)];
535
- case 1:
536
- data = _a.sent();
537
- contents = {};
538
- contents = deserializeAws_json1_0DescribeDomainResponse(data, context);
539
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
540
- return [2, Promise.resolve(response)];
541
- }
542
- });
543
- }); };
544
- var deserializeAws_json1_0DescribeDomainCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
545
- var parsedOutput, _a, errorCode, _b, parsedBody;
546
- var _c;
547
- return __generator(this, function (_d) {
548
- switch (_d.label) {
549
- case 0:
550
- _a = [__assign({}, output)];
551
- _c = {};
552
- return [4, parseErrorBody(output.body, context)];
553
- case 1:
554
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
555
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
556
- _b = errorCode;
557
- switch (_b) {
558
- case "AccessDeniedException": return [3, 2];
559
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
560
- case "InternalServerException": return [3, 4];
561
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
562
- case "ResourceNotFoundException": return [3, 6];
563
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
564
- case "ThrottlingException": return [3, 8];
565
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
566
- case "ValidationException": return [3, 10];
567
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
568
- }
569
- return [3, 12];
570
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
571
- case 3: throw _d.sent();
572
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
573
- case 5: throw _d.sent();
574
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
575
- case 7: throw _d.sent();
576
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
577
- case 9: throw _d.sent();
578
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
579
- case 11: throw _d.sent();
580
- case 12:
581
- parsedBody = parsedOutput.body;
582
- throwDefaultError({
583
- output: output,
584
- parsedBody: parsedBody,
585
- exceptionCtor: __BaseException,
586
- errorCode: errorCode,
587
- });
588
- _d.label = 13;
589
- case 13: return [2];
590
- }
591
- });
592
- }); };
593
- export var deserializeAws_json1_0DescribeFraudsterCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
594
- var data, contents, response;
595
- return __generator(this, function (_a) {
596
- switch (_a.label) {
597
- case 0:
598
- if (output.statusCode >= 300) {
599
- return [2, deserializeAws_json1_0DescribeFraudsterCommandError(output, context)];
600
- }
601
- return [4, parseBody(output.body, context)];
602
- case 1:
603
- data = _a.sent();
604
- contents = {};
605
- contents = deserializeAws_json1_0DescribeFraudsterResponse(data, context);
606
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
607
- return [2, Promise.resolve(response)];
608
- }
609
- });
610
- }); };
611
- var deserializeAws_json1_0DescribeFraudsterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
612
- var parsedOutput, _a, errorCode, _b, parsedBody;
613
- var _c;
614
- return __generator(this, function (_d) {
615
- switch (_d.label) {
616
- case 0:
617
- _a = [__assign({}, output)];
618
- _c = {};
619
- return [4, parseErrorBody(output.body, context)];
620
- case 1:
621
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
622
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
623
- _b = errorCode;
624
- switch (_b) {
625
- case "AccessDeniedException": return [3, 2];
626
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
627
- case "InternalServerException": return [3, 4];
628
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
629
- case "ResourceNotFoundException": return [3, 6];
630
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
631
- case "ThrottlingException": return [3, 8];
632
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
633
- case "ValidationException": return [3, 10];
634
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
635
- }
636
- return [3, 12];
637
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
638
- case 3: throw _d.sent();
639
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
640
- case 5: throw _d.sent();
641
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
642
- case 7: throw _d.sent();
643
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
644
- case 9: throw _d.sent();
645
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
646
- case 11: throw _d.sent();
647
- case 12:
648
- parsedBody = parsedOutput.body;
649
- throwDefaultError({
650
- output: output,
651
- parsedBody: parsedBody,
652
- exceptionCtor: __BaseException,
653
- errorCode: errorCode,
654
- });
655
- _d.label = 13;
656
- case 13: return [2];
657
- }
658
- });
659
- }); };
660
- export var deserializeAws_json1_0DescribeFraudsterRegistrationJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
661
- var data, contents, response;
662
- return __generator(this, function (_a) {
663
- switch (_a.label) {
664
- case 0:
665
- if (output.statusCode >= 300) {
666
- return [2, deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError(output, context)];
667
- }
668
- return [4, parseBody(output.body, context)];
669
- case 1:
670
- data = _a.sent();
671
- contents = {};
672
- contents = deserializeAws_json1_0DescribeFraudsterRegistrationJobResponse(data, context);
673
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
674
- return [2, Promise.resolve(response)];
675
- }
676
- });
677
- }); };
678
- var deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
679
- var parsedOutput, _a, errorCode, _b, parsedBody;
680
- var _c;
681
- return __generator(this, function (_d) {
682
- switch (_d.label) {
683
- case 0:
684
- _a = [__assign({}, output)];
685
- _c = {};
686
- return [4, parseErrorBody(output.body, context)];
687
- case 1:
688
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
689
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
- _b = errorCode;
691
- switch (_b) {
692
- case "AccessDeniedException": return [3, 2];
693
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
694
- case "InternalServerException": return [3, 4];
695
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
696
- case "ResourceNotFoundException": return [3, 6];
697
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
698
- case "ThrottlingException": return [3, 8];
699
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
700
- case "ValidationException": return [3, 10];
701
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
702
- }
703
- return [3, 12];
704
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
705
- case 3: throw _d.sent();
706
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
707
- case 5: throw _d.sent();
708
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
709
- case 7: throw _d.sent();
710
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
711
- case 9: throw _d.sent();
712
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
713
- case 11: throw _d.sent();
714
- case 12:
715
- parsedBody = parsedOutput.body;
716
- throwDefaultError({
717
- output: output,
718
- parsedBody: parsedBody,
719
- exceptionCtor: __BaseException,
720
- errorCode: errorCode,
721
- });
722
- _d.label = 13;
723
- case 13: return [2];
724
- }
725
- });
726
- }); };
727
- export var deserializeAws_json1_0DescribeSpeakerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
728
- var data, contents, response;
729
- return __generator(this, function (_a) {
730
- switch (_a.label) {
731
- case 0:
732
- if (output.statusCode >= 300) {
733
- return [2, deserializeAws_json1_0DescribeSpeakerCommandError(output, context)];
734
- }
735
- return [4, parseBody(output.body, context)];
736
- case 1:
737
- data = _a.sent();
738
- contents = {};
739
- contents = deserializeAws_json1_0DescribeSpeakerResponse(data, context);
740
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
741
- return [2, Promise.resolve(response)];
742
- }
743
- });
744
- }); };
745
- var deserializeAws_json1_0DescribeSpeakerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
746
- var parsedOutput, _a, errorCode, _b, parsedBody;
747
- var _c;
748
- return __generator(this, function (_d) {
749
- switch (_d.label) {
750
- case 0:
751
- _a = [__assign({}, output)];
752
- _c = {};
753
- return [4, parseErrorBody(output.body, context)];
754
- case 1:
755
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
756
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
757
- _b = errorCode;
758
- switch (_b) {
759
- case "AccessDeniedException": return [3, 2];
760
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
761
- case "InternalServerException": return [3, 4];
762
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
763
- case "ResourceNotFoundException": return [3, 6];
764
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
765
- case "ThrottlingException": return [3, 8];
766
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
767
- case "ValidationException": return [3, 10];
768
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
769
- }
770
- return [3, 12];
771
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
772
- case 3: throw _d.sent();
773
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
774
- case 5: throw _d.sent();
775
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
776
- case 7: throw _d.sent();
777
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
778
- case 9: throw _d.sent();
779
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
780
- case 11: throw _d.sent();
781
- case 12:
782
- parsedBody = parsedOutput.body;
783
- throwDefaultError({
784
- output: output,
785
- parsedBody: parsedBody,
786
- exceptionCtor: __BaseException,
787
- errorCode: errorCode,
788
- });
789
- _d.label = 13;
790
- case 13: return [2];
791
- }
792
- });
793
- }); };
794
- export var deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
795
- var data, contents, response;
796
- return __generator(this, function (_a) {
797
- switch (_a.label) {
798
- case 0:
799
- if (output.statusCode >= 300) {
800
- return [2, deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError(output, context)];
801
- }
802
- return [4, parseBody(output.body, context)];
803
- case 1:
804
- data = _a.sent();
805
- contents = {};
806
- contents = deserializeAws_json1_0DescribeSpeakerEnrollmentJobResponse(data, context);
807
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
808
- return [2, Promise.resolve(response)];
809
- }
810
- });
811
- }); };
812
- var deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
813
- var parsedOutput, _a, errorCode, _b, parsedBody;
814
- var _c;
815
- return __generator(this, function (_d) {
816
- switch (_d.label) {
817
- case 0:
818
- _a = [__assign({}, output)];
819
- _c = {};
820
- return [4, parseErrorBody(output.body, context)];
821
- case 1:
822
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
823
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
824
- _b = errorCode;
825
- switch (_b) {
826
- case "AccessDeniedException": return [3, 2];
827
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
828
- case "InternalServerException": return [3, 4];
829
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
830
- case "ResourceNotFoundException": return [3, 6];
831
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
832
- case "ThrottlingException": return [3, 8];
833
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
834
- case "ValidationException": return [3, 10];
835
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
836
- }
837
- return [3, 12];
838
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
839
- case 3: throw _d.sent();
840
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
841
- case 5: throw _d.sent();
842
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
843
- case 7: throw _d.sent();
844
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
845
- case 9: throw _d.sent();
846
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
847
- case 11: throw _d.sent();
848
- case 12:
849
- parsedBody = parsedOutput.body;
850
- throwDefaultError({
851
- output: output,
852
- parsedBody: parsedBody,
853
- exceptionCtor: __BaseException,
854
- errorCode: errorCode,
855
- });
856
- _d.label = 13;
857
- case 13: return [2];
858
- }
859
- });
860
- }); };
861
- export var deserializeAws_json1_0EvaluateSessionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
862
- var data, contents, response;
863
- return __generator(this, function (_a) {
864
- switch (_a.label) {
865
- case 0:
866
- if (output.statusCode >= 300) {
867
- return [2, deserializeAws_json1_0EvaluateSessionCommandError(output, context)];
868
- }
869
- return [4, parseBody(output.body, context)];
870
- case 1:
871
- data = _a.sent();
872
- contents = {};
873
- contents = deserializeAws_json1_0EvaluateSessionResponse(data, context);
874
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
875
- return [2, Promise.resolve(response)];
876
- }
877
- });
878
- }); };
879
- var deserializeAws_json1_0EvaluateSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
880
- var parsedOutput, _a, errorCode, _b, parsedBody;
881
- var _c;
882
- return __generator(this, function (_d) {
883
- switch (_d.label) {
884
- case 0:
885
- _a = [__assign({}, output)];
886
- _c = {};
887
- return [4, parseErrorBody(output.body, context)];
888
- case 1:
889
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
890
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
891
- _b = errorCode;
892
- switch (_b) {
893
- case "AccessDeniedException": return [3, 2];
894
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
895
- case "ConflictException": return [3, 4];
896
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
897
- case "InternalServerException": return [3, 6];
898
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
899
- case "ResourceNotFoundException": return [3, 8];
900
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
901
- case "ThrottlingException": return [3, 10];
902
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
903
- case "ValidationException": return [3, 12];
904
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
905
- }
906
- return [3, 14];
907
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
908
- case 3: throw _d.sent();
909
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
910
- case 5: throw _d.sent();
911
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
912
- case 7: throw _d.sent();
913
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
914
- case 9: throw _d.sent();
915
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
916
- case 11: throw _d.sent();
917
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
918
- case 13: throw _d.sent();
919
- case 14:
920
- parsedBody = parsedOutput.body;
921
- throwDefaultError({
922
- output: output,
923
- parsedBody: parsedBody,
924
- exceptionCtor: __BaseException,
925
- errorCode: errorCode,
926
- });
927
- _d.label = 15;
928
- case 15: return [2];
929
- }
930
- });
931
- }); };
932
- export var deserializeAws_json1_0ListDomainsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
933
- var data, contents, response;
934
- return __generator(this, function (_a) {
935
- switch (_a.label) {
936
- case 0:
937
- if (output.statusCode >= 300) {
938
- return [2, deserializeAws_json1_0ListDomainsCommandError(output, context)];
939
- }
940
- return [4, parseBody(output.body, context)];
941
- case 1:
942
- data = _a.sent();
943
- contents = {};
944
- contents = deserializeAws_json1_0ListDomainsResponse(data, context);
945
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
946
- return [2, Promise.resolve(response)];
947
- }
948
- });
949
- }); };
950
- var deserializeAws_json1_0ListDomainsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
951
- var parsedOutput, _a, errorCode, _b, parsedBody;
952
- var _c;
953
- return __generator(this, function (_d) {
954
- switch (_d.label) {
955
- case 0:
956
- _a = [__assign({}, output)];
957
- _c = {};
958
- return [4, parseErrorBody(output.body, context)];
959
- case 1:
960
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
961
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
962
- _b = errorCode;
963
- switch (_b) {
964
- case "AccessDeniedException": return [3, 2];
965
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
966
- case "InternalServerException": return [3, 4];
967
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
968
- case "ThrottlingException": return [3, 6];
969
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 6];
970
- case "ValidationException": return [3, 8];
971
- case "com.amazonaws.voiceid#ValidationException": return [3, 8];
972
- }
973
- return [3, 10];
974
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
975
- case 3: throw _d.sent();
976
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
977
- case 5: throw _d.sent();
978
- case 6: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
979
- case 7: throw _d.sent();
980
- case 8: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
981
- case 9: throw _d.sent();
982
- case 10:
983
- parsedBody = parsedOutput.body;
984
- throwDefaultError({
985
- output: output,
986
- parsedBody: parsedBody,
987
- exceptionCtor: __BaseException,
988
- errorCode: errorCode,
989
- });
990
- _d.label = 11;
991
- case 11: return [2];
992
- }
993
- });
994
- }); };
995
- export var deserializeAws_json1_0ListFraudsterRegistrationJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
996
- var data, contents, response;
997
- return __generator(this, function (_a) {
998
- switch (_a.label) {
999
- case 0:
1000
- if (output.statusCode >= 300) {
1001
- return [2, deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError(output, context)];
1002
- }
1003
- return [4, parseBody(output.body, context)];
1004
- case 1:
1005
- data = _a.sent();
1006
- contents = {};
1007
- contents = deserializeAws_json1_0ListFraudsterRegistrationJobsResponse(data, context);
1008
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1009
- return [2, Promise.resolve(response)];
1010
- }
1011
- });
1012
- }); };
1013
- var deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1014
- var parsedOutput, _a, errorCode, _b, parsedBody;
1015
- var _c;
1016
- return __generator(this, function (_d) {
1017
- switch (_d.label) {
1018
- case 0:
1019
- _a = [__assign({}, output)];
1020
- _c = {};
1021
- return [4, parseErrorBody(output.body, context)];
1022
- case 1:
1023
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1024
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1025
- _b = errorCode;
1026
- switch (_b) {
1027
- case "AccessDeniedException": return [3, 2];
1028
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1029
- case "InternalServerException": return [3, 4];
1030
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
1031
- case "ResourceNotFoundException": return [3, 6];
1032
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
1033
- case "ThrottlingException": return [3, 8];
1034
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
1035
- case "ValidationException": return [3, 10];
1036
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
1037
- }
1038
- return [3, 12];
1039
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1040
- case 3: throw _d.sent();
1041
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1042
- case 5: throw _d.sent();
1043
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1044
- case 7: throw _d.sent();
1045
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1046
- case 9: throw _d.sent();
1047
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1048
- case 11: throw _d.sent();
1049
- case 12:
1050
- parsedBody = parsedOutput.body;
1051
- throwDefaultError({
1052
- output: output,
1053
- parsedBody: parsedBody,
1054
- exceptionCtor: __BaseException,
1055
- errorCode: errorCode,
1056
- });
1057
- _d.label = 13;
1058
- case 13: return [2];
1059
- }
1060
- });
1061
- }); };
1062
- export var deserializeAws_json1_0ListSpeakerEnrollmentJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1063
- var data, contents, response;
1064
- return __generator(this, function (_a) {
1065
- switch (_a.label) {
1066
- case 0:
1067
- if (output.statusCode >= 300) {
1068
- return [2, deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError(output, context)];
1069
- }
1070
- return [4, parseBody(output.body, context)];
1071
- case 1:
1072
- data = _a.sent();
1073
- contents = {};
1074
- contents = deserializeAws_json1_0ListSpeakerEnrollmentJobsResponse(data, context);
1075
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1076
- return [2, Promise.resolve(response)];
1077
- }
1078
- });
1079
- }); };
1080
- var deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1081
- var parsedOutput, _a, errorCode, _b, parsedBody;
1082
- var _c;
1083
- return __generator(this, function (_d) {
1084
- switch (_d.label) {
1085
- case 0:
1086
- _a = [__assign({}, output)];
1087
- _c = {};
1088
- return [4, parseErrorBody(output.body, context)];
1089
- case 1:
1090
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1091
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1092
- _b = errorCode;
1093
- switch (_b) {
1094
- case "AccessDeniedException": return [3, 2];
1095
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1096
- case "InternalServerException": return [3, 4];
1097
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
1098
- case "ResourceNotFoundException": return [3, 6];
1099
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
1100
- case "ThrottlingException": return [3, 8];
1101
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
1102
- case "ValidationException": return [3, 10];
1103
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
1104
- }
1105
- return [3, 12];
1106
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1107
- case 3: throw _d.sent();
1108
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1109
- case 5: throw _d.sent();
1110
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1111
- case 7: throw _d.sent();
1112
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1113
- case 9: throw _d.sent();
1114
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1115
- case 11: throw _d.sent();
1116
- case 12:
1117
- parsedBody = parsedOutput.body;
1118
- throwDefaultError({
1119
- output: output,
1120
- parsedBody: parsedBody,
1121
- exceptionCtor: __BaseException,
1122
- errorCode: errorCode,
1123
- });
1124
- _d.label = 13;
1125
- case 13: return [2];
1126
- }
1127
- });
1128
- }); };
1129
- export var deserializeAws_json1_0ListSpeakersCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1130
- var data, contents, response;
1131
- return __generator(this, function (_a) {
1132
- switch (_a.label) {
1133
- case 0:
1134
- if (output.statusCode >= 300) {
1135
- return [2, deserializeAws_json1_0ListSpeakersCommandError(output, context)];
1136
- }
1137
- return [4, parseBody(output.body, context)];
1138
- case 1:
1139
- data = _a.sent();
1140
- contents = {};
1141
- contents = deserializeAws_json1_0ListSpeakersResponse(data, context);
1142
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1143
- return [2, Promise.resolve(response)];
1144
- }
1145
- });
1146
- }); };
1147
- var deserializeAws_json1_0ListSpeakersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1148
- var parsedOutput, _a, errorCode, _b, parsedBody;
1149
- var _c;
1150
- return __generator(this, function (_d) {
1151
- switch (_d.label) {
1152
- case 0:
1153
- _a = [__assign({}, output)];
1154
- _c = {};
1155
- return [4, parseErrorBody(output.body, context)];
1156
- case 1:
1157
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1158
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1159
- _b = errorCode;
1160
- switch (_b) {
1161
- case "AccessDeniedException": return [3, 2];
1162
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1163
- case "InternalServerException": return [3, 4];
1164
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
1165
- case "ResourceNotFoundException": return [3, 6];
1166
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
1167
- case "ThrottlingException": return [3, 8];
1168
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
1169
- case "ValidationException": return [3, 10];
1170
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
1171
- }
1172
- return [3, 12];
1173
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1174
- case 3: throw _d.sent();
1175
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1176
- case 5: throw _d.sent();
1177
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1178
- case 7: throw _d.sent();
1179
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1180
- case 9: throw _d.sent();
1181
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1182
- case 11: throw _d.sent();
1183
- case 12:
1184
- parsedBody = parsedOutput.body;
1185
- throwDefaultError({
1186
- output: output,
1187
- parsedBody: parsedBody,
1188
- exceptionCtor: __BaseException,
1189
- errorCode: errorCode,
1190
- });
1191
- _d.label = 13;
1192
- case 13: return [2];
1193
- }
1194
- });
1195
- }); };
1196
- export var deserializeAws_json1_0ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1197
- var data, contents, response;
1198
- return __generator(this, function (_a) {
1199
- switch (_a.label) {
1200
- case 0:
1201
- if (output.statusCode >= 300) {
1202
- return [2, deserializeAws_json1_0ListTagsForResourceCommandError(output, context)];
1203
- }
1204
- return [4, parseBody(output.body, context)];
1205
- case 1:
1206
- data = _a.sent();
1207
- contents = {};
1208
- contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
1209
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1210
- return [2, Promise.resolve(response)];
1211
- }
1212
- });
1213
- }); };
1214
- var deserializeAws_json1_0ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1215
- var parsedOutput, _a, errorCode, _b, parsedBody;
1216
- var _c;
1217
- return __generator(this, function (_d) {
1218
- switch (_d.label) {
1219
- case 0:
1220
- _a = [__assign({}, output)];
1221
- _c = {};
1222
- return [4, parseErrorBody(output.body, context)];
1223
- case 1:
1224
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1225
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1226
- _b = errorCode;
1227
- switch (_b) {
1228
- case "AccessDeniedException": return [3, 2];
1229
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1230
- case "InternalServerException": return [3, 4];
1231
- case "com.amazonaws.voiceid#InternalServerException": return [3, 4];
1232
- case "ResourceNotFoundException": return [3, 6];
1233
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 6];
1234
- case "ThrottlingException": return [3, 8];
1235
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 8];
1236
- case "ValidationException": return [3, 10];
1237
- case "com.amazonaws.voiceid#ValidationException": return [3, 10];
1238
- }
1239
- return [3, 12];
1240
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1241
- case 3: throw _d.sent();
1242
- case 4: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1243
- case 5: throw _d.sent();
1244
- case 6: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1245
- case 7: throw _d.sent();
1246
- case 8: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1247
- case 9: throw _d.sent();
1248
- case 10: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1249
- case 11: throw _d.sent();
1250
- case 12:
1251
- parsedBody = parsedOutput.body;
1252
- throwDefaultError({
1253
- output: output,
1254
- parsedBody: parsedBody,
1255
- exceptionCtor: __BaseException,
1256
- errorCode: errorCode,
1257
- });
1258
- _d.label = 13;
1259
- case 13: return [2];
1260
- }
1261
- });
1262
- }); };
1263
- export var deserializeAws_json1_0OptOutSpeakerCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1264
- var data, contents, response;
1265
- return __generator(this, function (_a) {
1266
- switch (_a.label) {
1267
- case 0:
1268
- if (output.statusCode >= 300) {
1269
- return [2, deserializeAws_json1_0OptOutSpeakerCommandError(output, context)];
1270
- }
1271
- return [4, parseBody(output.body, context)];
1272
- case 1:
1273
- data = _a.sent();
1274
- contents = {};
1275
- contents = deserializeAws_json1_0OptOutSpeakerResponse(data, context);
1276
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1277
- return [2, Promise.resolve(response)];
1278
- }
1279
- });
1280
- }); };
1281
- var deserializeAws_json1_0OptOutSpeakerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1282
- var parsedOutput, _a, errorCode, _b, parsedBody;
1283
- var _c;
1284
- return __generator(this, function (_d) {
1285
- switch (_d.label) {
1286
- case 0:
1287
- _a = [__assign({}, output)];
1288
- _c = {};
1289
- return [4, parseErrorBody(output.body, context)];
1290
- case 1:
1291
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1292
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1293
- _b = errorCode;
1294
- switch (_b) {
1295
- case "AccessDeniedException": return [3, 2];
1296
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1297
- case "ConflictException": return [3, 4];
1298
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1299
- case "InternalServerException": return [3, 6];
1300
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1301
- case "ResourceNotFoundException": return [3, 8];
1302
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1303
- case "ServiceQuotaExceededException": return [3, 10];
1304
- case "com.amazonaws.voiceid#ServiceQuotaExceededException": return [3, 10];
1305
- case "ThrottlingException": return [3, 12];
1306
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 12];
1307
- case "ValidationException": return [3, 14];
1308
- case "com.amazonaws.voiceid#ValidationException": return [3, 14];
1309
- }
1310
- return [3, 16];
1311
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1312
- case 3: throw _d.sent();
1313
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1314
- case 5: throw _d.sent();
1315
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1316
- case 7: throw _d.sent();
1317
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1318
- case 9: throw _d.sent();
1319
- case 10: return [4, deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1320
- case 11: throw _d.sent();
1321
- case 12: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1322
- case 13: throw _d.sent();
1323
- case 14: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1324
- case 15: throw _d.sent();
1325
- case 16:
1326
- parsedBody = parsedOutput.body;
1327
- throwDefaultError({
1328
- output: output,
1329
- parsedBody: parsedBody,
1330
- exceptionCtor: __BaseException,
1331
- errorCode: errorCode,
1332
- });
1333
- _d.label = 17;
1334
- case 17: return [2];
1335
- }
1336
- });
1337
- }); };
1338
- export var deserializeAws_json1_0StartFraudsterRegistrationJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1339
- var data, contents, response;
1340
- return __generator(this, function (_a) {
1341
- switch (_a.label) {
1342
- case 0:
1343
- if (output.statusCode >= 300) {
1344
- return [2, deserializeAws_json1_0StartFraudsterRegistrationJobCommandError(output, context)];
1345
- }
1346
- return [4, parseBody(output.body, context)];
1347
- case 1:
1348
- data = _a.sent();
1349
- contents = {};
1350
- contents = deserializeAws_json1_0StartFraudsterRegistrationJobResponse(data, context);
1351
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1352
- return [2, Promise.resolve(response)];
1353
- }
1354
- });
1355
- }); };
1356
- var deserializeAws_json1_0StartFraudsterRegistrationJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1357
- var parsedOutput, _a, errorCode, _b, parsedBody;
1358
- var _c;
1359
- return __generator(this, function (_d) {
1360
- switch (_d.label) {
1361
- case 0:
1362
- _a = [__assign({}, output)];
1363
- _c = {};
1364
- return [4, parseErrorBody(output.body, context)];
1365
- case 1:
1366
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1367
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1368
- _b = errorCode;
1369
- switch (_b) {
1370
- case "AccessDeniedException": return [3, 2];
1371
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1372
- case "ConflictException": return [3, 4];
1373
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1374
- case "InternalServerException": return [3, 6];
1375
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1376
- case "ResourceNotFoundException": return [3, 8];
1377
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1378
- case "ServiceQuotaExceededException": return [3, 10];
1379
- case "com.amazonaws.voiceid#ServiceQuotaExceededException": return [3, 10];
1380
- case "ThrottlingException": return [3, 12];
1381
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 12];
1382
- case "ValidationException": return [3, 14];
1383
- case "com.amazonaws.voiceid#ValidationException": return [3, 14];
1384
- }
1385
- return [3, 16];
1386
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1387
- case 3: throw _d.sent();
1388
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1389
- case 5: throw _d.sent();
1390
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1391
- case 7: throw _d.sent();
1392
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1393
- case 9: throw _d.sent();
1394
- case 10: return [4, deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1395
- case 11: throw _d.sent();
1396
- case 12: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1397
- case 13: throw _d.sent();
1398
- case 14: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1399
- case 15: throw _d.sent();
1400
- case 16:
1401
- parsedBody = parsedOutput.body;
1402
- throwDefaultError({
1403
- output: output,
1404
- parsedBody: parsedBody,
1405
- exceptionCtor: __BaseException,
1406
- errorCode: errorCode,
1407
- });
1408
- _d.label = 17;
1409
- case 17: return [2];
1410
- }
1411
- });
1412
- }); };
1413
- export var deserializeAws_json1_0StartSpeakerEnrollmentJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1414
- var data, contents, response;
1415
- return __generator(this, function (_a) {
1416
- switch (_a.label) {
1417
- case 0:
1418
- if (output.statusCode >= 300) {
1419
- return [2, deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError(output, context)];
1420
- }
1421
- return [4, parseBody(output.body, context)];
1422
- case 1:
1423
- data = _a.sent();
1424
- contents = {};
1425
- contents = deserializeAws_json1_0StartSpeakerEnrollmentJobResponse(data, context);
1426
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1427
- return [2, Promise.resolve(response)];
1428
- }
1429
- });
1430
- }); };
1431
- var deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1432
- var parsedOutput, _a, errorCode, _b, parsedBody;
1433
- var _c;
1434
- return __generator(this, function (_d) {
1435
- switch (_d.label) {
1436
- case 0:
1437
- _a = [__assign({}, output)];
1438
- _c = {};
1439
- return [4, parseErrorBody(output.body, context)];
1440
- case 1:
1441
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1442
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1443
- _b = errorCode;
1444
- switch (_b) {
1445
- case "AccessDeniedException": return [3, 2];
1446
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1447
- case "ConflictException": return [3, 4];
1448
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1449
- case "InternalServerException": return [3, 6];
1450
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1451
- case "ResourceNotFoundException": return [3, 8];
1452
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1453
- case "ServiceQuotaExceededException": return [3, 10];
1454
- case "com.amazonaws.voiceid#ServiceQuotaExceededException": return [3, 10];
1455
- case "ThrottlingException": return [3, 12];
1456
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 12];
1457
- case "ValidationException": return [3, 14];
1458
- case "com.amazonaws.voiceid#ValidationException": return [3, 14];
1459
- }
1460
- return [3, 16];
1461
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1462
- case 3: throw _d.sent();
1463
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1464
- case 5: throw _d.sent();
1465
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1466
- case 7: throw _d.sent();
1467
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1468
- case 9: throw _d.sent();
1469
- case 10: return [4, deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1470
- case 11: throw _d.sent();
1471
- case 12: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1472
- case 13: throw _d.sent();
1473
- case 14: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1474
- case 15: throw _d.sent();
1475
- case 16:
1476
- parsedBody = parsedOutput.body;
1477
- throwDefaultError({
1478
- output: output,
1479
- parsedBody: parsedBody,
1480
- exceptionCtor: __BaseException,
1481
- errorCode: errorCode,
1482
- });
1483
- _d.label = 17;
1484
- case 17: return [2];
1485
- }
1486
- });
1487
- }); };
1488
- export var deserializeAws_json1_0TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1489
- var data, contents, response;
1490
- return __generator(this, function (_a) {
1491
- switch (_a.label) {
1492
- case 0:
1493
- if (output.statusCode >= 300) {
1494
- return [2, deserializeAws_json1_0TagResourceCommandError(output, context)];
1495
- }
1496
- return [4, parseBody(output.body, context)];
1497
- case 1:
1498
- data = _a.sent();
1499
- contents = {};
1500
- contents = deserializeAws_json1_0TagResourceResponse(data, context);
1501
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1502
- return [2, Promise.resolve(response)];
1503
- }
1504
- });
1505
- }); };
1506
- var deserializeAws_json1_0TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1507
- var parsedOutput, _a, errorCode, _b, parsedBody;
1508
- var _c;
1509
- return __generator(this, function (_d) {
1510
- switch (_d.label) {
1511
- case 0:
1512
- _a = [__assign({}, output)];
1513
- _c = {};
1514
- return [4, parseErrorBody(output.body, context)];
1515
- case 1:
1516
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1517
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1518
- _b = errorCode;
1519
- switch (_b) {
1520
- case "AccessDeniedException": return [3, 2];
1521
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1522
- case "ConflictException": return [3, 4];
1523
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1524
- case "InternalServerException": return [3, 6];
1525
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1526
- case "ResourceNotFoundException": return [3, 8];
1527
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1528
- case "ThrottlingException": return [3, 10];
1529
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
1530
- case "ValidationException": return [3, 12];
1531
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
1532
- }
1533
- return [3, 14];
1534
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1535
- case 3: throw _d.sent();
1536
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1537
- case 5: throw _d.sent();
1538
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1539
- case 7: throw _d.sent();
1540
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1541
- case 9: throw _d.sent();
1542
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1543
- case 11: throw _d.sent();
1544
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1545
- case 13: throw _d.sent();
1546
- case 14:
1547
- parsedBody = parsedOutput.body;
1548
- throwDefaultError({
1549
- output: output,
1550
- parsedBody: parsedBody,
1551
- exceptionCtor: __BaseException,
1552
- errorCode: errorCode,
1553
- });
1554
- _d.label = 15;
1555
- case 15: return [2];
1556
- }
1557
- });
1558
- }); };
1559
- export var deserializeAws_json1_0UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1560
- var data, contents, response;
1561
- return __generator(this, function (_a) {
1562
- switch (_a.label) {
1563
- case 0:
1564
- if (output.statusCode >= 300) {
1565
- return [2, deserializeAws_json1_0UntagResourceCommandError(output, context)];
1566
- }
1567
- return [4, parseBody(output.body, context)];
1568
- case 1:
1569
- data = _a.sent();
1570
- contents = {};
1571
- contents = deserializeAws_json1_0UntagResourceResponse(data, context);
1572
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1573
- return [2, Promise.resolve(response)];
1574
- }
1575
- });
1576
- }); };
1577
- var deserializeAws_json1_0UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1578
- var parsedOutput, _a, errorCode, _b, parsedBody;
1579
- var _c;
1580
- return __generator(this, function (_d) {
1581
- switch (_d.label) {
1582
- case 0:
1583
- _a = [__assign({}, output)];
1584
- _c = {};
1585
- return [4, parseErrorBody(output.body, context)];
1586
- case 1:
1587
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1588
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1589
- _b = errorCode;
1590
- switch (_b) {
1591
- case "AccessDeniedException": return [3, 2];
1592
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1593
- case "ConflictException": return [3, 4];
1594
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1595
- case "InternalServerException": return [3, 6];
1596
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1597
- case "ResourceNotFoundException": return [3, 8];
1598
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1599
- case "ThrottlingException": return [3, 10];
1600
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
1601
- case "ValidationException": return [3, 12];
1602
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
1603
- }
1604
- return [3, 14];
1605
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1606
- case 3: throw _d.sent();
1607
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1608
- case 5: throw _d.sent();
1609
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1610
- case 7: throw _d.sent();
1611
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1612
- case 9: throw _d.sent();
1613
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1614
- case 11: throw _d.sent();
1615
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1616
- case 13: throw _d.sent();
1617
- case 14:
1618
- parsedBody = parsedOutput.body;
1619
- throwDefaultError({
1620
- output: output,
1621
- parsedBody: parsedBody,
1622
- exceptionCtor: __BaseException,
1623
- errorCode: errorCode,
1624
- });
1625
- _d.label = 15;
1626
- case 15: return [2];
1627
- }
1628
- });
1629
- }); };
1630
- export var deserializeAws_json1_0UpdateDomainCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1631
- var data, contents, response;
1632
- return __generator(this, function (_a) {
1633
- switch (_a.label) {
1634
- case 0:
1635
- if (output.statusCode >= 300) {
1636
- return [2, deserializeAws_json1_0UpdateDomainCommandError(output, context)];
1637
- }
1638
- return [4, parseBody(output.body, context)];
1639
- case 1:
1640
- data = _a.sent();
1641
- contents = {};
1642
- contents = deserializeAws_json1_0UpdateDomainResponse(data, context);
1643
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1644
- return [2, Promise.resolve(response)];
1645
- }
1646
- });
1647
- }); };
1648
- var deserializeAws_json1_0UpdateDomainCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1649
- var parsedOutput, _a, errorCode, _b, parsedBody;
1650
- var _c;
1651
- return __generator(this, function (_d) {
1652
- switch (_d.label) {
1653
- case 0:
1654
- _a = [__assign({}, output)];
1655
- _c = {};
1656
- return [4, parseErrorBody(output.body, context)];
1657
- case 1:
1658
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1659
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1660
- _b = errorCode;
1661
- switch (_b) {
1662
- case "AccessDeniedException": return [3, 2];
1663
- case "com.amazonaws.voiceid#AccessDeniedException": return [3, 2];
1664
- case "ConflictException": return [3, 4];
1665
- case "com.amazonaws.voiceid#ConflictException": return [3, 4];
1666
- case "InternalServerException": return [3, 6];
1667
- case "com.amazonaws.voiceid#InternalServerException": return [3, 6];
1668
- case "ResourceNotFoundException": return [3, 8];
1669
- case "com.amazonaws.voiceid#ResourceNotFoundException": return [3, 8];
1670
- case "ThrottlingException": return [3, 10];
1671
- case "com.amazonaws.voiceid#ThrottlingException": return [3, 10];
1672
- case "ValidationException": return [3, 12];
1673
- case "com.amazonaws.voiceid#ValidationException": return [3, 12];
1674
- }
1675
- return [3, 14];
1676
- case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
1677
- case 3: throw _d.sent();
1678
- case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
1679
- case 5: throw _d.sent();
1680
- case 6: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
1681
- case 7: throw _d.sent();
1682
- case 8: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
1683
- case 9: throw _d.sent();
1684
- case 10: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
1685
- case 11: throw _d.sent();
1686
- case 12: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
1687
- case 13: throw _d.sent();
1688
- case 14:
1689
- parsedBody = parsedOutput.body;
1690
- throwDefaultError({
1691
- output: output,
1692
- parsedBody: parsedBody,
1693
- exceptionCtor: __BaseException,
1694
- errorCode: errorCode,
1695
- });
1696
- _d.label = 15;
1697
- case 15: return [2];
1698
- }
1699
- });
1700
- }); };
1701
- var deserializeAws_json1_0AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1702
- var body, deserialized, exception;
1703
- return __generator(this, function (_a) {
1704
- body = parsedOutput.body;
1705
- deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
1706
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1707
- return [2, __decorateServiceException(exception, body)];
1708
- });
1709
- }); };
1710
- var deserializeAws_json1_0ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1711
- var body, deserialized, exception;
1712
- return __generator(this, function (_a) {
1713
- body = parsedOutput.body;
1714
- deserialized = deserializeAws_json1_0ConflictException(body, context);
1715
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1716
- return [2, __decorateServiceException(exception, body)];
1717
- });
1718
- }); };
1719
- var deserializeAws_json1_0InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1720
- var body, deserialized, exception;
1721
- return __generator(this, function (_a) {
1722
- body = parsedOutput.body;
1723
- deserialized = deserializeAws_json1_0InternalServerException(body, context);
1724
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1725
- return [2, __decorateServiceException(exception, body)];
1726
- });
1727
- }); };
1728
- var deserializeAws_json1_0ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1729
- var body, deserialized, exception;
1730
- return __generator(this, function (_a) {
1731
- body = parsedOutput.body;
1732
- deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
1733
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1734
- return [2, __decorateServiceException(exception, body)];
1735
- });
1736
- }); };
1737
- var deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1738
- var body, deserialized, exception;
1739
- return __generator(this, function (_a) {
1740
- body = parsedOutput.body;
1741
- deserialized = deserializeAws_json1_0ServiceQuotaExceededException(body, context);
1742
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1743
- return [2, __decorateServiceException(exception, body)];
1744
- });
1745
- }); };
1746
- var deserializeAws_json1_0ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1747
- var body, deserialized, exception;
1748
- return __generator(this, function (_a) {
1749
- body = parsedOutput.body;
1750
- deserialized = deserializeAws_json1_0ThrottlingException(body, context);
1751
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1752
- return [2, __decorateServiceException(exception, body)];
1753
- });
1754
- }); };
1755
- var deserializeAws_json1_0ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1756
- var body, deserialized, exception;
1757
- return __generator(this, function (_a) {
1758
- body = parsedOutput.body;
1759
- deserialized = deserializeAws_json1_0ValidationException(body, context);
1760
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1761
- return [2, __decorateServiceException(exception, body)];
1762
- });
1763
- }); };
1764
- var serializeAws_json1_0CreateDomainRequest = function (input, context) {
1765
- var _a;
1766
- return __assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.Description != null && { Description: input.Description })), (input.Name != null && { Name: input.Name })), (input.ServerSideEncryptionConfiguration != null && {
1767
- ServerSideEncryptionConfiguration: serializeAws_json1_0ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context),
1768
- })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
6
+ export const serializeAws_json1_0CreateDomainCommand = async (input, context) => {
7
+ const headers = {
8
+ "content-type": "application/x-amz-json-1.0",
9
+ "x-amz-target": "VoiceID.CreateDomain",
10
+ };
11
+ let body;
12
+ body = JSON.stringify(serializeAws_json1_0CreateDomainRequest(input, context));
13
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
+ };
15
+ export const serializeAws_json1_0DeleteDomainCommand = async (input, context) => {
16
+ const headers = {
17
+ "content-type": "application/x-amz-json-1.0",
18
+ "x-amz-target": "VoiceID.DeleteDomain",
19
+ };
20
+ let body;
21
+ body = JSON.stringify(serializeAws_json1_0DeleteDomainRequest(input, context));
22
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
+ };
24
+ export const serializeAws_json1_0DeleteFraudsterCommand = async (input, context) => {
25
+ const headers = {
26
+ "content-type": "application/x-amz-json-1.0",
27
+ "x-amz-target": "VoiceID.DeleteFraudster",
28
+ };
29
+ let body;
30
+ body = JSON.stringify(serializeAws_json1_0DeleteFraudsterRequest(input, context));
31
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
+ };
33
+ export const serializeAws_json1_0DeleteSpeakerCommand = async (input, context) => {
34
+ const headers = {
35
+ "content-type": "application/x-amz-json-1.0",
36
+ "x-amz-target": "VoiceID.DeleteSpeaker",
37
+ };
38
+ let body;
39
+ body = JSON.stringify(serializeAws_json1_0DeleteSpeakerRequest(input, context));
40
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
+ };
42
+ export const serializeAws_json1_0DescribeDomainCommand = async (input, context) => {
43
+ const headers = {
44
+ "content-type": "application/x-amz-json-1.0",
45
+ "x-amz-target": "VoiceID.DescribeDomain",
46
+ };
47
+ let body;
48
+ body = JSON.stringify(serializeAws_json1_0DescribeDomainRequest(input, context));
49
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
+ };
51
+ export const serializeAws_json1_0DescribeFraudsterCommand = async (input, context) => {
52
+ const headers = {
53
+ "content-type": "application/x-amz-json-1.0",
54
+ "x-amz-target": "VoiceID.DescribeFraudster",
55
+ };
56
+ let body;
57
+ body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRequest(input, context));
58
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
+ };
60
+ export const serializeAws_json1_0DescribeFraudsterRegistrationJobCommand = async (input, context) => {
61
+ const headers = {
62
+ "content-type": "application/x-amz-json-1.0",
63
+ "x-amz-target": "VoiceID.DescribeFraudsterRegistrationJob",
64
+ };
65
+ let body;
66
+ body = JSON.stringify(serializeAws_json1_0DescribeFraudsterRegistrationJobRequest(input, context));
67
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
+ };
69
+ export const serializeAws_json1_0DescribeSpeakerCommand = async (input, context) => {
70
+ const headers = {
71
+ "content-type": "application/x-amz-json-1.0",
72
+ "x-amz-target": "VoiceID.DescribeSpeaker",
73
+ };
74
+ let body;
75
+ body = JSON.stringify(serializeAws_json1_0DescribeSpeakerRequest(input, context));
76
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
+ };
78
+ export const serializeAws_json1_0DescribeSpeakerEnrollmentJobCommand = async (input, context) => {
79
+ const headers = {
80
+ "content-type": "application/x-amz-json-1.0",
81
+ "x-amz-target": "VoiceID.DescribeSpeakerEnrollmentJob",
82
+ };
83
+ let body;
84
+ body = JSON.stringify(serializeAws_json1_0DescribeSpeakerEnrollmentJobRequest(input, context));
85
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
+ };
87
+ export const serializeAws_json1_0EvaluateSessionCommand = async (input, context) => {
88
+ const headers = {
89
+ "content-type": "application/x-amz-json-1.0",
90
+ "x-amz-target": "VoiceID.EvaluateSession",
91
+ };
92
+ let body;
93
+ body = JSON.stringify(serializeAws_json1_0EvaluateSessionRequest(input, context));
94
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
+ };
96
+ export const serializeAws_json1_0ListDomainsCommand = async (input, context) => {
97
+ const headers = {
98
+ "content-type": "application/x-amz-json-1.0",
99
+ "x-amz-target": "VoiceID.ListDomains",
100
+ };
101
+ let body;
102
+ body = JSON.stringify(serializeAws_json1_0ListDomainsRequest(input, context));
103
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
104
+ };
105
+ export const serializeAws_json1_0ListFraudsterRegistrationJobsCommand = async (input, context) => {
106
+ const headers = {
107
+ "content-type": "application/x-amz-json-1.0",
108
+ "x-amz-target": "VoiceID.ListFraudsterRegistrationJobs",
109
+ };
110
+ let body;
111
+ body = JSON.stringify(serializeAws_json1_0ListFraudsterRegistrationJobsRequest(input, context));
112
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
+ };
114
+ export const serializeAws_json1_0ListSpeakerEnrollmentJobsCommand = async (input, context) => {
115
+ const headers = {
116
+ "content-type": "application/x-amz-json-1.0",
117
+ "x-amz-target": "VoiceID.ListSpeakerEnrollmentJobs",
118
+ };
119
+ let body;
120
+ body = JSON.stringify(serializeAws_json1_0ListSpeakerEnrollmentJobsRequest(input, context));
121
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
122
+ };
123
+ export const serializeAws_json1_0ListSpeakersCommand = async (input, context) => {
124
+ const headers = {
125
+ "content-type": "application/x-amz-json-1.0",
126
+ "x-amz-target": "VoiceID.ListSpeakers",
127
+ };
128
+ let body;
129
+ body = JSON.stringify(serializeAws_json1_0ListSpeakersRequest(input, context));
130
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
131
+ };
132
+ export const serializeAws_json1_0ListTagsForResourceCommand = async (input, context) => {
133
+ const headers = {
134
+ "content-type": "application/x-amz-json-1.0",
135
+ "x-amz-target": "VoiceID.ListTagsForResource",
136
+ };
137
+ let body;
138
+ body = JSON.stringify(serializeAws_json1_0ListTagsForResourceRequest(input, context));
139
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
+ };
141
+ export const serializeAws_json1_0OptOutSpeakerCommand = async (input, context) => {
142
+ const headers = {
143
+ "content-type": "application/x-amz-json-1.0",
144
+ "x-amz-target": "VoiceID.OptOutSpeaker",
145
+ };
146
+ let body;
147
+ body = JSON.stringify(serializeAws_json1_0OptOutSpeakerRequest(input, context));
148
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
149
+ };
150
+ export const serializeAws_json1_0StartFraudsterRegistrationJobCommand = async (input, context) => {
151
+ const headers = {
152
+ "content-type": "application/x-amz-json-1.0",
153
+ "x-amz-target": "VoiceID.StartFraudsterRegistrationJob",
154
+ };
155
+ let body;
156
+ body = JSON.stringify(serializeAws_json1_0StartFraudsterRegistrationJobRequest(input, context));
157
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
158
+ };
159
+ export const serializeAws_json1_0StartSpeakerEnrollmentJobCommand = async (input, context) => {
160
+ const headers = {
161
+ "content-type": "application/x-amz-json-1.0",
162
+ "x-amz-target": "VoiceID.StartSpeakerEnrollmentJob",
163
+ };
164
+ let body;
165
+ body = JSON.stringify(serializeAws_json1_0StartSpeakerEnrollmentJobRequest(input, context));
166
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
167
+ };
168
+ export const serializeAws_json1_0TagResourceCommand = async (input, context) => {
169
+ const headers = {
170
+ "content-type": "application/x-amz-json-1.0",
171
+ "x-amz-target": "VoiceID.TagResource",
172
+ };
173
+ let body;
174
+ body = JSON.stringify(serializeAws_json1_0TagResourceRequest(input, context));
175
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
176
+ };
177
+ export const serializeAws_json1_0UntagResourceCommand = async (input, context) => {
178
+ const headers = {
179
+ "content-type": "application/x-amz-json-1.0",
180
+ "x-amz-target": "VoiceID.UntagResource",
181
+ };
182
+ let body;
183
+ body = JSON.stringify(serializeAws_json1_0UntagResourceRequest(input, context));
184
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
185
+ };
186
+ export const serializeAws_json1_0UpdateDomainCommand = async (input, context) => {
187
+ const headers = {
188
+ "content-type": "application/x-amz-json-1.0",
189
+ "x-amz-target": "VoiceID.UpdateDomain",
190
+ };
191
+ let body;
192
+ body = JSON.stringify(serializeAws_json1_0UpdateDomainRequest(input, context));
193
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
1769
194
  };
1770
- var serializeAws_json1_0DeleteDomainRequest = function (input, context) {
1771
- return __assign({}, (input.DomainId != null && { DomainId: input.DomainId }));
195
+ export const deserializeAws_json1_0CreateDomainCommand = async (output, context) => {
196
+ if (output.statusCode >= 300) {
197
+ return deserializeAws_json1_0CreateDomainCommandError(output, context);
198
+ }
199
+ const data = await parseBody(output.body, context);
200
+ let contents = {};
201
+ contents = deserializeAws_json1_0CreateDomainResponse(data, context);
202
+ const response = {
203
+ $metadata: deserializeMetadata(output),
204
+ ...contents,
205
+ };
206
+ return Promise.resolve(response);
1772
207
  };
1773
- var serializeAws_json1_0DeleteFraudsterRequest = function (input, context) {
1774
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.FraudsterId != null && { FraudsterId: input.FraudsterId }));
208
+ const deserializeAws_json1_0CreateDomainCommandError = async (output, context) => {
209
+ const parsedOutput = {
210
+ ...output,
211
+ body: await parseErrorBody(output.body, context),
212
+ };
213
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
214
+ switch (errorCode) {
215
+ case "AccessDeniedException":
216
+ case "com.amazonaws.voiceid#AccessDeniedException":
217
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
218
+ case "ConflictException":
219
+ case "com.amazonaws.voiceid#ConflictException":
220
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
221
+ case "InternalServerException":
222
+ case "com.amazonaws.voiceid#InternalServerException":
223
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
224
+ case "ResourceNotFoundException":
225
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
226
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
227
+ case "ServiceQuotaExceededException":
228
+ case "com.amazonaws.voiceid#ServiceQuotaExceededException":
229
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
230
+ case "ThrottlingException":
231
+ case "com.amazonaws.voiceid#ThrottlingException":
232
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
233
+ case "ValidationException":
234
+ case "com.amazonaws.voiceid#ValidationException":
235
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
236
+ default:
237
+ const parsedBody = parsedOutput.body;
238
+ throwDefaultError({
239
+ output,
240
+ parsedBody,
241
+ exceptionCtor: __BaseException,
242
+ errorCode,
243
+ });
244
+ }
1775
245
  };
1776
- var serializeAws_json1_0DeleteSpeakerRequest = function (input, context) {
1777
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.SpeakerId != null && { SpeakerId: input.SpeakerId }));
246
+ export const deserializeAws_json1_0DeleteDomainCommand = async (output, context) => {
247
+ if (output.statusCode >= 300) {
248
+ return deserializeAws_json1_0DeleteDomainCommandError(output, context);
249
+ }
250
+ await collectBody(output.body, context);
251
+ const response = {
252
+ $metadata: deserializeMetadata(output),
253
+ };
254
+ return Promise.resolve(response);
1778
255
  };
1779
- var serializeAws_json1_0DescribeDomainRequest = function (input, context) {
1780
- return __assign({}, (input.DomainId != null && { DomainId: input.DomainId }));
256
+ const deserializeAws_json1_0DeleteDomainCommandError = async (output, context) => {
257
+ const parsedOutput = {
258
+ ...output,
259
+ body: await parseErrorBody(output.body, context),
260
+ };
261
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
262
+ switch (errorCode) {
263
+ case "AccessDeniedException":
264
+ case "com.amazonaws.voiceid#AccessDeniedException":
265
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
266
+ case "ConflictException":
267
+ case "com.amazonaws.voiceid#ConflictException":
268
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
269
+ case "InternalServerException":
270
+ case "com.amazonaws.voiceid#InternalServerException":
271
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
272
+ case "ResourceNotFoundException":
273
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
274
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
275
+ case "ThrottlingException":
276
+ case "com.amazonaws.voiceid#ThrottlingException":
277
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
278
+ case "ValidationException":
279
+ case "com.amazonaws.voiceid#ValidationException":
280
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
281
+ default:
282
+ const parsedBody = parsedOutput.body;
283
+ throwDefaultError({
284
+ output,
285
+ parsedBody,
286
+ exceptionCtor: __BaseException,
287
+ errorCode,
288
+ });
289
+ }
1781
290
  };
1782
- var serializeAws_json1_0DescribeFraudsterRegistrationJobRequest = function (input, context) {
1783
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.JobId != null && { JobId: input.JobId }));
291
+ export const deserializeAws_json1_0DeleteFraudsterCommand = async (output, context) => {
292
+ if (output.statusCode >= 300) {
293
+ return deserializeAws_json1_0DeleteFraudsterCommandError(output, context);
294
+ }
295
+ await collectBody(output.body, context);
296
+ const response = {
297
+ $metadata: deserializeMetadata(output),
298
+ };
299
+ return Promise.resolve(response);
1784
300
  };
1785
- var serializeAws_json1_0DescribeFraudsterRequest = function (input, context) {
1786
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.FraudsterId != null && { FraudsterId: input.FraudsterId }));
301
+ const deserializeAws_json1_0DeleteFraudsterCommandError = async (output, context) => {
302
+ const parsedOutput = {
303
+ ...output,
304
+ body: await parseErrorBody(output.body, context),
305
+ };
306
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
307
+ switch (errorCode) {
308
+ case "AccessDeniedException":
309
+ case "com.amazonaws.voiceid#AccessDeniedException":
310
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
311
+ case "ConflictException":
312
+ case "com.amazonaws.voiceid#ConflictException":
313
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
314
+ case "InternalServerException":
315
+ case "com.amazonaws.voiceid#InternalServerException":
316
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
317
+ case "ResourceNotFoundException":
318
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
319
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
320
+ case "ThrottlingException":
321
+ case "com.amazonaws.voiceid#ThrottlingException":
322
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
323
+ case "ValidationException":
324
+ case "com.amazonaws.voiceid#ValidationException":
325
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
326
+ default:
327
+ const parsedBody = parsedOutput.body;
328
+ throwDefaultError({
329
+ output,
330
+ parsedBody,
331
+ exceptionCtor: __BaseException,
332
+ errorCode,
333
+ });
334
+ }
1787
335
  };
1788
- var serializeAws_json1_0DescribeSpeakerEnrollmentJobRequest = function (input, context) {
1789
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.JobId != null && { JobId: input.JobId }));
336
+ export const deserializeAws_json1_0DeleteSpeakerCommand = async (output, context) => {
337
+ if (output.statusCode >= 300) {
338
+ return deserializeAws_json1_0DeleteSpeakerCommandError(output, context);
339
+ }
340
+ await collectBody(output.body, context);
341
+ const response = {
342
+ $metadata: deserializeMetadata(output),
343
+ };
344
+ return Promise.resolve(response);
1790
345
  };
1791
- var serializeAws_json1_0DescribeSpeakerRequest = function (input, context) {
1792
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.SpeakerId != null && { SpeakerId: input.SpeakerId }));
346
+ const deserializeAws_json1_0DeleteSpeakerCommandError = async (output, context) => {
347
+ const parsedOutput = {
348
+ ...output,
349
+ body: await parseErrorBody(output.body, context),
350
+ };
351
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
352
+ switch (errorCode) {
353
+ case "AccessDeniedException":
354
+ case "com.amazonaws.voiceid#AccessDeniedException":
355
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
356
+ case "ConflictException":
357
+ case "com.amazonaws.voiceid#ConflictException":
358
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
359
+ case "InternalServerException":
360
+ case "com.amazonaws.voiceid#InternalServerException":
361
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
362
+ case "ResourceNotFoundException":
363
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
364
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
365
+ case "ThrottlingException":
366
+ case "com.amazonaws.voiceid#ThrottlingException":
367
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
368
+ case "ValidationException":
369
+ case "com.amazonaws.voiceid#ValidationException":
370
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
371
+ default:
372
+ const parsedBody = parsedOutput.body;
373
+ throwDefaultError({
374
+ output,
375
+ parsedBody,
376
+ exceptionCtor: __BaseException,
377
+ errorCode,
378
+ });
379
+ }
1793
380
  };
1794
- var serializeAws_json1_0EnrollmentConfig = function (input, context) {
1795
- return __assign(__assign({}, (input.ExistingEnrollmentAction != null && { ExistingEnrollmentAction: input.ExistingEnrollmentAction })), (input.FraudDetectionConfig != null && {
1796
- FraudDetectionConfig: serializeAws_json1_0EnrollmentJobFraudDetectionConfig(input.FraudDetectionConfig, context),
1797
- }));
381
+ export const deserializeAws_json1_0DescribeDomainCommand = async (output, context) => {
382
+ if (output.statusCode >= 300) {
383
+ return deserializeAws_json1_0DescribeDomainCommandError(output, context);
384
+ }
385
+ const data = await parseBody(output.body, context);
386
+ let contents = {};
387
+ contents = deserializeAws_json1_0DescribeDomainResponse(data, context);
388
+ const response = {
389
+ $metadata: deserializeMetadata(output),
390
+ ...contents,
391
+ };
392
+ return Promise.resolve(response);
1798
393
  };
1799
- var serializeAws_json1_0EnrollmentJobFraudDetectionConfig = function (input, context) {
1800
- return __assign(__assign({}, (input.FraudDetectionAction != null && { FraudDetectionAction: input.FraudDetectionAction })), (input.RiskThreshold != null && { RiskThreshold: input.RiskThreshold }));
394
+ const deserializeAws_json1_0DescribeDomainCommandError = async (output, context) => {
395
+ const parsedOutput = {
396
+ ...output,
397
+ body: await parseErrorBody(output.body, context),
398
+ };
399
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
400
+ switch (errorCode) {
401
+ case "AccessDeniedException":
402
+ case "com.amazonaws.voiceid#AccessDeniedException":
403
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
404
+ case "InternalServerException":
405
+ case "com.amazonaws.voiceid#InternalServerException":
406
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
407
+ case "ResourceNotFoundException":
408
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
409
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
410
+ case "ThrottlingException":
411
+ case "com.amazonaws.voiceid#ThrottlingException":
412
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
413
+ case "ValidationException":
414
+ case "com.amazonaws.voiceid#ValidationException":
415
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
416
+ default:
417
+ const parsedBody = parsedOutput.body;
418
+ throwDefaultError({
419
+ output,
420
+ parsedBody,
421
+ exceptionCtor: __BaseException,
422
+ errorCode,
423
+ });
424
+ }
1801
425
  };
1802
- var serializeAws_json1_0EvaluateSessionRequest = function (input, context) {
1803
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.SessionNameOrId != null && { SessionNameOrId: input.SessionNameOrId }));
426
+ export const deserializeAws_json1_0DescribeFraudsterCommand = async (output, context) => {
427
+ if (output.statusCode >= 300) {
428
+ return deserializeAws_json1_0DescribeFraudsterCommandError(output, context);
429
+ }
430
+ const data = await parseBody(output.body, context);
431
+ let contents = {};
432
+ contents = deserializeAws_json1_0DescribeFraudsterResponse(data, context);
433
+ const response = {
434
+ $metadata: deserializeMetadata(output),
435
+ ...contents,
436
+ };
437
+ return Promise.resolve(response);
1804
438
  };
1805
- var serializeAws_json1_0InputDataConfig = function (input, context) {
1806
- return __assign({}, (input.S3Uri != null && { S3Uri: input.S3Uri }));
439
+ const deserializeAws_json1_0DescribeFraudsterCommandError = async (output, context) => {
440
+ const parsedOutput = {
441
+ ...output,
442
+ body: await parseErrorBody(output.body, context),
443
+ };
444
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
445
+ switch (errorCode) {
446
+ case "AccessDeniedException":
447
+ case "com.amazonaws.voiceid#AccessDeniedException":
448
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
449
+ case "InternalServerException":
450
+ case "com.amazonaws.voiceid#InternalServerException":
451
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
452
+ case "ResourceNotFoundException":
453
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
454
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
455
+ case "ThrottlingException":
456
+ case "com.amazonaws.voiceid#ThrottlingException":
457
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
458
+ case "ValidationException":
459
+ case "com.amazonaws.voiceid#ValidationException":
460
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
461
+ default:
462
+ const parsedBody = parsedOutput.body;
463
+ throwDefaultError({
464
+ output,
465
+ parsedBody,
466
+ exceptionCtor: __BaseException,
467
+ errorCode,
468
+ });
469
+ }
1807
470
  };
1808
- var serializeAws_json1_0ListDomainsRequest = function (input, context) {
1809
- return __assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
471
+ export const deserializeAws_json1_0DescribeFraudsterRegistrationJobCommand = async (output, context) => {
472
+ if (output.statusCode >= 300) {
473
+ return deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError(output, context);
474
+ }
475
+ const data = await parseBody(output.body, context);
476
+ let contents = {};
477
+ contents = deserializeAws_json1_0DescribeFraudsterRegistrationJobResponse(data, context);
478
+ const response = {
479
+ $metadata: deserializeMetadata(output),
480
+ ...contents,
481
+ };
482
+ return Promise.resolve(response);
1810
483
  };
1811
- var serializeAws_json1_0ListFraudsterRegistrationJobsRequest = function (input, context) {
1812
- return __assign(__assign(__assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.JobStatus != null && { JobStatus: input.JobStatus })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
484
+ const deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError = async (output, context) => {
485
+ const parsedOutput = {
486
+ ...output,
487
+ body: await parseErrorBody(output.body, context),
488
+ };
489
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
490
+ switch (errorCode) {
491
+ case "AccessDeniedException":
492
+ case "com.amazonaws.voiceid#AccessDeniedException":
493
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
494
+ case "InternalServerException":
495
+ case "com.amazonaws.voiceid#InternalServerException":
496
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
497
+ case "ResourceNotFoundException":
498
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
499
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
500
+ case "ThrottlingException":
501
+ case "com.amazonaws.voiceid#ThrottlingException":
502
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
503
+ case "ValidationException":
504
+ case "com.amazonaws.voiceid#ValidationException":
505
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
506
+ default:
507
+ const parsedBody = parsedOutput.body;
508
+ throwDefaultError({
509
+ output,
510
+ parsedBody,
511
+ exceptionCtor: __BaseException,
512
+ errorCode,
513
+ });
514
+ }
1813
515
  };
1814
- var serializeAws_json1_0ListSpeakerEnrollmentJobsRequest = function (input, context) {
1815
- return __assign(__assign(__assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.JobStatus != null && { JobStatus: input.JobStatus })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
516
+ export const deserializeAws_json1_0DescribeSpeakerCommand = async (output, context) => {
517
+ if (output.statusCode >= 300) {
518
+ return deserializeAws_json1_0DescribeSpeakerCommandError(output, context);
519
+ }
520
+ const data = await parseBody(output.body, context);
521
+ let contents = {};
522
+ contents = deserializeAws_json1_0DescribeSpeakerResponse(data, context);
523
+ const response = {
524
+ $metadata: deserializeMetadata(output),
525
+ ...contents,
526
+ };
527
+ return Promise.resolve(response);
1816
528
  };
1817
- var serializeAws_json1_0ListSpeakersRequest = function (input, context) {
1818
- return __assign(__assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken }));
529
+ const deserializeAws_json1_0DescribeSpeakerCommandError = async (output, context) => {
530
+ const parsedOutput = {
531
+ ...output,
532
+ body: await parseErrorBody(output.body, context),
533
+ };
534
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
535
+ switch (errorCode) {
536
+ case "AccessDeniedException":
537
+ case "com.amazonaws.voiceid#AccessDeniedException":
538
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
539
+ case "InternalServerException":
540
+ case "com.amazonaws.voiceid#InternalServerException":
541
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
542
+ case "ResourceNotFoundException":
543
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
544
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
545
+ case "ThrottlingException":
546
+ case "com.amazonaws.voiceid#ThrottlingException":
547
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
548
+ case "ValidationException":
549
+ case "com.amazonaws.voiceid#ValidationException":
550
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
551
+ default:
552
+ const parsedBody = parsedOutput.body;
553
+ throwDefaultError({
554
+ output,
555
+ parsedBody,
556
+ exceptionCtor: __BaseException,
557
+ errorCode,
558
+ });
559
+ }
1819
560
  };
1820
- var serializeAws_json1_0ListTagsForResourceRequest = function (input, context) {
1821
- return __assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn }));
561
+ export const deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommand = async (output, context) => {
562
+ if (output.statusCode >= 300) {
563
+ return deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError(output, context);
564
+ }
565
+ const data = await parseBody(output.body, context);
566
+ let contents = {};
567
+ contents = deserializeAws_json1_0DescribeSpeakerEnrollmentJobResponse(data, context);
568
+ const response = {
569
+ $metadata: deserializeMetadata(output),
570
+ ...contents,
571
+ };
572
+ return Promise.resolve(response);
573
+ };
574
+ const deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError = async (output, context) => {
575
+ const parsedOutput = {
576
+ ...output,
577
+ body: await parseErrorBody(output.body, context),
578
+ };
579
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
580
+ switch (errorCode) {
581
+ case "AccessDeniedException":
582
+ case "com.amazonaws.voiceid#AccessDeniedException":
583
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
584
+ case "InternalServerException":
585
+ case "com.amazonaws.voiceid#InternalServerException":
586
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
587
+ case "ResourceNotFoundException":
588
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
589
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
590
+ case "ThrottlingException":
591
+ case "com.amazonaws.voiceid#ThrottlingException":
592
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
593
+ case "ValidationException":
594
+ case "com.amazonaws.voiceid#ValidationException":
595
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
596
+ default:
597
+ const parsedBody = parsedOutput.body;
598
+ throwDefaultError({
599
+ output,
600
+ parsedBody,
601
+ exceptionCtor: __BaseException,
602
+ errorCode,
603
+ });
604
+ }
605
+ };
606
+ export const deserializeAws_json1_0EvaluateSessionCommand = async (output, context) => {
607
+ if (output.statusCode >= 300) {
608
+ return deserializeAws_json1_0EvaluateSessionCommandError(output, context);
609
+ }
610
+ const data = await parseBody(output.body, context);
611
+ let contents = {};
612
+ contents = deserializeAws_json1_0EvaluateSessionResponse(data, context);
613
+ const response = {
614
+ $metadata: deserializeMetadata(output),
615
+ ...contents,
616
+ };
617
+ return Promise.resolve(response);
618
+ };
619
+ const deserializeAws_json1_0EvaluateSessionCommandError = async (output, context) => {
620
+ const parsedOutput = {
621
+ ...output,
622
+ body: await parseErrorBody(output.body, context),
623
+ };
624
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
625
+ switch (errorCode) {
626
+ case "AccessDeniedException":
627
+ case "com.amazonaws.voiceid#AccessDeniedException":
628
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
629
+ case "ConflictException":
630
+ case "com.amazonaws.voiceid#ConflictException":
631
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
632
+ case "InternalServerException":
633
+ case "com.amazonaws.voiceid#InternalServerException":
634
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
635
+ case "ResourceNotFoundException":
636
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
637
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
638
+ case "ThrottlingException":
639
+ case "com.amazonaws.voiceid#ThrottlingException":
640
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
641
+ case "ValidationException":
642
+ case "com.amazonaws.voiceid#ValidationException":
643
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
644
+ default:
645
+ const parsedBody = parsedOutput.body;
646
+ throwDefaultError({
647
+ output,
648
+ parsedBody,
649
+ exceptionCtor: __BaseException,
650
+ errorCode,
651
+ });
652
+ }
653
+ };
654
+ export const deserializeAws_json1_0ListDomainsCommand = async (output, context) => {
655
+ if (output.statusCode >= 300) {
656
+ return deserializeAws_json1_0ListDomainsCommandError(output, context);
657
+ }
658
+ const data = await parseBody(output.body, context);
659
+ let contents = {};
660
+ contents = deserializeAws_json1_0ListDomainsResponse(data, context);
661
+ const response = {
662
+ $metadata: deserializeMetadata(output),
663
+ ...contents,
664
+ };
665
+ return Promise.resolve(response);
666
+ };
667
+ const deserializeAws_json1_0ListDomainsCommandError = async (output, context) => {
668
+ const parsedOutput = {
669
+ ...output,
670
+ body: await parseErrorBody(output.body, context),
671
+ };
672
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
673
+ switch (errorCode) {
674
+ case "AccessDeniedException":
675
+ case "com.amazonaws.voiceid#AccessDeniedException":
676
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
677
+ case "InternalServerException":
678
+ case "com.amazonaws.voiceid#InternalServerException":
679
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
680
+ case "ThrottlingException":
681
+ case "com.amazonaws.voiceid#ThrottlingException":
682
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
683
+ case "ValidationException":
684
+ case "com.amazonaws.voiceid#ValidationException":
685
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
686
+ default:
687
+ const parsedBody = parsedOutput.body;
688
+ throwDefaultError({
689
+ output,
690
+ parsedBody,
691
+ exceptionCtor: __BaseException,
692
+ errorCode,
693
+ });
694
+ }
695
+ };
696
+ export const deserializeAws_json1_0ListFraudsterRegistrationJobsCommand = async (output, context) => {
697
+ if (output.statusCode >= 300) {
698
+ return deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError(output, context);
699
+ }
700
+ const data = await parseBody(output.body, context);
701
+ let contents = {};
702
+ contents = deserializeAws_json1_0ListFraudsterRegistrationJobsResponse(data, context);
703
+ const response = {
704
+ $metadata: deserializeMetadata(output),
705
+ ...contents,
706
+ };
707
+ return Promise.resolve(response);
708
+ };
709
+ const deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError = async (output, context) => {
710
+ const parsedOutput = {
711
+ ...output,
712
+ body: await parseErrorBody(output.body, context),
713
+ };
714
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
715
+ switch (errorCode) {
716
+ case "AccessDeniedException":
717
+ case "com.amazonaws.voiceid#AccessDeniedException":
718
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
719
+ case "InternalServerException":
720
+ case "com.amazonaws.voiceid#InternalServerException":
721
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
722
+ case "ResourceNotFoundException":
723
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
724
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
725
+ case "ThrottlingException":
726
+ case "com.amazonaws.voiceid#ThrottlingException":
727
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
728
+ case "ValidationException":
729
+ case "com.amazonaws.voiceid#ValidationException":
730
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
731
+ default:
732
+ const parsedBody = parsedOutput.body;
733
+ throwDefaultError({
734
+ output,
735
+ parsedBody,
736
+ exceptionCtor: __BaseException,
737
+ errorCode,
738
+ });
739
+ }
740
+ };
741
+ export const deserializeAws_json1_0ListSpeakerEnrollmentJobsCommand = async (output, context) => {
742
+ if (output.statusCode >= 300) {
743
+ return deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError(output, context);
744
+ }
745
+ const data = await parseBody(output.body, context);
746
+ let contents = {};
747
+ contents = deserializeAws_json1_0ListSpeakerEnrollmentJobsResponse(data, context);
748
+ const response = {
749
+ $metadata: deserializeMetadata(output),
750
+ ...contents,
751
+ };
752
+ return Promise.resolve(response);
753
+ };
754
+ const deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError = async (output, context) => {
755
+ const parsedOutput = {
756
+ ...output,
757
+ body: await parseErrorBody(output.body, context),
758
+ };
759
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
760
+ switch (errorCode) {
761
+ case "AccessDeniedException":
762
+ case "com.amazonaws.voiceid#AccessDeniedException":
763
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
764
+ case "InternalServerException":
765
+ case "com.amazonaws.voiceid#InternalServerException":
766
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
767
+ case "ResourceNotFoundException":
768
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
769
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
770
+ case "ThrottlingException":
771
+ case "com.amazonaws.voiceid#ThrottlingException":
772
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
773
+ case "ValidationException":
774
+ case "com.amazonaws.voiceid#ValidationException":
775
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
776
+ default:
777
+ const parsedBody = parsedOutput.body;
778
+ throwDefaultError({
779
+ output,
780
+ parsedBody,
781
+ exceptionCtor: __BaseException,
782
+ errorCode,
783
+ });
784
+ }
785
+ };
786
+ export const deserializeAws_json1_0ListSpeakersCommand = async (output, context) => {
787
+ if (output.statusCode >= 300) {
788
+ return deserializeAws_json1_0ListSpeakersCommandError(output, context);
789
+ }
790
+ const data = await parseBody(output.body, context);
791
+ let contents = {};
792
+ contents = deserializeAws_json1_0ListSpeakersResponse(data, context);
793
+ const response = {
794
+ $metadata: deserializeMetadata(output),
795
+ ...contents,
796
+ };
797
+ return Promise.resolve(response);
798
+ };
799
+ const deserializeAws_json1_0ListSpeakersCommandError = async (output, context) => {
800
+ const parsedOutput = {
801
+ ...output,
802
+ body: await parseErrorBody(output.body, context),
803
+ };
804
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
805
+ switch (errorCode) {
806
+ case "AccessDeniedException":
807
+ case "com.amazonaws.voiceid#AccessDeniedException":
808
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
809
+ case "InternalServerException":
810
+ case "com.amazonaws.voiceid#InternalServerException":
811
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
812
+ case "ResourceNotFoundException":
813
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
814
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
815
+ case "ThrottlingException":
816
+ case "com.amazonaws.voiceid#ThrottlingException":
817
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
818
+ case "ValidationException":
819
+ case "com.amazonaws.voiceid#ValidationException":
820
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
821
+ default:
822
+ const parsedBody = parsedOutput.body;
823
+ throwDefaultError({
824
+ output,
825
+ parsedBody,
826
+ exceptionCtor: __BaseException,
827
+ errorCode,
828
+ });
829
+ }
830
+ };
831
+ export const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
832
+ if (output.statusCode >= 300) {
833
+ return deserializeAws_json1_0ListTagsForResourceCommandError(output, context);
834
+ }
835
+ const data = await parseBody(output.body, context);
836
+ let contents = {};
837
+ contents = deserializeAws_json1_0ListTagsForResourceResponse(data, context);
838
+ const response = {
839
+ $metadata: deserializeMetadata(output),
840
+ ...contents,
841
+ };
842
+ return Promise.resolve(response);
843
+ };
844
+ const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, context) => {
845
+ const parsedOutput = {
846
+ ...output,
847
+ body: await parseErrorBody(output.body, context),
848
+ };
849
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
850
+ switch (errorCode) {
851
+ case "AccessDeniedException":
852
+ case "com.amazonaws.voiceid#AccessDeniedException":
853
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
854
+ case "InternalServerException":
855
+ case "com.amazonaws.voiceid#InternalServerException":
856
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
857
+ case "ResourceNotFoundException":
858
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
859
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
860
+ case "ThrottlingException":
861
+ case "com.amazonaws.voiceid#ThrottlingException":
862
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
863
+ case "ValidationException":
864
+ case "com.amazonaws.voiceid#ValidationException":
865
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
866
+ default:
867
+ const parsedBody = parsedOutput.body;
868
+ throwDefaultError({
869
+ output,
870
+ parsedBody,
871
+ exceptionCtor: __BaseException,
872
+ errorCode,
873
+ });
874
+ }
875
+ };
876
+ export const deserializeAws_json1_0OptOutSpeakerCommand = async (output, context) => {
877
+ if (output.statusCode >= 300) {
878
+ return deserializeAws_json1_0OptOutSpeakerCommandError(output, context);
879
+ }
880
+ const data = await parseBody(output.body, context);
881
+ let contents = {};
882
+ contents = deserializeAws_json1_0OptOutSpeakerResponse(data, context);
883
+ const response = {
884
+ $metadata: deserializeMetadata(output),
885
+ ...contents,
886
+ };
887
+ return Promise.resolve(response);
888
+ };
889
+ const deserializeAws_json1_0OptOutSpeakerCommandError = async (output, context) => {
890
+ const parsedOutput = {
891
+ ...output,
892
+ body: await parseErrorBody(output.body, context),
893
+ };
894
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
895
+ switch (errorCode) {
896
+ case "AccessDeniedException":
897
+ case "com.amazonaws.voiceid#AccessDeniedException":
898
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
899
+ case "ConflictException":
900
+ case "com.amazonaws.voiceid#ConflictException":
901
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
902
+ case "InternalServerException":
903
+ case "com.amazonaws.voiceid#InternalServerException":
904
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
905
+ case "ResourceNotFoundException":
906
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
907
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
908
+ case "ServiceQuotaExceededException":
909
+ case "com.amazonaws.voiceid#ServiceQuotaExceededException":
910
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
911
+ case "ThrottlingException":
912
+ case "com.amazonaws.voiceid#ThrottlingException":
913
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
914
+ case "ValidationException":
915
+ case "com.amazonaws.voiceid#ValidationException":
916
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
917
+ default:
918
+ const parsedBody = parsedOutput.body;
919
+ throwDefaultError({
920
+ output,
921
+ parsedBody,
922
+ exceptionCtor: __BaseException,
923
+ errorCode,
924
+ });
925
+ }
926
+ };
927
+ export const deserializeAws_json1_0StartFraudsterRegistrationJobCommand = async (output, context) => {
928
+ if (output.statusCode >= 300) {
929
+ return deserializeAws_json1_0StartFraudsterRegistrationJobCommandError(output, context);
930
+ }
931
+ const data = await parseBody(output.body, context);
932
+ let contents = {};
933
+ contents = deserializeAws_json1_0StartFraudsterRegistrationJobResponse(data, context);
934
+ const response = {
935
+ $metadata: deserializeMetadata(output),
936
+ ...contents,
937
+ };
938
+ return Promise.resolve(response);
939
+ };
940
+ const deserializeAws_json1_0StartFraudsterRegistrationJobCommandError = async (output, context) => {
941
+ const parsedOutput = {
942
+ ...output,
943
+ body: await parseErrorBody(output.body, context),
944
+ };
945
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
946
+ switch (errorCode) {
947
+ case "AccessDeniedException":
948
+ case "com.amazonaws.voiceid#AccessDeniedException":
949
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
950
+ case "ConflictException":
951
+ case "com.amazonaws.voiceid#ConflictException":
952
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
953
+ case "InternalServerException":
954
+ case "com.amazonaws.voiceid#InternalServerException":
955
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
956
+ case "ResourceNotFoundException":
957
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
958
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
959
+ case "ServiceQuotaExceededException":
960
+ case "com.amazonaws.voiceid#ServiceQuotaExceededException":
961
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
962
+ case "ThrottlingException":
963
+ case "com.amazonaws.voiceid#ThrottlingException":
964
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
965
+ case "ValidationException":
966
+ case "com.amazonaws.voiceid#ValidationException":
967
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
968
+ default:
969
+ const parsedBody = parsedOutput.body;
970
+ throwDefaultError({
971
+ output,
972
+ parsedBody,
973
+ exceptionCtor: __BaseException,
974
+ errorCode,
975
+ });
976
+ }
977
+ };
978
+ export const deserializeAws_json1_0StartSpeakerEnrollmentJobCommand = async (output, context) => {
979
+ if (output.statusCode >= 300) {
980
+ return deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError(output, context);
981
+ }
982
+ const data = await parseBody(output.body, context);
983
+ let contents = {};
984
+ contents = deserializeAws_json1_0StartSpeakerEnrollmentJobResponse(data, context);
985
+ const response = {
986
+ $metadata: deserializeMetadata(output),
987
+ ...contents,
988
+ };
989
+ return Promise.resolve(response);
990
+ };
991
+ const deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError = async (output, context) => {
992
+ const parsedOutput = {
993
+ ...output,
994
+ body: await parseErrorBody(output.body, context),
995
+ };
996
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
997
+ switch (errorCode) {
998
+ case "AccessDeniedException":
999
+ case "com.amazonaws.voiceid#AccessDeniedException":
1000
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1001
+ case "ConflictException":
1002
+ case "com.amazonaws.voiceid#ConflictException":
1003
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
1004
+ case "InternalServerException":
1005
+ case "com.amazonaws.voiceid#InternalServerException":
1006
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1007
+ case "ResourceNotFoundException":
1008
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
1009
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1010
+ case "ServiceQuotaExceededException":
1011
+ case "com.amazonaws.voiceid#ServiceQuotaExceededException":
1012
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1013
+ case "ThrottlingException":
1014
+ case "com.amazonaws.voiceid#ThrottlingException":
1015
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1016
+ case "ValidationException":
1017
+ case "com.amazonaws.voiceid#ValidationException":
1018
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1019
+ default:
1020
+ const parsedBody = parsedOutput.body;
1021
+ throwDefaultError({
1022
+ output,
1023
+ parsedBody,
1024
+ exceptionCtor: __BaseException,
1025
+ errorCode,
1026
+ });
1027
+ }
1028
+ };
1029
+ export const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
1030
+ if (output.statusCode >= 300) {
1031
+ return deserializeAws_json1_0TagResourceCommandError(output, context);
1032
+ }
1033
+ const data = await parseBody(output.body, context);
1034
+ let contents = {};
1035
+ contents = deserializeAws_json1_0TagResourceResponse(data, context);
1036
+ const response = {
1037
+ $metadata: deserializeMetadata(output),
1038
+ ...contents,
1039
+ };
1040
+ return Promise.resolve(response);
1041
+ };
1042
+ const deserializeAws_json1_0TagResourceCommandError = async (output, context) => {
1043
+ const parsedOutput = {
1044
+ ...output,
1045
+ body: await parseErrorBody(output.body, context),
1046
+ };
1047
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1048
+ switch (errorCode) {
1049
+ case "AccessDeniedException":
1050
+ case "com.amazonaws.voiceid#AccessDeniedException":
1051
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1052
+ case "ConflictException":
1053
+ case "com.amazonaws.voiceid#ConflictException":
1054
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
1055
+ case "InternalServerException":
1056
+ case "com.amazonaws.voiceid#InternalServerException":
1057
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1058
+ case "ResourceNotFoundException":
1059
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
1060
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1061
+ case "ThrottlingException":
1062
+ case "com.amazonaws.voiceid#ThrottlingException":
1063
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1064
+ case "ValidationException":
1065
+ case "com.amazonaws.voiceid#ValidationException":
1066
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1067
+ default:
1068
+ const parsedBody = parsedOutput.body;
1069
+ throwDefaultError({
1070
+ output,
1071
+ parsedBody,
1072
+ exceptionCtor: __BaseException,
1073
+ errorCode,
1074
+ });
1075
+ }
1076
+ };
1077
+ export const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
1078
+ if (output.statusCode >= 300) {
1079
+ return deserializeAws_json1_0UntagResourceCommandError(output, context);
1080
+ }
1081
+ const data = await parseBody(output.body, context);
1082
+ let contents = {};
1083
+ contents = deserializeAws_json1_0UntagResourceResponse(data, context);
1084
+ const response = {
1085
+ $metadata: deserializeMetadata(output),
1086
+ ...contents,
1087
+ };
1088
+ return Promise.resolve(response);
1089
+ };
1090
+ const deserializeAws_json1_0UntagResourceCommandError = async (output, context) => {
1091
+ const parsedOutput = {
1092
+ ...output,
1093
+ body: await parseErrorBody(output.body, context),
1094
+ };
1095
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1096
+ switch (errorCode) {
1097
+ case "AccessDeniedException":
1098
+ case "com.amazonaws.voiceid#AccessDeniedException":
1099
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1100
+ case "ConflictException":
1101
+ case "com.amazonaws.voiceid#ConflictException":
1102
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
1103
+ case "InternalServerException":
1104
+ case "com.amazonaws.voiceid#InternalServerException":
1105
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1106
+ case "ResourceNotFoundException":
1107
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
1108
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1109
+ case "ThrottlingException":
1110
+ case "com.amazonaws.voiceid#ThrottlingException":
1111
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1112
+ case "ValidationException":
1113
+ case "com.amazonaws.voiceid#ValidationException":
1114
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1115
+ default:
1116
+ const parsedBody = parsedOutput.body;
1117
+ throwDefaultError({
1118
+ output,
1119
+ parsedBody,
1120
+ exceptionCtor: __BaseException,
1121
+ errorCode,
1122
+ });
1123
+ }
1124
+ };
1125
+ export const deserializeAws_json1_0UpdateDomainCommand = async (output, context) => {
1126
+ if (output.statusCode >= 300) {
1127
+ return deserializeAws_json1_0UpdateDomainCommandError(output, context);
1128
+ }
1129
+ const data = await parseBody(output.body, context);
1130
+ let contents = {};
1131
+ contents = deserializeAws_json1_0UpdateDomainResponse(data, context);
1132
+ const response = {
1133
+ $metadata: deserializeMetadata(output),
1134
+ ...contents,
1135
+ };
1136
+ return Promise.resolve(response);
1137
+ };
1138
+ const deserializeAws_json1_0UpdateDomainCommandError = async (output, context) => {
1139
+ const parsedOutput = {
1140
+ ...output,
1141
+ body: await parseErrorBody(output.body, context),
1142
+ };
1143
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1144
+ switch (errorCode) {
1145
+ case "AccessDeniedException":
1146
+ case "com.amazonaws.voiceid#AccessDeniedException":
1147
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1148
+ case "ConflictException":
1149
+ case "com.amazonaws.voiceid#ConflictException":
1150
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
1151
+ case "InternalServerException":
1152
+ case "com.amazonaws.voiceid#InternalServerException":
1153
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1154
+ case "ResourceNotFoundException":
1155
+ case "com.amazonaws.voiceid#ResourceNotFoundException":
1156
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1157
+ case "ThrottlingException":
1158
+ case "com.amazonaws.voiceid#ThrottlingException":
1159
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1160
+ case "ValidationException":
1161
+ case "com.amazonaws.voiceid#ValidationException":
1162
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1163
+ default:
1164
+ const parsedBody = parsedOutput.body;
1165
+ throwDefaultError({
1166
+ output,
1167
+ parsedBody,
1168
+ exceptionCtor: __BaseException,
1169
+ errorCode,
1170
+ });
1171
+ }
1172
+ };
1173
+ const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1174
+ const body = parsedOutput.body;
1175
+ const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
1176
+ const exception = new AccessDeniedException({
1177
+ $metadata: deserializeMetadata(parsedOutput),
1178
+ ...deserialized,
1179
+ });
1180
+ return __decorateServiceException(exception, body);
1181
+ };
1182
+ const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
1183
+ const body = parsedOutput.body;
1184
+ const deserialized = deserializeAws_json1_0ConflictException(body, context);
1185
+ const exception = new ConflictException({
1186
+ $metadata: deserializeMetadata(parsedOutput),
1187
+ ...deserialized,
1188
+ });
1189
+ return __decorateServiceException(exception, body);
1190
+ };
1191
+ const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
1192
+ const body = parsedOutput.body;
1193
+ const deserialized = deserializeAws_json1_0InternalServerException(body, context);
1194
+ const exception = new InternalServerException({
1195
+ $metadata: deserializeMetadata(parsedOutput),
1196
+ ...deserialized,
1197
+ });
1198
+ return __decorateServiceException(exception, body);
1199
+ };
1200
+ const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1201
+ const body = parsedOutput.body;
1202
+ const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
1203
+ const exception = new ResourceNotFoundException({
1204
+ $metadata: deserializeMetadata(parsedOutput),
1205
+ ...deserialized,
1206
+ });
1207
+ return __decorateServiceException(exception, body);
1208
+ };
1209
+ const deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1210
+ const body = parsedOutput.body;
1211
+ const deserialized = deserializeAws_json1_0ServiceQuotaExceededException(body, context);
1212
+ const exception = new ServiceQuotaExceededException({
1213
+ $metadata: deserializeMetadata(parsedOutput),
1214
+ ...deserialized,
1215
+ });
1216
+ return __decorateServiceException(exception, body);
1217
+ };
1218
+ const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
1219
+ const body = parsedOutput.body;
1220
+ const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
1221
+ const exception = new ThrottlingException({
1222
+ $metadata: deserializeMetadata(parsedOutput),
1223
+ ...deserialized,
1224
+ });
1225
+ return __decorateServiceException(exception, body);
1226
+ };
1227
+ const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
1228
+ const body = parsedOutput.body;
1229
+ const deserialized = deserializeAws_json1_0ValidationException(body, context);
1230
+ const exception = new ValidationException({
1231
+ $metadata: deserializeMetadata(parsedOutput),
1232
+ ...deserialized,
1233
+ });
1234
+ return __decorateServiceException(exception, body);
1235
+ };
1236
+ const serializeAws_json1_0CreateDomainRequest = (input, context) => {
1237
+ return {
1238
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
1239
+ ...(input.Description != null && { Description: input.Description }),
1240
+ ...(input.Name != null && { Name: input.Name }),
1241
+ ...(input.ServerSideEncryptionConfiguration != null && {
1242
+ ServerSideEncryptionConfiguration: serializeAws_json1_0ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context),
1243
+ }),
1244
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
1245
+ };
1246
+ };
1247
+ const serializeAws_json1_0DeleteDomainRequest = (input, context) => {
1248
+ return {
1249
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1250
+ };
1251
+ };
1252
+ const serializeAws_json1_0DeleteFraudsterRequest = (input, context) => {
1253
+ return {
1254
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1255
+ ...(input.FraudsterId != null && { FraudsterId: input.FraudsterId }),
1256
+ };
1257
+ };
1258
+ const serializeAws_json1_0DeleteSpeakerRequest = (input, context) => {
1259
+ return {
1260
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1261
+ ...(input.SpeakerId != null && { SpeakerId: input.SpeakerId }),
1262
+ };
1263
+ };
1264
+ const serializeAws_json1_0DescribeDomainRequest = (input, context) => {
1265
+ return {
1266
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1267
+ };
1268
+ };
1269
+ const serializeAws_json1_0DescribeFraudsterRegistrationJobRequest = (input, context) => {
1270
+ return {
1271
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1272
+ ...(input.JobId != null && { JobId: input.JobId }),
1273
+ };
1274
+ };
1275
+ const serializeAws_json1_0DescribeFraudsterRequest = (input, context) => {
1276
+ return {
1277
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1278
+ ...(input.FraudsterId != null && { FraudsterId: input.FraudsterId }),
1279
+ };
1280
+ };
1281
+ const serializeAws_json1_0DescribeSpeakerEnrollmentJobRequest = (input, context) => {
1282
+ return {
1283
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1284
+ ...(input.JobId != null && { JobId: input.JobId }),
1285
+ };
1286
+ };
1287
+ const serializeAws_json1_0DescribeSpeakerRequest = (input, context) => {
1288
+ return {
1289
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1290
+ ...(input.SpeakerId != null && { SpeakerId: input.SpeakerId }),
1291
+ };
1292
+ };
1293
+ const serializeAws_json1_0EnrollmentConfig = (input, context) => {
1294
+ return {
1295
+ ...(input.ExistingEnrollmentAction != null && { ExistingEnrollmentAction: input.ExistingEnrollmentAction }),
1296
+ ...(input.FraudDetectionConfig != null && {
1297
+ FraudDetectionConfig: serializeAws_json1_0EnrollmentJobFraudDetectionConfig(input.FraudDetectionConfig, context),
1298
+ }),
1299
+ };
1300
+ };
1301
+ const serializeAws_json1_0EnrollmentJobFraudDetectionConfig = (input, context) => {
1302
+ return {
1303
+ ...(input.FraudDetectionAction != null && { FraudDetectionAction: input.FraudDetectionAction }),
1304
+ ...(input.RiskThreshold != null && { RiskThreshold: input.RiskThreshold }),
1305
+ };
1306
+ };
1307
+ const serializeAws_json1_0EvaluateSessionRequest = (input, context) => {
1308
+ return {
1309
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1310
+ ...(input.SessionNameOrId != null && { SessionNameOrId: input.SessionNameOrId }),
1311
+ };
1312
+ };
1313
+ const serializeAws_json1_0InputDataConfig = (input, context) => {
1314
+ return {
1315
+ ...(input.S3Uri != null && { S3Uri: input.S3Uri }),
1316
+ };
1317
+ };
1318
+ const serializeAws_json1_0ListDomainsRequest = (input, context) => {
1319
+ return {
1320
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1321
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1322
+ };
1323
+ };
1324
+ const serializeAws_json1_0ListFraudsterRegistrationJobsRequest = (input, context) => {
1325
+ return {
1326
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1327
+ ...(input.JobStatus != null && { JobStatus: input.JobStatus }),
1328
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1329
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1330
+ };
1331
+ };
1332
+ const serializeAws_json1_0ListSpeakerEnrollmentJobsRequest = (input, context) => {
1333
+ return {
1334
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1335
+ ...(input.JobStatus != null && { JobStatus: input.JobStatus }),
1336
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1337
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1338
+ };
1822
1339
  };
1823
- var serializeAws_json1_0OptOutSpeakerRequest = function (input, context) {
1824
- return __assign(__assign({}, (input.DomainId != null && { DomainId: input.DomainId })), (input.SpeakerId != null && { SpeakerId: input.SpeakerId }));
1340
+ const serializeAws_json1_0ListSpeakersRequest = (input, context) => {
1341
+ return {
1342
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1343
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1344
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1345
+ };
1825
1346
  };
1826
- var serializeAws_json1_0OutputDataConfig = function (input, context) {
1827
- return __assign(__assign({}, (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId })), (input.S3Uri != null && { S3Uri: input.S3Uri }));
1347
+ const serializeAws_json1_0ListTagsForResourceRequest = (input, context) => {
1348
+ return {
1349
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
1350
+ };
1828
1351
  };
1829
- var serializeAws_json1_0RegistrationConfig = function (input, context) {
1830
- return __assign(__assign({}, (input.DuplicateRegistrationAction != null && {
1831
- DuplicateRegistrationAction: input.DuplicateRegistrationAction,
1832
- })), (input.FraudsterSimilarityThreshold != null && {
1833
- FraudsterSimilarityThreshold: input.FraudsterSimilarityThreshold,
1834
- }));
1352
+ const serializeAws_json1_0OptOutSpeakerRequest = (input, context) => {
1353
+ return {
1354
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1355
+ ...(input.SpeakerId != null && { SpeakerId: input.SpeakerId }),
1356
+ };
1835
1357
  };
1836
- var serializeAws_json1_0ServerSideEncryptionConfiguration = function (input, context) {
1837
- return __assign({}, (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }));
1358
+ const serializeAws_json1_0OutputDataConfig = (input, context) => {
1359
+ return {
1360
+ ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
1361
+ ...(input.S3Uri != null && { S3Uri: input.S3Uri }),
1362
+ };
1838
1363
  };
1839
- var serializeAws_json1_0StartFraudsterRegistrationJobRequest = function (input, context) {
1840
- var _a;
1841
- return __assign(__assign(__assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn })), (input.DomainId != null && { DomainId: input.DomainId })), (input.InputDataConfig != null && {
1842
- InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
1843
- })), (input.JobName != null && { JobName: input.JobName })), (input.OutputDataConfig != null && {
1844
- OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
1845
- })), (input.RegistrationConfig != null && {
1846
- RegistrationConfig: serializeAws_json1_0RegistrationConfig(input.RegistrationConfig, context),
1847
- }));
1364
+ const serializeAws_json1_0RegistrationConfig = (input, context) => {
1365
+ return {
1366
+ ...(input.DuplicateRegistrationAction != null && {
1367
+ DuplicateRegistrationAction: input.DuplicateRegistrationAction,
1368
+ }),
1369
+ ...(input.FraudsterSimilarityThreshold != null && {
1370
+ FraudsterSimilarityThreshold: input.FraudsterSimilarityThreshold,
1371
+ }),
1372
+ };
1848
1373
  };
1849
- var serializeAws_json1_0StartSpeakerEnrollmentJobRequest = function (input, context) {
1850
- var _a;
1851
- return __assign(__assign(__assign(__assign(__assign(__assign({ ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn })), (input.DomainId != null && { DomainId: input.DomainId })), (input.EnrollmentConfig != null && {
1852
- EnrollmentConfig: serializeAws_json1_0EnrollmentConfig(input.EnrollmentConfig, context),
1853
- })), (input.InputDataConfig != null && {
1854
- InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
1855
- })), (input.JobName != null && { JobName: input.JobName })), (input.OutputDataConfig != null && {
1856
- OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
1857
- }));
1374
+ const serializeAws_json1_0ServerSideEncryptionConfiguration = (input, context) => {
1375
+ return {
1376
+ ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
1377
+ };
1378
+ };
1379
+ const serializeAws_json1_0StartFraudsterRegistrationJobRequest = (input, context) => {
1380
+ return {
1381
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
1382
+ ...(input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn }),
1383
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1384
+ ...(input.InputDataConfig != null && {
1385
+ InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
1386
+ }),
1387
+ ...(input.JobName != null && { JobName: input.JobName }),
1388
+ ...(input.OutputDataConfig != null && {
1389
+ OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
1390
+ }),
1391
+ ...(input.RegistrationConfig != null && {
1392
+ RegistrationConfig: serializeAws_json1_0RegistrationConfig(input.RegistrationConfig, context),
1393
+ }),
1394
+ };
1858
1395
  };
1859
- var serializeAws_json1_0Tag = function (input, context) {
1860
- return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
1396
+ const serializeAws_json1_0StartSpeakerEnrollmentJobRequest = (input, context) => {
1397
+ return {
1398
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
1399
+ ...(input.DataAccessRoleArn != null && { DataAccessRoleArn: input.DataAccessRoleArn }),
1400
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1401
+ ...(input.EnrollmentConfig != null && {
1402
+ EnrollmentConfig: serializeAws_json1_0EnrollmentConfig(input.EnrollmentConfig, context),
1403
+ }),
1404
+ ...(input.InputDataConfig != null && {
1405
+ InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context),
1406
+ }),
1407
+ ...(input.JobName != null && { JobName: input.JobName }),
1408
+ ...(input.OutputDataConfig != null && {
1409
+ OutputDataConfig: serializeAws_json1_0OutputDataConfig(input.OutputDataConfig, context),
1410
+ }),
1411
+ };
1861
1412
  };
1862
- var serializeAws_json1_0TagKeyList = function (input, context) {
1413
+ const serializeAws_json1_0Tag = (input, context) => {
1414
+ return {
1415
+ ...(input.Key != null && { Key: input.Key }),
1416
+ ...(input.Value != null && { Value: input.Value }),
1417
+ };
1418
+ };
1419
+ const serializeAws_json1_0TagKeyList = (input, context) => {
1863
1420
  return input
1864
- .filter(function (e) { return e != null; })
1865
- .map(function (entry) {
1421
+ .filter((e) => e != null)
1422
+ .map((entry) => {
1866
1423
  return entry;
1867
1424
  });
1868
1425
  };
1869
- var serializeAws_json1_0TagList = function (input, context) {
1426
+ const serializeAws_json1_0TagList = (input, context) => {
1870
1427
  return input
1871
- .filter(function (e) { return e != null; })
1872
- .map(function (entry) {
1428
+ .filter((e) => e != null)
1429
+ .map((entry) => {
1873
1430
  return serializeAws_json1_0Tag(entry, context);
1874
1431
  });
1875
1432
  };
1876
- var serializeAws_json1_0TagResourceRequest = function (input, context) {
1877
- return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }));
1433
+ const serializeAws_json1_0TagResourceRequest = (input, context) => {
1434
+ return {
1435
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
1436
+ ...(input.Tags != null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }),
1437
+ };
1878
1438
  };
1879
- var serializeAws_json1_0UntagResourceRequest = function (input, context) {
1880
- return __assign(__assign({}, (input.ResourceArn != null && { ResourceArn: input.ResourceArn })), (input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }));
1439
+ const serializeAws_json1_0UntagResourceRequest = (input, context) => {
1440
+ return {
1441
+ ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
1442
+ ...(input.TagKeys != null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }),
1443
+ };
1881
1444
  };
1882
- var serializeAws_json1_0UpdateDomainRequest = function (input, context) {
1883
- return __assign(__assign(__assign(__assign({}, (input.Description != null && { Description: input.Description })), (input.DomainId != null && { DomainId: input.DomainId })), (input.Name != null && { Name: input.Name })), (input.ServerSideEncryptionConfiguration != null && {
1884
- ServerSideEncryptionConfiguration: serializeAws_json1_0ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context),
1885
- }));
1445
+ const serializeAws_json1_0UpdateDomainRequest = (input, context) => {
1446
+ return {
1447
+ ...(input.Description != null && { Description: input.Description }),
1448
+ ...(input.DomainId != null && { DomainId: input.DomainId }),
1449
+ ...(input.Name != null && { Name: input.Name }),
1450
+ ...(input.ServerSideEncryptionConfiguration != null && {
1451
+ ServerSideEncryptionConfiguration: serializeAws_json1_0ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context),
1452
+ }),
1453
+ };
1886
1454
  };
1887
- var deserializeAws_json1_0AccessDeniedException = function (output, context) {
1455
+ const deserializeAws_json1_0AccessDeniedException = (output, context) => {
1888
1456
  return {
1889
1457
  Message: __expectString(output.Message),
1890
1458
  };
1891
1459
  };
1892
- var deserializeAws_json1_0AuthenticationConfiguration = function (output, context) {
1460
+ const deserializeAws_json1_0AuthenticationConfiguration = (output, context) => {
1893
1461
  return {
1894
1462
  AcceptanceThreshold: __expectInt32(output.AcceptanceThreshold),
1895
1463
  };
1896
1464
  };
1897
- var deserializeAws_json1_0AuthenticationResult = function (output, context) {
1465
+ const deserializeAws_json1_0AuthenticationResult = (output, context) => {
1898
1466
  return {
1899
1467
  AudioAggregationEndedAt: output.AudioAggregationEndedAt != null
1900
1468
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AudioAggregationEndedAt)))
@@ -1912,43 +1480,43 @@ var deserializeAws_json1_0AuthenticationResult = function (output, context) {
1912
1480
  Score: __expectInt32(output.Score),
1913
1481
  };
1914
1482
  };
1915
- var deserializeAws_json1_0ConflictException = function (output, context) {
1483
+ const deserializeAws_json1_0ConflictException = (output, context) => {
1916
1484
  return {
1917
1485
  ConflictType: __expectString(output.ConflictType),
1918
1486
  Message: __expectString(output.Message),
1919
1487
  };
1920
1488
  };
1921
- var deserializeAws_json1_0CreateDomainResponse = function (output, context) {
1489
+ const deserializeAws_json1_0CreateDomainResponse = (output, context) => {
1922
1490
  return {
1923
1491
  Domain: output.Domain != null ? deserializeAws_json1_0Domain(output.Domain, context) : undefined,
1924
1492
  };
1925
1493
  };
1926
- var deserializeAws_json1_0DescribeDomainResponse = function (output, context) {
1494
+ const deserializeAws_json1_0DescribeDomainResponse = (output, context) => {
1927
1495
  return {
1928
1496
  Domain: output.Domain != null ? deserializeAws_json1_0Domain(output.Domain, context) : undefined,
1929
1497
  };
1930
1498
  };
1931
- var deserializeAws_json1_0DescribeFraudsterRegistrationJobResponse = function (output, context) {
1499
+ const deserializeAws_json1_0DescribeFraudsterRegistrationJobResponse = (output, context) => {
1932
1500
  return {
1933
1501
  Job: output.Job != null ? deserializeAws_json1_0FraudsterRegistrationJob(output.Job, context) : undefined,
1934
1502
  };
1935
1503
  };
1936
- var deserializeAws_json1_0DescribeFraudsterResponse = function (output, context) {
1504
+ const deserializeAws_json1_0DescribeFraudsterResponse = (output, context) => {
1937
1505
  return {
1938
1506
  Fraudster: output.Fraudster != null ? deserializeAws_json1_0Fraudster(output.Fraudster, context) : undefined,
1939
1507
  };
1940
1508
  };
1941
- var deserializeAws_json1_0DescribeSpeakerEnrollmentJobResponse = function (output, context) {
1509
+ const deserializeAws_json1_0DescribeSpeakerEnrollmentJobResponse = (output, context) => {
1942
1510
  return {
1943
1511
  Job: output.Job != null ? deserializeAws_json1_0SpeakerEnrollmentJob(output.Job, context) : undefined,
1944
1512
  };
1945
1513
  };
1946
- var deserializeAws_json1_0DescribeSpeakerResponse = function (output, context) {
1514
+ const deserializeAws_json1_0DescribeSpeakerResponse = (output, context) => {
1947
1515
  return {
1948
1516
  Speaker: output.Speaker != null ? deserializeAws_json1_0Speaker(output.Speaker, context) : undefined,
1949
1517
  };
1950
1518
  };
1951
- var deserializeAws_json1_0Domain = function (output, context) {
1519
+ const deserializeAws_json1_0Domain = (output, context) => {
1952
1520
  return {
1953
1521
  Arn: __expectString(output.Arn),
1954
1522
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
@@ -1965,10 +1533,10 @@ var deserializeAws_json1_0Domain = function (output, context) {
1965
1533
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
1966
1534
  };
1967
1535
  };
1968
- var deserializeAws_json1_0DomainSummaries = function (output, context) {
1969
- var retVal = (output || [])
1970
- .filter(function (e) { return e != null; })
1971
- .map(function (entry) {
1536
+ const deserializeAws_json1_0DomainSummaries = (output, context) => {
1537
+ const retVal = (output || [])
1538
+ .filter((e) => e != null)
1539
+ .map((entry) => {
1972
1540
  if (entry === null) {
1973
1541
  return null;
1974
1542
  }
@@ -1976,7 +1544,7 @@ var deserializeAws_json1_0DomainSummaries = function (output, context) {
1976
1544
  });
1977
1545
  return retVal;
1978
1546
  };
1979
- var deserializeAws_json1_0DomainSummary = function (output, context) {
1547
+ const deserializeAws_json1_0DomainSummary = (output, context) => {
1980
1548
  return {
1981
1549
  Arn: __expectString(output.Arn),
1982
1550
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
@@ -1993,7 +1561,7 @@ var deserializeAws_json1_0DomainSummary = function (output, context) {
1993
1561
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
1994
1562
  };
1995
1563
  };
1996
- var deserializeAws_json1_0EnrollmentConfig = function (output, context) {
1564
+ const deserializeAws_json1_0EnrollmentConfig = (output, context) => {
1997
1565
  return {
1998
1566
  ExistingEnrollmentAction: __expectString(output.ExistingEnrollmentAction),
1999
1567
  FraudDetectionConfig: output.FraudDetectionConfig != null
@@ -2001,13 +1569,13 @@ var deserializeAws_json1_0EnrollmentConfig = function (output, context) {
2001
1569
  : undefined,
2002
1570
  };
2003
1571
  };
2004
- var deserializeAws_json1_0EnrollmentJobFraudDetectionConfig = function (output, context) {
1572
+ const deserializeAws_json1_0EnrollmentJobFraudDetectionConfig = (output, context) => {
2005
1573
  return {
2006
1574
  FraudDetectionAction: __expectString(output.FraudDetectionAction),
2007
1575
  RiskThreshold: __expectInt32(output.RiskThreshold),
2008
1576
  };
2009
1577
  };
2010
- var deserializeAws_json1_0EvaluateSessionResponse = function (output, context) {
1578
+ const deserializeAws_json1_0EvaluateSessionResponse = (output, context) => {
2011
1579
  return {
2012
1580
  AuthenticationResult: output.AuthenticationResult != null
2013
1581
  ? deserializeAws_json1_0AuthenticationResult(output.AuthenticationResult, context)
@@ -2021,21 +1589,21 @@ var deserializeAws_json1_0EvaluateSessionResponse = function (output, context) {
2021
1589
  StreamingStatus: __expectString(output.StreamingStatus),
2022
1590
  };
2023
1591
  };
2024
- var deserializeAws_json1_0FailureDetails = function (output, context) {
1592
+ const deserializeAws_json1_0FailureDetails = (output, context) => {
2025
1593
  return {
2026
1594
  Message: __expectString(output.Message),
2027
1595
  StatusCode: __expectInt32(output.StatusCode),
2028
1596
  };
2029
1597
  };
2030
- var deserializeAws_json1_0FraudDetectionConfiguration = function (output, context) {
1598
+ const deserializeAws_json1_0FraudDetectionConfiguration = (output, context) => {
2031
1599
  return {
2032
1600
  RiskThreshold: __expectInt32(output.RiskThreshold),
2033
1601
  };
2034
1602
  };
2035
- var deserializeAws_json1_0FraudDetectionReasons = function (output, context) {
2036
- var retVal = (output || [])
2037
- .filter(function (e) { return e != null; })
2038
- .map(function (entry) {
1603
+ const deserializeAws_json1_0FraudDetectionReasons = (output, context) => {
1604
+ const retVal = (output || [])
1605
+ .filter((e) => e != null)
1606
+ .map((entry) => {
2039
1607
  if (entry === null) {
2040
1608
  return null;
2041
1609
  }
@@ -2043,7 +1611,7 @@ var deserializeAws_json1_0FraudDetectionReasons = function (output, context) {
2043
1611
  });
2044
1612
  return retVal;
2045
1613
  };
2046
- var deserializeAws_json1_0FraudDetectionResult = function (output, context) {
1614
+ const deserializeAws_json1_0FraudDetectionResult = (output, context) => {
2047
1615
  return {
2048
1616
  AudioAggregationEndedAt: output.AudioAggregationEndedAt != null
2049
1617
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AudioAggregationEndedAt)))
@@ -2060,7 +1628,7 @@ var deserializeAws_json1_0FraudDetectionResult = function (output, context) {
2060
1628
  RiskDetails: output.RiskDetails != null ? deserializeAws_json1_0FraudRiskDetails(output.RiskDetails, context) : undefined,
2061
1629
  };
2062
1630
  };
2063
- var deserializeAws_json1_0FraudRiskDetails = function (output, context) {
1631
+ const deserializeAws_json1_0FraudRiskDetails = (output, context) => {
2064
1632
  return {
2065
1633
  KnownFraudsterRisk: output.KnownFraudsterRisk != null
2066
1634
  ? deserializeAws_json1_0KnownFraudsterRisk(output.KnownFraudsterRisk, context)
@@ -2070,14 +1638,14 @@ var deserializeAws_json1_0FraudRiskDetails = function (output, context) {
2070
1638
  : undefined,
2071
1639
  };
2072
1640
  };
2073
- var deserializeAws_json1_0Fraudster = function (output, context) {
1641
+ const deserializeAws_json1_0Fraudster = (output, context) => {
2074
1642
  return {
2075
1643
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2076
1644
  DomainId: __expectString(output.DomainId),
2077
1645
  GeneratedFraudsterId: __expectString(output.GeneratedFraudsterId),
2078
1646
  };
2079
1647
  };
2080
- var deserializeAws_json1_0FraudsterRegistrationJob = function (output, context) {
1648
+ const deserializeAws_json1_0FraudsterRegistrationJob = (output, context) => {
2081
1649
  return {
2082
1650
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2083
1651
  DataAccessRoleArn: __expectString(output.DataAccessRoleArn),
@@ -2099,10 +1667,10 @@ var deserializeAws_json1_0FraudsterRegistrationJob = function (output, context)
2099
1667
  : undefined,
2100
1668
  };
2101
1669
  };
2102
- var deserializeAws_json1_0FraudsterRegistrationJobSummaries = function (output, context) {
2103
- var retVal = (output || [])
2104
- .filter(function (e) { return e != null; })
2105
- .map(function (entry) {
1670
+ const deserializeAws_json1_0FraudsterRegistrationJobSummaries = (output, context) => {
1671
+ const retVal = (output || [])
1672
+ .filter((e) => e != null)
1673
+ .map((entry) => {
2106
1674
  if (entry === null) {
2107
1675
  return null;
2108
1676
  }
@@ -2110,7 +1678,7 @@ var deserializeAws_json1_0FraudsterRegistrationJobSummaries = function (output,
2110
1678
  });
2111
1679
  return retVal;
2112
1680
  };
2113
- var deserializeAws_json1_0FraudsterRegistrationJobSummary = function (output, context) {
1681
+ const deserializeAws_json1_0FraudsterRegistrationJobSummary = (output, context) => {
2114
1682
  return {
2115
1683
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2116
1684
  DomainId: __expectString(output.DomainId),
@@ -2122,28 +1690,28 @@ var deserializeAws_json1_0FraudsterRegistrationJobSummary = function (output, co
2122
1690
  JobStatus: __expectString(output.JobStatus),
2123
1691
  };
2124
1692
  };
2125
- var deserializeAws_json1_0InputDataConfig = function (output, context) {
1693
+ const deserializeAws_json1_0InputDataConfig = (output, context) => {
2126
1694
  return {
2127
1695
  S3Uri: __expectString(output.S3Uri),
2128
1696
  };
2129
1697
  };
2130
- var deserializeAws_json1_0InternalServerException = function (output, context) {
1698
+ const deserializeAws_json1_0InternalServerException = (output, context) => {
2131
1699
  return {
2132
1700
  Message: __expectString(output.Message),
2133
1701
  };
2134
1702
  };
2135
- var deserializeAws_json1_0JobProgress = function (output, context) {
1703
+ const deserializeAws_json1_0JobProgress = (output, context) => {
2136
1704
  return {
2137
1705
  PercentComplete: __expectInt32(output.PercentComplete),
2138
1706
  };
2139
1707
  };
2140
- var deserializeAws_json1_0KnownFraudsterRisk = function (output, context) {
1708
+ const deserializeAws_json1_0KnownFraudsterRisk = (output, context) => {
2141
1709
  return {
2142
1710
  GeneratedFraudsterId: __expectString(output.GeneratedFraudsterId),
2143
1711
  RiskScore: __expectInt32(output.RiskScore),
2144
1712
  };
2145
1713
  };
2146
- var deserializeAws_json1_0ListDomainsResponse = function (output, context) {
1714
+ const deserializeAws_json1_0ListDomainsResponse = (output, context) => {
2147
1715
  return {
2148
1716
  DomainSummaries: output.DomainSummaries != null
2149
1717
  ? deserializeAws_json1_0DomainSummaries(output.DomainSummaries, context)
@@ -2151,7 +1719,7 @@ var deserializeAws_json1_0ListDomainsResponse = function (output, context) {
2151
1719
  NextToken: __expectString(output.NextToken),
2152
1720
  };
2153
1721
  };
2154
- var deserializeAws_json1_0ListFraudsterRegistrationJobsResponse = function (output, context) {
1722
+ const deserializeAws_json1_0ListFraudsterRegistrationJobsResponse = (output, context) => {
2155
1723
  return {
2156
1724
  JobSummaries: output.JobSummaries != null
2157
1725
  ? deserializeAws_json1_0FraudsterRegistrationJobSummaries(output.JobSummaries, context)
@@ -2159,7 +1727,7 @@ var deserializeAws_json1_0ListFraudsterRegistrationJobsResponse = function (outp
2159
1727
  NextToken: __expectString(output.NextToken),
2160
1728
  };
2161
1729
  };
2162
- var deserializeAws_json1_0ListSpeakerEnrollmentJobsResponse = function (output, context) {
1730
+ const deserializeAws_json1_0ListSpeakerEnrollmentJobsResponse = (output, context) => {
2163
1731
  return {
2164
1732
  JobSummaries: output.JobSummaries != null
2165
1733
  ? deserializeAws_json1_0SpeakerEnrollmentJobSummaries(output.JobSummaries, context)
@@ -2167,7 +1735,7 @@ var deserializeAws_json1_0ListSpeakerEnrollmentJobsResponse = function (output,
2167
1735
  NextToken: __expectString(output.NextToken),
2168
1736
  };
2169
1737
  };
2170
- var deserializeAws_json1_0ListSpeakersResponse = function (output, context) {
1738
+ const deserializeAws_json1_0ListSpeakersResponse = (output, context) => {
2171
1739
  return {
2172
1740
  NextToken: __expectString(output.NextToken),
2173
1741
  SpeakerSummaries: output.SpeakerSummaries != null
@@ -2175,52 +1743,52 @@ var deserializeAws_json1_0ListSpeakersResponse = function (output, context) {
2175
1743
  : undefined,
2176
1744
  };
2177
1745
  };
2178
- var deserializeAws_json1_0ListTagsForResourceResponse = function (output, context) {
1746
+ const deserializeAws_json1_0ListTagsForResourceResponse = (output, context) => {
2179
1747
  return {
2180
1748
  Tags: output.Tags != null ? deserializeAws_json1_0TagList(output.Tags, context) : undefined,
2181
1749
  };
2182
1750
  };
2183
- var deserializeAws_json1_0OptOutSpeakerResponse = function (output, context) {
1751
+ const deserializeAws_json1_0OptOutSpeakerResponse = (output, context) => {
2184
1752
  return {
2185
1753
  Speaker: output.Speaker != null ? deserializeAws_json1_0Speaker(output.Speaker, context) : undefined,
2186
1754
  };
2187
1755
  };
2188
- var deserializeAws_json1_0OutputDataConfig = function (output, context) {
1756
+ const deserializeAws_json1_0OutputDataConfig = (output, context) => {
2189
1757
  return {
2190
1758
  KmsKeyId: __expectString(output.KmsKeyId),
2191
1759
  S3Uri: __expectString(output.S3Uri),
2192
1760
  };
2193
1761
  };
2194
- var deserializeAws_json1_0RegistrationConfig = function (output, context) {
1762
+ const deserializeAws_json1_0RegistrationConfig = (output, context) => {
2195
1763
  return {
2196
1764
  DuplicateRegistrationAction: __expectString(output.DuplicateRegistrationAction),
2197
1765
  FraudsterSimilarityThreshold: __expectInt32(output.FraudsterSimilarityThreshold),
2198
1766
  };
2199
1767
  };
2200
- var deserializeAws_json1_0ResourceNotFoundException = function (output, context) {
1768
+ const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
2201
1769
  return {
2202
1770
  Message: __expectString(output.Message),
2203
1771
  ResourceType: __expectString(output.ResourceType),
2204
1772
  };
2205
1773
  };
2206
- var deserializeAws_json1_0ServerSideEncryptionConfiguration = function (output, context) {
1774
+ const deserializeAws_json1_0ServerSideEncryptionConfiguration = (output, context) => {
2207
1775
  return {
2208
1776
  KmsKeyId: __expectString(output.KmsKeyId),
2209
1777
  };
2210
1778
  };
2211
- var deserializeAws_json1_0ServerSideEncryptionUpdateDetails = function (output, context) {
1779
+ const deserializeAws_json1_0ServerSideEncryptionUpdateDetails = (output, context) => {
2212
1780
  return {
2213
1781
  Message: __expectString(output.Message),
2214
1782
  OldKmsKeyId: __expectString(output.OldKmsKeyId),
2215
1783
  UpdateStatus: __expectString(output.UpdateStatus),
2216
1784
  };
2217
1785
  };
2218
- var deserializeAws_json1_0ServiceQuotaExceededException = function (output, context) {
1786
+ const deserializeAws_json1_0ServiceQuotaExceededException = (output, context) => {
2219
1787
  return {
2220
1788
  Message: __expectString(output.Message),
2221
1789
  };
2222
1790
  };
2223
- var deserializeAws_json1_0Speaker = function (output, context) {
1791
+ const deserializeAws_json1_0Speaker = (output, context) => {
2224
1792
  return {
2225
1793
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2226
1794
  CustomerSpeakerId: __expectString(output.CustomerSpeakerId),
@@ -2233,7 +1801,7 @@ var deserializeAws_json1_0Speaker = function (output, context) {
2233
1801
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
2234
1802
  };
2235
1803
  };
2236
- var deserializeAws_json1_0SpeakerEnrollmentJob = function (output, context) {
1804
+ const deserializeAws_json1_0SpeakerEnrollmentJob = (output, context) => {
2237
1805
  return {
2238
1806
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2239
1807
  DataAccessRoleArn: __expectString(output.DataAccessRoleArn),
@@ -2255,10 +1823,10 @@ var deserializeAws_json1_0SpeakerEnrollmentJob = function (output, context) {
2255
1823
  : undefined,
2256
1824
  };
2257
1825
  };
2258
- var deserializeAws_json1_0SpeakerEnrollmentJobSummaries = function (output, context) {
2259
- var retVal = (output || [])
2260
- .filter(function (e) { return e != null; })
2261
- .map(function (entry) {
1826
+ const deserializeAws_json1_0SpeakerEnrollmentJobSummaries = (output, context) => {
1827
+ const retVal = (output || [])
1828
+ .filter((e) => e != null)
1829
+ .map((entry) => {
2262
1830
  if (entry === null) {
2263
1831
  return null;
2264
1832
  }
@@ -2266,7 +1834,7 @@ var deserializeAws_json1_0SpeakerEnrollmentJobSummaries = function (output, cont
2266
1834
  });
2267
1835
  return retVal;
2268
1836
  };
2269
- var deserializeAws_json1_0SpeakerEnrollmentJobSummary = function (output, context) {
1837
+ const deserializeAws_json1_0SpeakerEnrollmentJobSummary = (output, context) => {
2270
1838
  return {
2271
1839
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2272
1840
  DomainId: __expectString(output.DomainId),
@@ -2278,10 +1846,10 @@ var deserializeAws_json1_0SpeakerEnrollmentJobSummary = function (output, contex
2278
1846
  JobStatus: __expectString(output.JobStatus),
2279
1847
  };
2280
1848
  };
2281
- var deserializeAws_json1_0SpeakerSummaries = function (output, context) {
2282
- var retVal = (output || [])
2283
- .filter(function (e) { return e != null; })
2284
- .map(function (entry) {
1849
+ const deserializeAws_json1_0SpeakerSummaries = (output, context) => {
1850
+ const retVal = (output || [])
1851
+ .filter((e) => e != null)
1852
+ .map((entry) => {
2285
1853
  if (entry === null) {
2286
1854
  return null;
2287
1855
  }
@@ -2289,7 +1857,7 @@ var deserializeAws_json1_0SpeakerSummaries = function (output, context) {
2289
1857
  });
2290
1858
  return retVal;
2291
1859
  };
2292
- var deserializeAws_json1_0SpeakerSummary = function (output, context) {
1860
+ const deserializeAws_json1_0SpeakerSummary = (output, context) => {
2293
1861
  return {
2294
1862
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
2295
1863
  CustomerSpeakerId: __expectString(output.CustomerSpeakerId),
@@ -2302,26 +1870,26 @@ var deserializeAws_json1_0SpeakerSummary = function (output, context) {
2302
1870
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
2303
1871
  };
2304
1872
  };
2305
- var deserializeAws_json1_0StartFraudsterRegistrationJobResponse = function (output, context) {
1873
+ const deserializeAws_json1_0StartFraudsterRegistrationJobResponse = (output, context) => {
2306
1874
  return {
2307
1875
  Job: output.Job != null ? deserializeAws_json1_0FraudsterRegistrationJob(output.Job, context) : undefined,
2308
1876
  };
2309
1877
  };
2310
- var deserializeAws_json1_0StartSpeakerEnrollmentJobResponse = function (output, context) {
1878
+ const deserializeAws_json1_0StartSpeakerEnrollmentJobResponse = (output, context) => {
2311
1879
  return {
2312
1880
  Job: output.Job != null ? deserializeAws_json1_0SpeakerEnrollmentJob(output.Job, context) : undefined,
2313
1881
  };
2314
1882
  };
2315
- var deserializeAws_json1_0Tag = function (output, context) {
1883
+ const deserializeAws_json1_0Tag = (output, context) => {
2316
1884
  return {
2317
1885
  Key: __expectString(output.Key),
2318
1886
  Value: __expectString(output.Value),
2319
1887
  };
2320
1888
  };
2321
- var deserializeAws_json1_0TagList = function (output, context) {
2322
- var retVal = (output || [])
2323
- .filter(function (e) { return e != null; })
2324
- .map(function (entry) {
1889
+ const deserializeAws_json1_0TagList = (output, context) => {
1890
+ const retVal = (output || [])
1891
+ .filter((e) => e != null)
1892
+ .map((entry) => {
2325
1893
  if (entry === null) {
2326
1894
  return null;
2327
1895
  }
@@ -2329,101 +1897,78 @@ var deserializeAws_json1_0TagList = function (output, context) {
2329
1897
  });
2330
1898
  return retVal;
2331
1899
  };
2332
- var deserializeAws_json1_0TagResourceResponse = function (output, context) {
1900
+ const deserializeAws_json1_0TagResourceResponse = (output, context) => {
2333
1901
  return {};
2334
1902
  };
2335
- var deserializeAws_json1_0ThrottlingException = function (output, context) {
1903
+ const deserializeAws_json1_0ThrottlingException = (output, context) => {
2336
1904
  return {
2337
1905
  Message: __expectString(output.Message),
2338
1906
  };
2339
1907
  };
2340
- var deserializeAws_json1_0UntagResourceResponse = function (output, context) {
1908
+ const deserializeAws_json1_0UntagResourceResponse = (output, context) => {
2341
1909
  return {};
2342
1910
  };
2343
- var deserializeAws_json1_0UpdateDomainResponse = function (output, context) {
1911
+ const deserializeAws_json1_0UpdateDomainResponse = (output, context) => {
2344
1912
  return {
2345
1913
  Domain: output.Domain != null ? deserializeAws_json1_0Domain(output.Domain, context) : undefined,
2346
1914
  };
2347
1915
  };
2348
- var deserializeAws_json1_0ValidationException = function (output, context) {
1916
+ const deserializeAws_json1_0ValidationException = (output, context) => {
2349
1917
  return {
2350
1918
  Message: __expectString(output.Message),
2351
1919
  };
2352
1920
  };
2353
- var deserializeAws_json1_0VoiceSpoofingRisk = function (output, context) {
1921
+ const deserializeAws_json1_0VoiceSpoofingRisk = (output, context) => {
2354
1922
  return {
2355
1923
  RiskScore: __expectInt32(output.RiskScore),
2356
1924
  };
2357
1925
  };
2358
- var deserializeMetadata = function (output) {
2359
- var _a, _b;
2360
- return ({
2361
- httpStatusCode: output.statusCode,
2362
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
2363
- extendedRequestId: output.headers["x-amz-id-2"],
2364
- cfId: output.headers["x-amz-cf-id"],
2365
- });
2366
- };
2367
- var collectBody = function (streamBody, context) {
2368
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1926
+ const deserializeMetadata = (output) => ({
1927
+ httpStatusCode: output.statusCode,
1928
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1929
+ extendedRequestId: output.headers["x-amz-id-2"],
1930
+ cfId: output.headers["x-amz-cf-id"],
1931
+ });
1932
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2369
1933
  if (streamBody instanceof Uint8Array) {
2370
1934
  return Promise.resolve(streamBody);
2371
1935
  }
2372
1936
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2373
1937
  };
2374
- var collectBodyString = function (streamBody, context) {
2375
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2376
- };
2377
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
2378
- var _a, hostname, _b, protocol, port, basePath, contents;
2379
- return __generator(this, function (_c) {
2380
- switch (_c.label) {
2381
- case 0: return [4, context.endpoint()];
2382
- case 1:
2383
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
2384
- contents = {
2385
- protocol: protocol,
2386
- hostname: hostname,
2387
- port: port,
2388
- method: "POST",
2389
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2390
- headers: headers,
2391
- };
2392
- if (resolvedHostname !== undefined) {
2393
- contents.hostname = resolvedHostname;
2394
- }
2395
- if (body !== undefined) {
2396
- contents.body = body;
2397
- }
2398
- return [2, new __HttpRequest(contents)];
2399
- }
2400
- });
2401
- }); };
2402
- var parseBody = function (streamBody, context) {
2403
- return collectBodyString(streamBody, context).then(function (encoded) {
2404
- if (encoded.length) {
2405
- return JSON.parse(encoded);
2406
- }
2407
- return {};
2408
- });
1938
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1939
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1940
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1941
+ const contents = {
1942
+ protocol,
1943
+ hostname,
1944
+ port,
1945
+ method: "POST",
1946
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1947
+ headers,
1948
+ };
1949
+ if (resolvedHostname !== undefined) {
1950
+ contents.hostname = resolvedHostname;
1951
+ }
1952
+ if (body !== undefined) {
1953
+ contents.body = body;
1954
+ }
1955
+ return new __HttpRequest(contents);
2409
1956
  };
2410
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2411
- var value;
2412
- var _a;
2413
- return __generator(this, function (_b) {
2414
- switch (_b.label) {
2415
- case 0: return [4, parseBody(errorBody, context)];
2416
- case 1:
2417
- value = _b.sent();
2418
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2419
- return [2, value];
2420
- }
2421
- });
2422
- }); };
2423
- var loadRestJsonErrorCode = function (output, data) {
2424
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2425
- var sanitizeErrorCode = function (rawValue) {
2426
- var cleanValue = rawValue;
1957
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1958
+ if (encoded.length) {
1959
+ return JSON.parse(encoded);
1960
+ }
1961
+ return {};
1962
+ });
1963
+ const parseErrorBody = async (errorBody, context) => {
1964
+ const value = await parseBody(errorBody, context);
1965
+ value.message = value.message ?? value.Message;
1966
+ return value;
1967
+ };
1968
+ const loadRestJsonErrorCode = (output, data) => {
1969
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1970
+ const sanitizeErrorCode = (rawValue) => {
1971
+ let cleanValue = rawValue;
2427
1972
  if (typeof cleanValue === "number") {
2428
1973
  cleanValue = cleanValue.toString();
2429
1974
  }
@@ -2438,7 +1983,7 @@ var loadRestJsonErrorCode = function (output, data) {
2438
1983
  }
2439
1984
  return cleanValue;
2440
1985
  };
2441
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1986
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2442
1987
  if (headerKey !== undefined) {
2443
1988
  return sanitizeErrorCode(output.headers[headerKey]);
2444
1989
  }