@aws-sdk/client-lex-runtime-service 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@ const se_GetSessionCommand = async (input, context) => {
33
33
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botName", () => input.botName, "{botName}", false);
34
34
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
35
35
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
36
- const query = map({
36
+ const query = (0, smithy_client_1.map)({
37
37
  checkpointLabelFilter: [, input.checkpointLabelFilter],
38
38
  });
39
39
  let body;
@@ -51,7 +51,7 @@ const se_GetSessionCommand = async (input, context) => {
51
51
  exports.se_GetSessionCommand = se_GetSessionCommand;
52
52
  const se_PostContentCommand = async (input, context) => {
53
53
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
- const headers = map({}, isSerializableHeaderValue, {
54
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
55
55
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
56
56
  "content-type": input.contentType || "application/octet-stream",
57
57
  "x-amz-lex-session-attributes": [
@@ -99,12 +99,12 @@ const se_PostTextCommand = async (input, context) => {
99
99
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
100
100
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
101
101
  let body;
102
- body = JSON.stringify({
103
- ...(input.activeContexts != null && { activeContexts: se_ActiveContextsList(input.activeContexts, context) }),
104
- ...(input.inputText != null && { inputText: input.inputText }),
105
- ...(input.requestAttributes != null && { requestAttributes: se_StringMap(input.requestAttributes, context) }),
106
- ...(input.sessionAttributes != null && { sessionAttributes: se_StringMap(input.sessionAttributes, context) }),
107
- });
102
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
103
+ activeContexts: (_) => (0, smithy_client_1._json)(_),
104
+ inputText: [],
105
+ requestAttributes: (_) => (0, smithy_client_1._json)(_),
106
+ sessionAttributes: (_) => (0, smithy_client_1._json)(_),
107
+ }));
108
108
  return new protocol_http_1.HttpRequest({
109
109
  protocol,
110
110
  hostname,
@@ -118,7 +118,7 @@ const se_PostTextCommand = async (input, context) => {
118
118
  exports.se_PostTextCommand = se_PostTextCommand;
119
119
  const se_PutSessionCommand = async (input, context) => {
120
120
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
- const headers = map({}, isSerializableHeaderValue, {
121
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
122
122
  "content-type": "application/json",
123
123
  accept: input.accept,
124
124
  });
@@ -128,14 +128,12 @@ const se_PutSessionCommand = async (input, context) => {
128
128
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "botAlias", () => input.botAlias, "{botAlias}", false);
129
129
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "userId", () => input.userId, "{userId}", false);
130
130
  let body;
131
- body = JSON.stringify({
132
- ...(input.activeContexts != null && { activeContexts: se_ActiveContextsList(input.activeContexts, context) }),
133
- ...(input.dialogAction != null && { dialogAction: se_DialogAction(input.dialogAction, context) }),
134
- ...(input.recentIntentSummaryView != null && {
135
- recentIntentSummaryView: se_IntentSummaryList(input.recentIntentSummaryView, context),
136
- }),
137
- ...(input.sessionAttributes != null && { sessionAttributes: se_StringMap(input.sessionAttributes, context) }),
138
- });
131
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
132
+ activeContexts: (_) => (0, smithy_client_1._json)(_),
133
+ dialogAction: (_) => (0, smithy_client_1._json)(_),
134
+ recentIntentSummaryView: (_) => (0, smithy_client_1._json)(_),
135
+ sessionAttributes: (_) => (0, smithy_client_1._json)(_),
136
+ }));
139
137
  return new protocol_http_1.HttpRequest({
140
138
  protocol,
141
139
  hostname,
@@ -151,22 +149,17 @@ const de_DeleteSessionCommand = async (output, context) => {
151
149
  if (output.statusCode !== 200 && output.statusCode >= 300) {
152
150
  return de_DeleteSessionCommandError(output, context);
153
151
  }
154
- const contents = map({
152
+ const contents = (0, smithy_client_1.map)({
155
153
  $metadata: deserializeMetadata(output),
156
154
  });
157
155
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
158
- if (data.botAlias != null) {
159
- contents.botAlias = (0, smithy_client_1.expectString)(data.botAlias);
160
- }
161
- if (data.botName != null) {
162
- contents.botName = (0, smithy_client_1.expectString)(data.botName);
163
- }
164
- if (data.sessionId != null) {
165
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
166
- }
167
- if (data.userId != null) {
168
- contents.userId = (0, smithy_client_1.expectString)(data.userId);
169
- }
156
+ const doc = (0, smithy_client_1.take)(data, {
157
+ botAlias: smithy_client_1.expectString,
158
+ botName: smithy_client_1.expectString,
159
+ sessionId: smithy_client_1.expectString,
160
+ userId: smithy_client_1.expectString,
161
+ });
162
+ Object.assign(contents, doc);
170
163
  return contents;
171
164
  };
172
165
  exports.de_DeleteSessionCommand = de_DeleteSessionCommand;
@@ -194,10 +187,9 @@ const de_DeleteSessionCommandError = async (output, context) => {
194
187
  throw await de_NotFoundExceptionRes(parsedOutput, context);
195
188
  default:
196
189
  const parsedBody = parsedOutput.body;
197
- (0, smithy_client_1.throwDefaultError)({
190
+ return throwDefaultError({
198
191
  output,
199
192
  parsedBody,
200
- exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
201
193
  errorCode,
202
194
  });
203
195
  }
@@ -206,25 +198,18 @@ const de_GetSessionCommand = async (output, context) => {
206
198
  if (output.statusCode !== 200 && output.statusCode >= 300) {
207
199
  return de_GetSessionCommandError(output, context);
208
200
  }
209
- const contents = map({
201
+ const contents = (0, smithy_client_1.map)({
210
202
  $metadata: deserializeMetadata(output),
211
203
  });
212
204
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
213
- if (data.activeContexts != null) {
214
- contents.activeContexts = de_ActiveContextsList(data.activeContexts, context);
215
- }
216
- if (data.dialogAction != null) {
217
- contents.dialogAction = de_DialogAction(data.dialogAction, context);
218
- }
219
- if (data.recentIntentSummaryView != null) {
220
- contents.recentIntentSummaryView = de_IntentSummaryList(data.recentIntentSummaryView, context);
221
- }
222
- if (data.sessionAttributes != null) {
223
- contents.sessionAttributes = de_StringMap(data.sessionAttributes, context);
224
- }
225
- if (data.sessionId != null) {
226
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
227
- }
205
+ const doc = (0, smithy_client_1.take)(data, {
206
+ activeContexts: smithy_client_1._json,
207
+ dialogAction: smithy_client_1._json,
208
+ recentIntentSummaryView: smithy_client_1._json,
209
+ sessionAttributes: smithy_client_1._json,
210
+ sessionId: smithy_client_1.expectString,
211
+ });
212
+ Object.assign(contents, doc);
228
213
  return contents;
229
214
  };
230
215
  exports.de_GetSessionCommand = de_GetSessionCommand;
@@ -249,10 +234,9 @@ const de_GetSessionCommandError = async (output, context) => {
249
234
  throw await de_NotFoundExceptionRes(parsedOutput, context);
250
235
  default:
251
236
  const parsedBody = parsedOutput.body;
252
- (0, smithy_client_1.throwDefaultError)({
237
+ return throwDefaultError({
253
238
  output,
254
239
  parsedBody,
255
- exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
256
240
  errorCode,
257
241
  });
258
242
  }
@@ -261,7 +245,7 @@ const de_PostContentCommand = async (output, context) => {
261
245
  if (output.statusCode !== 200 && output.statusCode >= 300) {
262
246
  return de_PostContentCommandError(output, context);
263
247
  }
264
- const contents = map({
248
+ const contents = (0, smithy_client_1.map)({
265
249
  $metadata: deserializeMetadata(output),
266
250
  contentType: [, output.headers["content-type"]],
267
251
  intentName: [, output.headers["x-amz-lex-intent-name"]],
@@ -344,10 +328,9 @@ const de_PostContentCommandError = async (output, context) => {
344
328
  throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context);
345
329
  default:
346
330
  const parsedBody = parsedOutput.body;
347
- (0, smithy_client_1.throwDefaultError)({
331
+ return throwDefaultError({
348
332
  output,
349
333
  parsedBody,
350
- exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
351
334
  errorCode,
352
335
  });
353
336
  }
@@ -356,52 +339,27 @@ const de_PostTextCommand = async (output, context) => {
356
339
  if (output.statusCode !== 200 && output.statusCode >= 300) {
357
340
  return de_PostTextCommandError(output, context);
358
341
  }
359
- const contents = map({
342
+ const contents = (0, smithy_client_1.map)({
360
343
  $metadata: deserializeMetadata(output),
361
344
  });
362
345
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
363
- if (data.activeContexts != null) {
364
- contents.activeContexts = de_ActiveContextsList(data.activeContexts, context);
365
- }
366
- if (data.alternativeIntents != null) {
367
- contents.alternativeIntents = de_IntentList(data.alternativeIntents, context);
368
- }
369
- if (data.botVersion != null) {
370
- contents.botVersion = (0, smithy_client_1.expectString)(data.botVersion);
371
- }
372
- if (data.dialogState != null) {
373
- contents.dialogState = (0, smithy_client_1.expectString)(data.dialogState);
374
- }
375
- if (data.intentName != null) {
376
- contents.intentName = (0, smithy_client_1.expectString)(data.intentName);
377
- }
378
- if (data.message != null) {
379
- contents.message = (0, smithy_client_1.expectString)(data.message);
380
- }
381
- if (data.messageFormat != null) {
382
- contents.messageFormat = (0, smithy_client_1.expectString)(data.messageFormat);
383
- }
384
- if (data.nluIntentConfidence != null) {
385
- contents.nluIntentConfidence = de_IntentConfidence(data.nluIntentConfidence, context);
386
- }
387
- if (data.responseCard != null) {
388
- contents.responseCard = de_ResponseCard(data.responseCard, context);
389
- }
390
- if (data.sentimentResponse != null) {
391
- contents.sentimentResponse = de_SentimentResponse(data.sentimentResponse, context);
392
- }
393
- if (data.sessionAttributes != null) {
394
- contents.sessionAttributes = de_StringMap(data.sessionAttributes, context);
395
- }
396
- if (data.sessionId != null) {
397
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
398
- }
399
- if (data.slotToElicit != null) {
400
- contents.slotToElicit = (0, smithy_client_1.expectString)(data.slotToElicit);
401
- }
402
- if (data.slots != null) {
403
- contents.slots = de_StringMap(data.slots, context);
404
- }
346
+ const doc = (0, smithy_client_1.take)(data, {
347
+ activeContexts: smithy_client_1._json,
348
+ alternativeIntents: (_) => de_IntentList(_, context),
349
+ botVersion: smithy_client_1.expectString,
350
+ dialogState: smithy_client_1.expectString,
351
+ intentName: smithy_client_1.expectString,
352
+ message: smithy_client_1.expectString,
353
+ messageFormat: smithy_client_1.expectString,
354
+ nluIntentConfidence: (_) => de_IntentConfidence(_, context),
355
+ responseCard: smithy_client_1._json,
356
+ sentimentResponse: smithy_client_1._json,
357
+ sessionAttributes: smithy_client_1._json,
358
+ sessionId: smithy_client_1.expectString,
359
+ slotToElicit: smithy_client_1.expectString,
360
+ slots: smithy_client_1._json,
361
+ });
362
+ Object.assign(contents, doc);
405
363
  return contents;
406
364
  };
407
365
  exports.de_PostTextCommand = de_PostTextCommand;
@@ -438,10 +396,9 @@ const de_PostTextCommandError = async (output, context) => {
438
396
  throw await de_NotFoundExceptionRes(parsedOutput, context);
439
397
  default:
440
398
  const parsedBody = parsedOutput.body;
441
- (0, smithy_client_1.throwDefaultError)({
399
+ return throwDefaultError({
442
400
  output,
443
401
  parsedBody,
444
- exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
445
402
  errorCode,
446
403
  });
447
404
  }
@@ -450,7 +407,7 @@ const de_PutSessionCommand = async (output, context) => {
450
407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
451
408
  return de_PutSessionCommandError(output, context);
452
409
  }
453
- const contents = map({
410
+ const contents = (0, smithy_client_1.map)({
454
411
  $metadata: deserializeMetadata(output),
455
412
  contentType: [, output.headers["content-type"]],
456
413
  intentName: [, output.headers["x-amz-lex-intent-name"]],
@@ -512,21 +469,21 @@ const de_PutSessionCommandError = async (output, context) => {
512
469
  throw await de_NotFoundExceptionRes(parsedOutput, context);
513
470
  default:
514
471
  const parsedBody = parsedOutput.body;
515
- (0, smithy_client_1.throwDefaultError)({
472
+ return throwDefaultError({
516
473
  output,
517
474
  parsedBody,
518
- exceptionCtor: LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException,
519
475
  errorCode,
520
476
  });
521
477
  }
522
478
  };
523
- const map = smithy_client_1.map;
479
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(LexRuntimeServiceServiceException_1.LexRuntimeServiceServiceException);
524
480
  const de_BadGatewayExceptionRes = async (parsedOutput, context) => {
525
- const contents = map({});
481
+ const contents = (0, smithy_client_1.map)({});
526
482
  const data = parsedOutput.body;
527
- if (data.Message != null) {
528
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
529
- }
483
+ const doc = (0, smithy_client_1.take)(data, {
484
+ Message: smithy_client_1.expectString,
485
+ });
486
+ Object.assign(contents, doc);
530
487
  const exception = new models_0_1.BadGatewayException({
531
488
  $metadata: deserializeMetadata(parsedOutput),
532
489
  ...contents,
@@ -534,11 +491,12 @@ const de_BadGatewayExceptionRes = async (parsedOutput, context) => {
534
491
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
535
492
  };
536
493
  const de_BadRequestExceptionRes = async (parsedOutput, context) => {
537
- const contents = map({});
494
+ const contents = (0, smithy_client_1.map)({});
538
495
  const data = parsedOutput.body;
539
- if (data.message != null) {
540
- contents.message = (0, smithy_client_1.expectString)(data.message);
541
- }
496
+ const doc = (0, smithy_client_1.take)(data, {
497
+ message: smithy_client_1.expectString,
498
+ });
499
+ Object.assign(contents, doc);
542
500
  const exception = new models_0_1.BadRequestException({
543
501
  $metadata: deserializeMetadata(parsedOutput),
544
502
  ...contents,
@@ -546,11 +504,12 @@ const de_BadRequestExceptionRes = async (parsedOutput, context) => {
546
504
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
547
505
  };
548
506
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
549
- const contents = map({});
507
+ const contents = (0, smithy_client_1.map)({});
550
508
  const data = parsedOutput.body;
551
- if (data.message != null) {
552
- contents.message = (0, smithy_client_1.expectString)(data.message);
553
- }
509
+ const doc = (0, smithy_client_1.take)(data, {
510
+ message: smithy_client_1.expectString,
511
+ });
512
+ Object.assign(contents, doc);
554
513
  const exception = new models_0_1.ConflictException({
555
514
  $metadata: deserializeMetadata(parsedOutput),
556
515
  ...contents,
@@ -558,11 +517,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
558
517
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
559
518
  };
560
519
  const de_DependencyFailedExceptionRes = async (parsedOutput, context) => {
561
- const contents = map({});
520
+ const contents = (0, smithy_client_1.map)({});
562
521
  const data = parsedOutput.body;
563
- if (data.Message != null) {
564
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
565
- }
522
+ const doc = (0, smithy_client_1.take)(data, {
523
+ Message: smithy_client_1.expectString,
524
+ });
525
+ Object.assign(contents, doc);
566
526
  const exception = new models_0_1.DependencyFailedException({
567
527
  $metadata: deserializeMetadata(parsedOutput),
568
528
  ...contents,
@@ -570,11 +530,12 @@ const de_DependencyFailedExceptionRes = async (parsedOutput, context) => {
570
530
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
571
531
  };
572
532
  const de_InternalFailureExceptionRes = async (parsedOutput, context) => {
573
- const contents = map({});
533
+ const contents = (0, smithy_client_1.map)({});
574
534
  const data = parsedOutput.body;
575
- if (data.message != null) {
576
- contents.message = (0, smithy_client_1.expectString)(data.message);
577
- }
535
+ const doc = (0, smithy_client_1.take)(data, {
536
+ message: smithy_client_1.expectString,
537
+ });
538
+ Object.assign(contents, doc);
578
539
  const exception = new models_0_1.InternalFailureException({
579
540
  $metadata: deserializeMetadata(parsedOutput),
580
541
  ...contents,
@@ -582,13 +543,14 @@ const de_InternalFailureExceptionRes = async (parsedOutput, context) => {
582
543
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
583
544
  };
584
545
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
585
- const contents = map({
546
+ const contents = (0, smithy_client_1.map)({
586
547
  retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
587
548
  });
588
549
  const data = parsedOutput.body;
589
- if (data.message != null) {
590
- contents.message = (0, smithy_client_1.expectString)(data.message);
591
- }
550
+ const doc = (0, smithy_client_1.take)(data, {
551
+ message: smithy_client_1.expectString,
552
+ });
553
+ Object.assign(contents, doc);
592
554
  const exception = new models_0_1.LimitExceededException({
593
555
  $metadata: deserializeMetadata(parsedOutput),
594
556
  ...contents,
@@ -596,11 +558,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
596
558
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
597
559
  };
598
560
  const de_LoopDetectedExceptionRes = async (parsedOutput, context) => {
599
- const contents = map({});
561
+ const contents = (0, smithy_client_1.map)({});
600
562
  const data = parsedOutput.body;
601
- if (data.Message != null) {
602
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
603
- }
563
+ const doc = (0, smithy_client_1.take)(data, {
564
+ Message: smithy_client_1.expectString,
565
+ });
566
+ Object.assign(contents, doc);
604
567
  const exception = new models_0_1.LoopDetectedException({
605
568
  $metadata: deserializeMetadata(parsedOutput),
606
569
  ...contents,
@@ -608,11 +571,12 @@ const de_LoopDetectedExceptionRes = async (parsedOutput, context) => {
608
571
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
609
572
  };
610
573
  const de_NotAcceptableExceptionRes = async (parsedOutput, context) => {
611
- const contents = map({});
574
+ const contents = (0, smithy_client_1.map)({});
612
575
  const data = parsedOutput.body;
613
- if (data.message != null) {
614
- contents.message = (0, smithy_client_1.expectString)(data.message);
615
- }
576
+ const doc = (0, smithy_client_1.take)(data, {
577
+ message: smithy_client_1.expectString,
578
+ });
579
+ Object.assign(contents, doc);
616
580
  const exception = new models_0_1.NotAcceptableException({
617
581
  $metadata: deserializeMetadata(parsedOutput),
618
582
  ...contents,
@@ -620,11 +584,12 @@ const de_NotAcceptableExceptionRes = async (parsedOutput, context) => {
620
584
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
621
585
  };
622
586
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
623
- const contents = map({});
587
+ const contents = (0, smithy_client_1.map)({});
624
588
  const data = parsedOutput.body;
625
- if (data.message != null) {
626
- contents.message = (0, smithy_client_1.expectString)(data.message);
627
- }
589
+ const doc = (0, smithy_client_1.take)(data, {
590
+ message: smithy_client_1.expectString,
591
+ });
592
+ Object.assign(contents, doc);
628
593
  const exception = new models_0_1.NotFoundException({
629
594
  $metadata: deserializeMetadata(parsedOutput),
630
595
  ...contents,
@@ -632,11 +597,12 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
632
597
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
633
598
  };
634
599
  const de_RequestTimeoutExceptionRes = async (parsedOutput, context) => {
635
- const contents = map({});
600
+ const contents = (0, smithy_client_1.map)({});
636
601
  const data = parsedOutput.body;
637
- if (data.message != null) {
638
- contents.message = (0, smithy_client_1.expectString)(data.message);
639
- }
602
+ const doc = (0, smithy_client_1.take)(data, {
603
+ message: smithy_client_1.expectString,
604
+ });
605
+ Object.assign(contents, doc);
640
606
  const exception = new models_0_1.RequestTimeoutException({
641
607
  $metadata: deserializeMetadata(parsedOutput),
642
608
  ...contents,
@@ -644,231 +610,37 @@ const de_RequestTimeoutExceptionRes = async (parsedOutput, context) => {
644
610
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
645
611
  };
646
612
  const de_UnsupportedMediaTypeExceptionRes = async (parsedOutput, context) => {
647
- const contents = map({});
613
+ const contents = (0, smithy_client_1.map)({});
648
614
  const data = parsedOutput.body;
649
- if (data.message != null) {
650
- contents.message = (0, smithy_client_1.expectString)(data.message);
651
- }
615
+ const doc = (0, smithy_client_1.take)(data, {
616
+ message: smithy_client_1.expectString,
617
+ });
618
+ Object.assign(contents, doc);
652
619
  const exception = new models_0_1.UnsupportedMediaTypeException({
653
620
  $metadata: deserializeMetadata(parsedOutput),
654
621
  ...contents,
655
622
  });
656
623
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
657
624
  };
658
- const se_ActiveContext = (input, context) => {
659
- return {
660
- ...(input.name != null && { name: input.name }),
661
- ...(input.parameters != null && { parameters: se_ActiveContextParametersMap(input.parameters, context) }),
662
- ...(input.timeToLive != null && { timeToLive: se_ActiveContextTimeToLive(input.timeToLive, context) }),
663
- };
664
- };
665
- const se_ActiveContextParametersMap = (input, context) => {
666
- return Object.entries(input).reduce((acc, [key, value]) => {
667
- if (value === null) {
668
- return acc;
669
- }
670
- acc[key] = value;
671
- return acc;
672
- }, {});
673
- };
674
- const se_ActiveContextsList = (input, context) => {
675
- return input
676
- .filter((e) => e != null)
677
- .map((entry) => {
678
- return se_ActiveContext(entry, context);
679
- });
680
- };
681
- const se_ActiveContextTimeToLive = (input, context) => {
682
- return {
683
- ...(input.timeToLiveInSeconds != null && { timeToLiveInSeconds: input.timeToLiveInSeconds }),
684
- ...(input.turnsToLive != null && { turnsToLive: input.turnsToLive }),
685
- };
686
- };
687
- const se_DialogAction = (input, context) => {
688
- return {
689
- ...(input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState }),
690
- ...(input.intentName != null && { intentName: input.intentName }),
691
- ...(input.message != null && { message: input.message }),
692
- ...(input.messageFormat != null && { messageFormat: input.messageFormat }),
693
- ...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
694
- ...(input.slots != null && { slots: se_StringMap(input.slots, context) }),
695
- ...(input.type != null && { type: input.type }),
696
- };
697
- };
698
- const se_IntentSummary = (input, context) => {
699
- return {
700
- ...(input.checkpointLabel != null && { checkpointLabel: input.checkpointLabel }),
701
- ...(input.confirmationStatus != null && { confirmationStatus: input.confirmationStatus }),
702
- ...(input.dialogActionType != null && { dialogActionType: input.dialogActionType }),
703
- ...(input.fulfillmentState != null && { fulfillmentState: input.fulfillmentState }),
704
- ...(input.intentName != null && { intentName: input.intentName }),
705
- ...(input.slotToElicit != null && { slotToElicit: input.slotToElicit }),
706
- ...(input.slots != null && { slots: se_StringMap(input.slots, context) }),
707
- };
708
- };
709
- const se_IntentSummaryList = (input, context) => {
710
- return input
711
- .filter((e) => e != null)
712
- .map((entry) => {
713
- return se_IntentSummary(entry, context);
714
- });
715
- };
716
- const se_StringMap = (input, context) => {
717
- return Object.entries(input).reduce((acc, [key, value]) => {
718
- if (value === null) {
719
- return acc;
720
- }
721
- acc[key] = value;
722
- return acc;
723
- }, {});
724
- };
725
- const de_ActiveContext = (output, context) => {
726
- return {
727
- name: (0, smithy_client_1.expectString)(output.name),
728
- parameters: output.parameters != null ? de_ActiveContextParametersMap(output.parameters, context) : undefined,
729
- timeToLive: output.timeToLive != null ? de_ActiveContextTimeToLive(output.timeToLive, context) : undefined,
730
- };
731
- };
732
- const de_ActiveContextParametersMap = (output, context) => {
733
- return Object.entries(output).reduce((acc, [key, value]) => {
734
- if (value === null) {
735
- return acc;
736
- }
737
- acc[key] = (0, smithy_client_1.expectString)(value);
738
- return acc;
739
- }, {});
740
- };
741
- const de_ActiveContextsList = (output, context) => {
742
- const retVal = (output || [])
743
- .filter((e) => e != null)
744
- .map((entry) => {
745
- if (entry === null) {
746
- return null;
747
- }
748
- return de_ActiveContext(entry, context);
749
- });
750
- return retVal;
751
- };
752
- const de_ActiveContextTimeToLive = (output, context) => {
753
- return {
754
- timeToLiveInSeconds: (0, smithy_client_1.expectInt32)(output.timeToLiveInSeconds),
755
- turnsToLive: (0, smithy_client_1.expectInt32)(output.turnsToLive),
756
- };
757
- };
758
- const de_Button = (output, context) => {
759
- return {
760
- text: (0, smithy_client_1.expectString)(output.text),
761
- value: (0, smithy_client_1.expectString)(output.value),
762
- };
763
- };
764
- const de_DialogAction = (output, context) => {
765
- return {
766
- fulfillmentState: (0, smithy_client_1.expectString)(output.fulfillmentState),
767
- intentName: (0, smithy_client_1.expectString)(output.intentName),
768
- message: (0, smithy_client_1.expectString)(output.message),
769
- messageFormat: (0, smithy_client_1.expectString)(output.messageFormat),
770
- slotToElicit: (0, smithy_client_1.expectString)(output.slotToElicit),
771
- slots: output.slots != null ? de_StringMap(output.slots, context) : undefined,
772
- type: (0, smithy_client_1.expectString)(output.type),
773
- };
774
- };
775
- const de_GenericAttachment = (output, context) => {
776
- return {
777
- attachmentLinkUrl: (0, smithy_client_1.expectString)(output.attachmentLinkUrl),
778
- buttons: output.buttons != null ? de_listOfButtons(output.buttons, context) : undefined,
779
- imageUrl: (0, smithy_client_1.expectString)(output.imageUrl),
780
- subTitle: (0, smithy_client_1.expectString)(output.subTitle),
781
- title: (0, smithy_client_1.expectString)(output.title),
782
- };
783
- };
784
- const de_genericAttachmentList = (output, context) => {
785
- const retVal = (output || [])
786
- .filter((e) => e != null)
787
- .map((entry) => {
788
- if (entry === null) {
789
- return null;
790
- }
791
- return de_GenericAttachment(entry, context);
792
- });
793
- return retVal;
794
- };
795
625
  const de_IntentConfidence = (output, context) => {
796
- return {
797
- score: (0, smithy_client_1.limitedParseDouble)(output.score),
798
- };
626
+ return (0, smithy_client_1.take)(output, {
627
+ score: smithy_client_1.limitedParseDouble,
628
+ });
799
629
  };
800
630
  const de_IntentList = (output, context) => {
801
631
  const retVal = (output || [])
802
632
  .filter((e) => e != null)
803
633
  .map((entry) => {
804
- if (entry === null) {
805
- return null;
806
- }
807
634
  return de_PredictedIntent(entry, context);
808
635
  });
809
636
  return retVal;
810
637
  };
811
- const de_IntentSummary = (output, context) => {
812
- return {
813
- checkpointLabel: (0, smithy_client_1.expectString)(output.checkpointLabel),
814
- confirmationStatus: (0, smithy_client_1.expectString)(output.confirmationStatus),
815
- dialogActionType: (0, smithy_client_1.expectString)(output.dialogActionType),
816
- fulfillmentState: (0, smithy_client_1.expectString)(output.fulfillmentState),
817
- intentName: (0, smithy_client_1.expectString)(output.intentName),
818
- slotToElicit: (0, smithy_client_1.expectString)(output.slotToElicit),
819
- slots: output.slots != null ? de_StringMap(output.slots, context) : undefined,
820
- };
821
- };
822
- const de_IntentSummaryList = (output, context) => {
823
- const retVal = (output || [])
824
- .filter((e) => e != null)
825
- .map((entry) => {
826
- if (entry === null) {
827
- return null;
828
- }
829
- return de_IntentSummary(entry, context);
830
- });
831
- return retVal;
832
- };
833
- const de_listOfButtons = (output, context) => {
834
- const retVal = (output || [])
835
- .filter((e) => e != null)
836
- .map((entry) => {
837
- if (entry === null) {
838
- return null;
839
- }
840
- return de_Button(entry, context);
841
- });
842
- return retVal;
843
- };
844
638
  const de_PredictedIntent = (output, context) => {
845
- return {
846
- intentName: (0, smithy_client_1.expectString)(output.intentName),
847
- nluIntentConfidence: output.nluIntentConfidence != null ? de_IntentConfidence(output.nluIntentConfidence, context) : undefined,
848
- slots: output.slots != null ? de_StringMap(output.slots, context) : undefined,
849
- };
850
- };
851
- const de_ResponseCard = (output, context) => {
852
- return {
853
- contentType: (0, smithy_client_1.expectString)(output.contentType),
854
- genericAttachments: output.genericAttachments != null ? de_genericAttachmentList(output.genericAttachments, context) : undefined,
855
- version: (0, smithy_client_1.expectString)(output.version),
856
- };
857
- };
858
- const de_SentimentResponse = (output, context) => {
859
- return {
860
- sentimentLabel: (0, smithy_client_1.expectString)(output.sentimentLabel),
861
- sentimentScore: (0, smithy_client_1.expectString)(output.sentimentScore),
862
- };
863
- };
864
- const de_StringMap = (output, context) => {
865
- return Object.entries(output).reduce((acc, [key, value]) => {
866
- if (value === null) {
867
- return acc;
868
- }
869
- acc[key] = (0, smithy_client_1.expectString)(value);
870
- return acc;
871
- }, {});
639
+ return (0, smithy_client_1.take)(output, {
640
+ intentName: smithy_client_1.expectString,
641
+ nluIntentConfidence: (_) => de_IntentConfidence(_, context),
642
+ slots: smithy_client_1._json,
643
+ });
872
644
  };
873
645
  const deserializeMetadata = (output) => ({
874
646
  httpStatusCode: output.statusCode,