@aws-sdk/client-lex-runtime-service 3.30.0 → 3.34.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 (72) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/cjs/LexRuntimeService.spec.js +1 -1
  3. package/dist/cjs/LexRuntimeService.spec.js.map +1 -1
  4. package/dist/cjs/LexRuntimeServiceClient.js +13 -13
  5. package/dist/cjs/LexRuntimeServiceClient.js.map +1 -1
  6. package/dist/cjs/commands/DeleteSessionCommand.js +3 -3
  7. package/dist/cjs/commands/DeleteSessionCommand.js.map +1 -1
  8. package/dist/cjs/commands/GetSessionCommand.js +3 -3
  9. package/dist/cjs/commands/GetSessionCommand.js.map +1 -1
  10. package/dist/cjs/commands/PostContentCommand.js +3 -3
  11. package/dist/cjs/commands/PostContentCommand.js.map +1 -1
  12. package/dist/cjs/commands/PostTextCommand.js +3 -3
  13. package/dist/cjs/commands/PostTextCommand.js.map +1 -1
  14. package/dist/cjs/commands/PutSessionCommand.js +3 -3
  15. package/dist/cjs/commands/PutSessionCommand.js.map +1 -1
  16. package/dist/cjs/endpoints.js +1 -1
  17. package/dist/cjs/endpoints.js.map +1 -1
  18. package/dist/cjs/index.js +8 -8
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/cjs/models/index.js +1 -1
  21. package/dist/cjs/models/index.js.map +1 -1
  22. package/dist/cjs/package.json +40 -40
  23. package/dist/cjs/protocols/Aws_restJson1.js +81 -81
  24. package/dist/cjs/protocols/Aws_restJson1.js.map +1 -1
  25. package/dist/cjs/runtimeConfig.browser.js +4 -4
  26. package/dist/cjs/runtimeConfig.browser.js.map +1 -1
  27. package/dist/cjs/runtimeConfig.js +8 -8
  28. package/dist/cjs/runtimeConfig.js.map +1 -1
  29. package/dist/cjs/runtimeConfig.native.js +1 -1
  30. package/dist/cjs/runtimeConfig.native.js.map +1 -1
  31. package/dist/es/LexRuntimeService.js +1 -15
  32. package/dist/es/LexRuntimeService.js.map +1 -1
  33. package/dist/es/LexRuntimeService.spec.js +2 -4
  34. package/dist/es/LexRuntimeService.spec.js.map +1 -1
  35. package/dist/es/LexRuntimeServiceClient.js +1 -20
  36. package/dist/es/LexRuntimeServiceClient.js.map +1 -1
  37. package/dist/es/commands/DeleteSessionCommand.js +2 -28
  38. package/dist/es/commands/DeleteSessionCommand.js.map +1 -1
  39. package/dist/es/commands/GetSessionCommand.js +2 -28
  40. package/dist/es/commands/GetSessionCommand.js.map +1 -1
  41. package/dist/es/commands/PostContentCommand.js +2 -103
  42. package/dist/es/commands/PostContentCommand.js.map +1 -1
  43. package/dist/es/commands/PostTextCommand.js +2 -102
  44. package/dist/es/commands/PostTextCommand.js.map +1 -1
  45. package/dist/es/commands/PutSessionCommand.js +2 -31
  46. package/dist/es/commands/PutSessionCommand.js.map +1 -1
  47. package/dist/es/endpoints.js +1 -1
  48. package/dist/es/endpoints.js.map +1 -1
  49. package/dist/es/models/models_0.js +0 -93
  50. package/dist/es/models/models_0.js.map +1 -1
  51. package/dist/es/package.json +40 -40
  52. package/dist/es/protocols/Aws_restJson1.js +204 -209
  53. package/dist/es/protocols/Aws_restJson1.js.map +1 -1
  54. package/dist/es/runtimeConfig.browser.js +0 -3
  55. package/dist/es/runtimeConfig.browser.js.map +1 -1
  56. package/dist/es/runtimeConfig.js +0 -3
  57. package/dist/es/runtimeConfig.js.map +1 -1
  58. package/dist/es/runtimeConfig.native.js +0 -3
  59. package/dist/es/runtimeConfig.native.js.map +1 -1
  60. package/dist/es/runtimeConfig.shared.js +0 -3
  61. package/dist/es/runtimeConfig.shared.js.map +1 -1
  62. package/dist/types/runtimeConfig.browser.d.ts +1 -0
  63. package/dist/types/runtimeConfig.d.ts +1 -0
  64. package/dist/types/runtimeConfig.native.d.ts +1 -0
  65. package/dist/types/ts3.4/runtimeConfig.browser.d.ts +1 -0
  66. package/dist/types/ts3.4/runtimeConfig.d.ts +1 -0
  67. package/dist/types/ts3.4/runtimeConfig.native.d.ts +1 -0
  68. package/package.json +40 -40
  69. package/protocols/Aws_restJson1.ts +19 -13
  70. package/tsconfig.es.json +0 -2
  71. package/tsconfig.json +3 -5
  72. package/tsconfig.types.json +8 -0
@@ -13,7 +13,7 @@ const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
13
13
  if (labelValue.length <= 0) {
14
14
  throw new Error("Empty value provided for input HTTP label: botName.");
15
15
  }
16
- resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
16
+ resolvedPath = resolvedPath.replace("{botName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
17
17
  }
18
18
  else {
19
19
  throw new Error("No value provided for input HTTP label: botName.");
@@ -23,7 +23,7 @@ const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
23
23
  if (labelValue.length <= 0) {
24
24
  throw new Error("Empty value provided for input HTTP label: botAlias.");
25
25
  }
26
- resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
26
+ resolvedPath = resolvedPath.replace("{botAlias}", smithy_client_1.extendedEncodeURIComponent(labelValue));
27
27
  }
28
28
  else {
29
29
  throw new Error("No value provided for input HTTP label: botAlias.");
@@ -33,7 +33,7 @@ const serializeAws_restJson1DeleteSessionCommand = async (input, context) => {
33
33
  if (labelValue.length <= 0) {
34
34
  throw new Error("Empty value provided for input HTTP label: userId.");
35
35
  }
36
- resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
36
+ resolvedPath = resolvedPath.replace("{userId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
37
37
  }
38
38
  else {
39
39
  throw new Error("No value provided for input HTTP label: userId.");
@@ -60,7 +60,7 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
60
60
  if (labelValue.length <= 0) {
61
61
  throw new Error("Empty value provided for input HTTP label: botName.");
62
62
  }
63
- resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
63
+ resolvedPath = resolvedPath.replace("{botName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
64
64
  }
65
65
  else {
66
66
  throw new Error("No value provided for input HTTP label: botName.");
@@ -70,7 +70,7 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
70
70
  if (labelValue.length <= 0) {
71
71
  throw new Error("Empty value provided for input HTTP label: botAlias.");
72
72
  }
73
- resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
73
+ resolvedPath = resolvedPath.replace("{botAlias}", smithy_client_1.extendedEncodeURIComponent(labelValue));
74
74
  }
75
75
  else {
76
76
  throw new Error("No value provided for input HTTP label: botAlias.");
@@ -80,7 +80,7 @@ const serializeAws_restJson1GetSessionCommand = async (input, context) => {
80
80
  if (labelValue.length <= 0) {
81
81
  throw new Error("Empty value provided for input HTTP label: userId.");
82
82
  }
83
- resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
83
+ resolvedPath = resolvedPath.replace("{userId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
84
84
  }
85
85
  else {
86
86
  throw new Error("No value provided for input HTTP label: userId.");
@@ -107,15 +107,15 @@ const serializeAws_restJson1PostContentCommand = async (input, context) => {
107
107
  "content-type": "application/octet-stream",
108
108
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
109
109
  ...(isSerializableHeaderValue(input.sessionAttributes) && {
110
- "x-amz-lex-session-attributes": Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.sessionAttributes)).toString("base64"),
110
+ "x-amz-lex-session-attributes": context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.sessionAttributes))),
111
111
  }),
112
112
  ...(isSerializableHeaderValue(input.requestAttributes) && {
113
- "x-amz-lex-request-attributes": Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.requestAttributes)).toString("base64"),
113
+ "x-amz-lex-request-attributes": context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.requestAttributes))),
114
114
  }),
115
115
  ...(isSerializableHeaderValue(input.contentType) && { "content-type": input.contentType }),
116
116
  ...(isSerializableHeaderValue(input.accept) && { accept: input.accept }),
117
117
  ...(isSerializableHeaderValue(input.activeContexts) && {
118
- "x-amz-lex-active-contexts": Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.activeContexts)).toString("base64"),
118
+ "x-amz-lex-active-contexts": context.base64Encoder(Buffer.from(smithy_client_1.LazyJsonString.fromObject(input.activeContexts))),
119
119
  }),
120
120
  };
121
121
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
@@ -125,7 +125,7 @@ const serializeAws_restJson1PostContentCommand = async (input, context) => {
125
125
  if (labelValue.length <= 0) {
126
126
  throw new Error("Empty value provided for input HTTP label: botName.");
127
127
  }
128
- resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
128
+ resolvedPath = resolvedPath.replace("{botName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
129
129
  }
130
130
  else {
131
131
  throw new Error("No value provided for input HTTP label: botName.");
@@ -135,7 +135,7 @@ const serializeAws_restJson1PostContentCommand = async (input, context) => {
135
135
  if (labelValue.length <= 0) {
136
136
  throw new Error("Empty value provided for input HTTP label: botAlias.");
137
137
  }
138
- resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
138
+ resolvedPath = resolvedPath.replace("{botAlias}", smithy_client_1.extendedEncodeURIComponent(labelValue));
139
139
  }
140
140
  else {
141
141
  throw new Error("No value provided for input HTTP label: botAlias.");
@@ -145,7 +145,7 @@ const serializeAws_restJson1PostContentCommand = async (input, context) => {
145
145
  if (labelValue.length <= 0) {
146
146
  throw new Error("Empty value provided for input HTTP label: userId.");
147
147
  }
148
- resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
148
+ resolvedPath = resolvedPath.replace("{userId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
149
149
  }
150
150
  else {
151
151
  throw new Error("No value provided for input HTTP label: userId.");
@@ -177,7 +177,7 @@ const serializeAws_restJson1PostTextCommand = async (input, context) => {
177
177
  if (labelValue.length <= 0) {
178
178
  throw new Error("Empty value provided for input HTTP label: botName.");
179
179
  }
180
- resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
180
+ resolvedPath = resolvedPath.replace("{botName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
181
181
  }
182
182
  else {
183
183
  throw new Error("No value provided for input HTTP label: botName.");
@@ -187,7 +187,7 @@ const serializeAws_restJson1PostTextCommand = async (input, context) => {
187
187
  if (labelValue.length <= 0) {
188
188
  throw new Error("Empty value provided for input HTTP label: botAlias.");
189
189
  }
190
- resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
190
+ resolvedPath = resolvedPath.replace("{botAlias}", smithy_client_1.extendedEncodeURIComponent(labelValue));
191
191
  }
192
192
  else {
193
193
  throw new Error("No value provided for input HTTP label: botAlias.");
@@ -197,7 +197,7 @@ const serializeAws_restJson1PostTextCommand = async (input, context) => {
197
197
  if (labelValue.length <= 0) {
198
198
  throw new Error("Empty value provided for input HTTP label: userId.");
199
199
  }
200
- resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
200
+ resolvedPath = resolvedPath.replace("{userId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
201
201
  }
202
202
  else {
203
203
  throw new Error("No value provided for input HTTP label: userId.");
@@ -242,7 +242,7 @@ const serializeAws_restJson1PutSessionCommand = async (input, context) => {
242
242
  if (labelValue.length <= 0) {
243
243
  throw new Error("Empty value provided for input HTTP label: botName.");
244
244
  }
245
- resolvedPath = resolvedPath.replace("{botName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
245
+ resolvedPath = resolvedPath.replace("{botName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
246
246
  }
247
247
  else {
248
248
  throw new Error("No value provided for input HTTP label: botName.");
@@ -252,7 +252,7 @@ const serializeAws_restJson1PutSessionCommand = async (input, context) => {
252
252
  if (labelValue.length <= 0) {
253
253
  throw new Error("Empty value provided for input HTTP label: botAlias.");
254
254
  }
255
- resolvedPath = resolvedPath.replace("{botAlias}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
255
+ resolvedPath = resolvedPath.replace("{botAlias}", smithy_client_1.extendedEncodeURIComponent(labelValue));
256
256
  }
257
257
  else {
258
258
  throw new Error("No value provided for input HTTP label: botAlias.");
@@ -262,7 +262,7 @@ const serializeAws_restJson1PutSessionCommand = async (input, context) => {
262
262
  if (labelValue.length <= 0) {
263
263
  throw new Error("Empty value provided for input HTTP label: userId.");
264
264
  }
265
- resolvedPath = resolvedPath.replace("{userId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
265
+ resolvedPath = resolvedPath.replace("{userId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
266
266
  }
267
267
  else {
268
268
  throw new Error("No value provided for input HTTP label: userId.");
@@ -306,18 +306,18 @@ const deserializeAws_restJson1DeleteSessionCommand = async (output, context) =>
306
306
  sessionId: undefined,
307
307
  userId: undefined,
308
308
  };
309
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
309
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
310
310
  if (data.botAlias !== undefined && data.botAlias !== null) {
311
- contents.botAlias = (0, smithy_client_1.expectString)(data.botAlias);
311
+ contents.botAlias = smithy_client_1.expectString(data.botAlias);
312
312
  }
313
313
  if (data.botName !== undefined && data.botName !== null) {
314
- contents.botName = (0, smithy_client_1.expectString)(data.botName);
314
+ contents.botName = smithy_client_1.expectString(data.botName);
315
315
  }
316
316
  if (data.sessionId !== undefined && data.sessionId !== null) {
317
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
317
+ contents.sessionId = smithy_client_1.expectString(data.sessionId);
318
318
  }
319
319
  if (data.userId !== undefined && data.userId !== null) {
320
- contents.userId = (0, smithy_client_1.expectString)(data.userId);
320
+ contents.userId = smithy_client_1.expectString(data.userId);
321
321
  }
322
322
  return Promise.resolve(contents);
323
323
  };
@@ -399,7 +399,7 @@ const deserializeAws_restJson1GetSessionCommand = async (output, context) => {
399
399
  sessionAttributes: undefined,
400
400
  sessionId: undefined,
401
401
  };
402
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
402
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
403
403
  if (data.activeContexts !== undefined && data.activeContexts !== null) {
404
404
  contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
405
405
  }
@@ -413,7 +413,7 @@ const deserializeAws_restJson1GetSessionCommand = async (output, context) => {
413
413
  contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
414
414
  }
415
415
  if (data.sessionId !== undefined && data.sessionId !== null) {
416
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
416
+ contents.sessionId = smithy_client_1.expectString(data.sessionId);
417
417
  }
418
418
  return Promise.resolve(contents);
419
419
  };
@@ -507,16 +507,16 @@ const deserializeAws_restJson1PostContentCommand = async (output, context) => {
507
507
  contents.intentName = output.headers["x-amz-lex-intent-name"];
508
508
  }
509
509
  if (output.headers["x-amz-lex-nlu-intent-confidence"] !== undefined) {
510
- contents.nluIntentConfidence = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-nlu-intent-confidence"], "base64").toString("ascii"));
510
+ contents.nluIntentConfidence = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"));
511
511
  }
512
512
  if (output.headers["x-amz-lex-alternative-intents"] !== undefined) {
513
- contents.alternativeIntents = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-alternative-intents"], "base64").toString("ascii"));
513
+ contents.alternativeIntents = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8"));
514
514
  }
515
515
  if (output.headers["x-amz-lex-slots"] !== undefined) {
516
- contents.slots = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"], "base64").toString("ascii"));
516
+ contents.slots = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
517
517
  }
518
518
  if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
519
- contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-session-attributes"], "base64").toString("ascii"));
519
+ contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
520
520
  }
521
521
  if (output.headers["x-amz-lex-sentiment"] !== undefined) {
522
522
  contents.sentimentResponse = output.headers["x-amz-lex-sentiment"];
@@ -549,7 +549,7 @@ const deserializeAws_restJson1PostContentCommand = async (output, context) => {
549
549
  contents.sessionId = output.headers["x-amz-lex-session-id"];
550
550
  }
551
551
  if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
552
- contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-active-contexts"], "base64").toString("ascii"));
552
+ contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
553
553
  }
554
554
  const data = output.body;
555
555
  contents.audioStream = data;
@@ -690,7 +690,7 @@ const deserializeAws_restJson1PostTextCommand = async (output, context) => {
690
690
  slotToElicit: undefined,
691
691
  slots: undefined,
692
692
  };
693
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
693
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
694
694
  if (data.activeContexts !== undefined && data.activeContexts !== null) {
695
695
  contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
696
696
  }
@@ -698,19 +698,19 @@ const deserializeAws_restJson1PostTextCommand = async (output, context) => {
698
698
  contents.alternativeIntents = deserializeAws_restJson1IntentList(data.alternativeIntents, context);
699
699
  }
700
700
  if (data.botVersion !== undefined && data.botVersion !== null) {
701
- contents.botVersion = (0, smithy_client_1.expectString)(data.botVersion);
701
+ contents.botVersion = smithy_client_1.expectString(data.botVersion);
702
702
  }
703
703
  if (data.dialogState !== undefined && data.dialogState !== null) {
704
- contents.dialogState = (0, smithy_client_1.expectString)(data.dialogState);
704
+ contents.dialogState = smithy_client_1.expectString(data.dialogState);
705
705
  }
706
706
  if (data.intentName !== undefined && data.intentName !== null) {
707
- contents.intentName = (0, smithy_client_1.expectString)(data.intentName);
707
+ contents.intentName = smithy_client_1.expectString(data.intentName);
708
708
  }
709
709
  if (data.message !== undefined && data.message !== null) {
710
- contents.message = (0, smithy_client_1.expectString)(data.message);
710
+ contents.message = smithy_client_1.expectString(data.message);
711
711
  }
712
712
  if (data.messageFormat !== undefined && data.messageFormat !== null) {
713
- contents.messageFormat = (0, smithy_client_1.expectString)(data.messageFormat);
713
+ contents.messageFormat = smithy_client_1.expectString(data.messageFormat);
714
714
  }
715
715
  if (data.nluIntentConfidence !== undefined && data.nluIntentConfidence !== null) {
716
716
  contents.nluIntentConfidence = deserializeAws_restJson1IntentConfidence(data.nluIntentConfidence, context);
@@ -725,10 +725,10 @@ const deserializeAws_restJson1PostTextCommand = async (output, context) => {
725
725
  contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
726
726
  }
727
727
  if (data.sessionId !== undefined && data.sessionId !== null) {
728
- contents.sessionId = (0, smithy_client_1.expectString)(data.sessionId);
728
+ contents.sessionId = smithy_client_1.expectString(data.sessionId);
729
729
  }
730
730
  if (data.slotToElicit !== undefined && data.slotToElicit !== null) {
731
- contents.slotToElicit = (0, smithy_client_1.expectString)(data.slotToElicit);
731
+ contents.slotToElicit = smithy_client_1.expectString(data.slotToElicit);
732
732
  }
733
733
  if (data.slots !== undefined && data.slots !== null) {
734
734
  contents.slots = deserializeAws_restJson1StringMap(data.slots, context);
@@ -851,10 +851,10 @@ const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
851
851
  contents.intentName = output.headers["x-amz-lex-intent-name"];
852
852
  }
853
853
  if (output.headers["x-amz-lex-slots"] !== undefined) {
854
- contents.slots = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"], "base64").toString("ascii"));
854
+ contents.slots = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
855
855
  }
856
856
  if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
857
- contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-session-attributes"], "base64").toString("ascii"));
857
+ contents.sessionAttributes = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
858
858
  }
859
859
  if (output.headers["x-amz-lex-message"] !== undefined) {
860
860
  contents.message = output.headers["x-amz-lex-message"];
@@ -875,7 +875,7 @@ const deserializeAws_restJson1PutSessionCommand = async (output, context) => {
875
875
  contents.sessionId = output.headers["x-amz-lex-session-id"];
876
876
  }
877
877
  if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
878
- contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(output.headers["x-amz-lex-active-contexts"], "base64").toString("ascii"));
878
+ contents.activeContexts = new smithy_client_1.LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
879
879
  }
880
880
  const data = output.body;
881
881
  contents.audioStream = data;
@@ -980,7 +980,7 @@ const deserializeAws_restJson1BadGatewayExceptionResponse = async (parsedOutput,
980
980
  };
981
981
  const data = parsedOutput.body;
982
982
  if (data.Message !== undefined && data.Message !== null) {
983
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
983
+ contents.Message = smithy_client_1.expectString(data.Message);
984
984
  }
985
985
  return contents;
986
986
  };
@@ -993,7 +993,7 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
993
993
  };
994
994
  const data = parsedOutput.body;
995
995
  if (data.message !== undefined && data.message !== null) {
996
- contents.message = (0, smithy_client_1.expectString)(data.message);
996
+ contents.message = smithy_client_1.expectString(data.message);
997
997
  }
998
998
  return contents;
999
999
  };
@@ -1006,7 +1006,7 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1006
1006
  };
1007
1007
  const data = parsedOutput.body;
1008
1008
  if (data.message !== undefined && data.message !== null) {
1009
- contents.message = (0, smithy_client_1.expectString)(data.message);
1009
+ contents.message = smithy_client_1.expectString(data.message);
1010
1010
  }
1011
1011
  return contents;
1012
1012
  };
@@ -1019,7 +1019,7 @@ const deserializeAws_restJson1DependencyFailedExceptionResponse = async (parsedO
1019
1019
  };
1020
1020
  const data = parsedOutput.body;
1021
1021
  if (data.Message !== undefined && data.Message !== null) {
1022
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1022
+ contents.Message = smithy_client_1.expectString(data.Message);
1023
1023
  }
1024
1024
  return contents;
1025
1025
  };
@@ -1032,7 +1032,7 @@ const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOu
1032
1032
  };
1033
1033
  const data = parsedOutput.body;
1034
1034
  if (data.message !== undefined && data.message !== null) {
1035
- contents.message = (0, smithy_client_1.expectString)(data.message);
1035
+ contents.message = smithy_client_1.expectString(data.message);
1036
1036
  }
1037
1037
  return contents;
1038
1038
  };
@@ -1049,7 +1049,7 @@ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutp
1049
1049
  }
1050
1050
  const data = parsedOutput.body;
1051
1051
  if (data.message !== undefined && data.message !== null) {
1052
- contents.message = (0, smithy_client_1.expectString)(data.message);
1052
+ contents.message = smithy_client_1.expectString(data.message);
1053
1053
  }
1054
1054
  return contents;
1055
1055
  };
@@ -1062,7 +1062,7 @@ const deserializeAws_restJson1LoopDetectedExceptionResponse = async (parsedOutpu
1062
1062
  };
1063
1063
  const data = parsedOutput.body;
1064
1064
  if (data.Message !== undefined && data.Message !== null) {
1065
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
1065
+ contents.Message = smithy_client_1.expectString(data.Message);
1066
1066
  }
1067
1067
  return contents;
1068
1068
  };
@@ -1075,7 +1075,7 @@ const deserializeAws_restJson1NotAcceptableExceptionResponse = async (parsedOutp
1075
1075
  };
1076
1076
  const data = parsedOutput.body;
1077
1077
  if (data.message !== undefined && data.message !== null) {
1078
- contents.message = (0, smithy_client_1.expectString)(data.message);
1078
+ contents.message = smithy_client_1.expectString(data.message);
1079
1079
  }
1080
1080
  return contents;
1081
1081
  };
@@ -1088,7 +1088,7 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
1088
1088
  };
1089
1089
  const data = parsedOutput.body;
1090
1090
  if (data.message !== undefined && data.message !== null) {
1091
- contents.message = (0, smithy_client_1.expectString)(data.message);
1091
+ contents.message = smithy_client_1.expectString(data.message);
1092
1092
  }
1093
1093
  return contents;
1094
1094
  };
@@ -1101,7 +1101,7 @@ const deserializeAws_restJson1RequestTimeoutExceptionResponse = async (parsedOut
1101
1101
  };
1102
1102
  const data = parsedOutput.body;
1103
1103
  if (data.message !== undefined && data.message !== null) {
1104
- contents.message = (0, smithy_client_1.expectString)(data.message);
1104
+ contents.message = smithy_client_1.expectString(data.message);
1105
1105
  }
1106
1106
  return contents;
1107
1107
  };
@@ -1114,7 +1114,7 @@ const deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = async (par
1114
1114
  };
1115
1115
  const data = parsedOutput.body;
1116
1116
  if (data.message !== undefined && data.message !== null) {
1117
- contents.message = (0, smithy_client_1.expectString)(data.message);
1117
+ contents.message = smithy_client_1.expectString(data.message);
1118
1118
  }
1119
1119
  return contents;
1120
1120
  };
@@ -1211,7 +1211,7 @@ const serializeAws_restJson1StringMap = (input, context) => {
1211
1211
  };
1212
1212
  const deserializeAws_restJson1ActiveContext = (output, context) => {
1213
1213
  return {
1214
- name: (0, smithy_client_1.expectString)(output.name),
1214
+ name: smithy_client_1.expectString(output.name),
1215
1215
  parameters: output.parameters !== undefined && output.parameters !== null
1216
1216
  ? deserializeAws_restJson1ActiveContextParametersMap(output.parameters, context)
1217
1217
  : undefined,
@@ -1227,7 +1227,7 @@ const deserializeAws_restJson1ActiveContextParametersMap = (output, context) =>
1227
1227
  }
1228
1228
  return {
1229
1229
  ...acc,
1230
- [key]: (0, smithy_client_1.expectString)(value),
1230
+ [key]: smithy_client_1.expectString(value),
1231
1231
  };
1232
1232
  }, {});
1233
1233
  };
@@ -1243,38 +1243,38 @@ const deserializeAws_restJson1ActiveContextsList = (output, context) => {
1243
1243
  };
1244
1244
  const deserializeAws_restJson1ActiveContextTimeToLive = (output, context) => {
1245
1245
  return {
1246
- timeToLiveInSeconds: (0, smithy_client_1.expectInt32)(output.timeToLiveInSeconds),
1247
- turnsToLive: (0, smithy_client_1.expectInt32)(output.turnsToLive),
1246
+ timeToLiveInSeconds: smithy_client_1.expectInt32(output.timeToLiveInSeconds),
1247
+ turnsToLive: smithy_client_1.expectInt32(output.turnsToLive),
1248
1248
  };
1249
1249
  };
1250
1250
  const deserializeAws_restJson1Button = (output, context) => {
1251
1251
  return {
1252
- text: (0, smithy_client_1.expectString)(output.text),
1253
- value: (0, smithy_client_1.expectString)(output.value),
1252
+ text: smithy_client_1.expectString(output.text),
1253
+ value: smithy_client_1.expectString(output.value),
1254
1254
  };
1255
1255
  };
1256
1256
  const deserializeAws_restJson1DialogAction = (output, context) => {
1257
1257
  return {
1258
- fulfillmentState: (0, smithy_client_1.expectString)(output.fulfillmentState),
1259
- intentName: (0, smithy_client_1.expectString)(output.intentName),
1260
- message: (0, smithy_client_1.expectString)(output.message),
1261
- messageFormat: (0, smithy_client_1.expectString)(output.messageFormat),
1262
- slotToElicit: (0, smithy_client_1.expectString)(output.slotToElicit),
1258
+ fulfillmentState: smithy_client_1.expectString(output.fulfillmentState),
1259
+ intentName: smithy_client_1.expectString(output.intentName),
1260
+ message: smithy_client_1.expectString(output.message),
1261
+ messageFormat: smithy_client_1.expectString(output.messageFormat),
1262
+ slotToElicit: smithy_client_1.expectString(output.slotToElicit),
1263
1263
  slots: output.slots !== undefined && output.slots !== null
1264
1264
  ? deserializeAws_restJson1StringMap(output.slots, context)
1265
1265
  : undefined,
1266
- type: (0, smithy_client_1.expectString)(output.type),
1266
+ type: smithy_client_1.expectString(output.type),
1267
1267
  };
1268
1268
  };
1269
1269
  const deserializeAws_restJson1GenericAttachment = (output, context) => {
1270
1270
  return {
1271
- attachmentLinkUrl: (0, smithy_client_1.expectString)(output.attachmentLinkUrl),
1271
+ attachmentLinkUrl: smithy_client_1.expectString(output.attachmentLinkUrl),
1272
1272
  buttons: output.buttons !== undefined && output.buttons !== null
1273
1273
  ? deserializeAws_restJson1listOfButtons(output.buttons, context)
1274
1274
  : undefined,
1275
- imageUrl: (0, smithy_client_1.expectString)(output.imageUrl),
1276
- subTitle: (0, smithy_client_1.expectString)(output.subTitle),
1277
- title: (0, smithy_client_1.expectString)(output.title),
1275
+ imageUrl: smithy_client_1.expectString(output.imageUrl),
1276
+ subTitle: smithy_client_1.expectString(output.subTitle),
1277
+ title: smithy_client_1.expectString(output.title),
1278
1278
  };
1279
1279
  };
1280
1280
  const deserializeAws_restJson1genericAttachmentList = (output, context) => {
@@ -1289,7 +1289,7 @@ const deserializeAws_restJson1genericAttachmentList = (output, context) => {
1289
1289
  };
1290
1290
  const deserializeAws_restJson1IntentConfidence = (output, context) => {
1291
1291
  return {
1292
- score: (0, smithy_client_1.limitedParseDouble)(output.score),
1292
+ score: smithy_client_1.limitedParseDouble(output.score),
1293
1293
  };
1294
1294
  };
1295
1295
  const deserializeAws_restJson1IntentList = (output, context) => {
@@ -1304,12 +1304,12 @@ const deserializeAws_restJson1IntentList = (output, context) => {
1304
1304
  };
1305
1305
  const deserializeAws_restJson1IntentSummary = (output, context) => {
1306
1306
  return {
1307
- checkpointLabel: (0, smithy_client_1.expectString)(output.checkpointLabel),
1308
- confirmationStatus: (0, smithy_client_1.expectString)(output.confirmationStatus),
1309
- dialogActionType: (0, smithy_client_1.expectString)(output.dialogActionType),
1310
- fulfillmentState: (0, smithy_client_1.expectString)(output.fulfillmentState),
1311
- intentName: (0, smithy_client_1.expectString)(output.intentName),
1312
- slotToElicit: (0, smithy_client_1.expectString)(output.slotToElicit),
1307
+ checkpointLabel: smithy_client_1.expectString(output.checkpointLabel),
1308
+ confirmationStatus: smithy_client_1.expectString(output.confirmationStatus),
1309
+ dialogActionType: smithy_client_1.expectString(output.dialogActionType),
1310
+ fulfillmentState: smithy_client_1.expectString(output.fulfillmentState),
1311
+ intentName: smithy_client_1.expectString(output.intentName),
1312
+ slotToElicit: smithy_client_1.expectString(output.slotToElicit),
1313
1313
  slots: output.slots !== undefined && output.slots !== null
1314
1314
  ? deserializeAws_restJson1StringMap(output.slots, context)
1315
1315
  : undefined,
@@ -1337,7 +1337,7 @@ const deserializeAws_restJson1listOfButtons = (output, context) => {
1337
1337
  };
1338
1338
  const deserializeAws_restJson1PredictedIntent = (output, context) => {
1339
1339
  return {
1340
- intentName: (0, smithy_client_1.expectString)(output.intentName),
1340
+ intentName: smithy_client_1.expectString(output.intentName),
1341
1341
  nluIntentConfidence: output.nluIntentConfidence !== undefined && output.nluIntentConfidence !== null
1342
1342
  ? deserializeAws_restJson1IntentConfidence(output.nluIntentConfidence, context)
1343
1343
  : undefined,
@@ -1348,17 +1348,17 @@ const deserializeAws_restJson1PredictedIntent = (output, context) => {
1348
1348
  };
1349
1349
  const deserializeAws_restJson1ResponseCard = (output, context) => {
1350
1350
  return {
1351
- contentType: (0, smithy_client_1.expectString)(output.contentType),
1351
+ contentType: smithy_client_1.expectString(output.contentType),
1352
1352
  genericAttachments: output.genericAttachments !== undefined && output.genericAttachments !== null
1353
1353
  ? deserializeAws_restJson1genericAttachmentList(output.genericAttachments, context)
1354
1354
  : undefined,
1355
- version: (0, smithy_client_1.expectString)(output.version),
1355
+ version: smithy_client_1.expectString(output.version),
1356
1356
  };
1357
1357
  };
1358
1358
  const deserializeAws_restJson1SentimentResponse = (output, context) => {
1359
1359
  return {
1360
- sentimentLabel: (0, smithy_client_1.expectString)(output.sentimentLabel),
1361
- sentimentScore: (0, smithy_client_1.expectString)(output.sentimentScore),
1360
+ sentimentLabel: smithy_client_1.expectString(output.sentimentLabel),
1361
+ sentimentScore: smithy_client_1.expectString(output.sentimentScore),
1362
1362
  };
1363
1363
  };
1364
1364
  const deserializeAws_restJson1StringMap = (output, context) => {
@@ -1368,7 +1368,7 @@ const deserializeAws_restJson1StringMap = (output, context) => {
1368
1368
  }
1369
1369
  return {
1370
1370
  ...acc,
1371
- [key]: (0, smithy_client_1.expectString)(value),
1371
+ [key]: smithy_client_1.expectString(value),
1372
1372
  };
1373
1373
  }, {});
1374
1374
  };