@aws-sdk/client-lex-runtime-service 3.141.0 → 3.142.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.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { LexRuntimeServiceServiceException as __BaseException } from "../models/LexRuntimeServiceServiceException";
5
5
  import { BadGatewayException, BadRequestException, ConflictException, DependencyFailedException, InternalFailureException, LimitExceededException, LoopDetectedException, NotAcceptableException, NotFoundException, RequestTimeoutException, UnsupportedMediaTypeException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1DeleteSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -13,36 +13,9 @@ export var serializeAws_restJson1DeleteSessionCommand = function (input, context
13
13
  headers = {};
14
14
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
15
15
  "/bot/{botName}/alias/{botAlias}/user/{userId}/session";
16
- if (input.botName !== undefined) {
17
- labelValue = input.botName;
18
- if (labelValue.length <= 0) {
19
- throw new Error("Empty value provided for input HTTP label: botName.");
20
- }
21
- resolvedPath = resolvedPath.replace("{botName}", __extendedEncodeURIComponent(labelValue));
22
- }
23
- else {
24
- throw new Error("No value provided for input HTTP label: botName.");
25
- }
26
- if (input.botAlias !== undefined) {
27
- labelValue = input.botAlias;
28
- if (labelValue.length <= 0) {
29
- throw new Error("Empty value provided for input HTTP label: botAlias.");
30
- }
31
- resolvedPath = resolvedPath.replace("{botAlias}", __extendedEncodeURIComponent(labelValue));
32
- }
33
- else {
34
- throw new Error("No value provided for input HTTP label: botAlias.");
35
- }
36
- if (input.userId !== undefined) {
37
- labelValue = input.userId;
38
- if (labelValue.length <= 0) {
39
- throw new Error("Empty value provided for input HTTP label: userId.");
40
- }
41
- resolvedPath = resolvedPath.replace("{userId}", __extendedEncodeURIComponent(labelValue));
42
- }
43
- else {
44
- throw new Error("No value provided for input HTTP label: userId.");
45
- }
16
+ resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
17
+ resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
46
19
  return [2, new __HttpRequest({
47
20
  protocol: protocol,
48
21
  hostname: hostname,
@@ -56,7 +29,7 @@ export var serializeAws_restJson1DeleteSessionCommand = function (input, context
56
29
  });
57
30
  }); };
58
31
  export var serializeAws_restJson1GetSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
59
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
32
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
60
33
  return __generator(this, function (_c) {
61
34
  switch (_c.label) {
62
35
  case 0: return [4, context.endpoint()];
@@ -65,37 +38,12 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
65
38
  headers = {};
66
39
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
67
40
  "/bot/{botName}/alias/{botAlias}/user/{userId}/session";
68
- if (input.botName !== undefined) {
69
- labelValue = input.botName;
70
- if (labelValue.length <= 0) {
71
- throw new Error("Empty value provided for input HTTP label: botName.");
72
- }
73
- resolvedPath = resolvedPath.replace("{botName}", __extendedEncodeURIComponent(labelValue));
74
- }
75
- else {
76
- throw new Error("No value provided for input HTTP label: botName.");
77
- }
78
- if (input.botAlias !== undefined) {
79
- labelValue = input.botAlias;
80
- if (labelValue.length <= 0) {
81
- throw new Error("Empty value provided for input HTTP label: botAlias.");
82
- }
83
- resolvedPath = resolvedPath.replace("{botAlias}", __extendedEncodeURIComponent(labelValue));
84
- }
85
- else {
86
- throw new Error("No value provided for input HTTP label: botAlias.");
87
- }
88
- if (input.userId !== undefined) {
89
- labelValue = input.userId;
90
- if (labelValue.length <= 0) {
91
- throw new Error("Empty value provided for input HTTP label: userId.");
92
- }
93
- resolvedPath = resolvedPath.replace("{userId}", __extendedEncodeURIComponent(labelValue));
94
- }
95
- else {
96
- throw new Error("No value provided for input HTTP label: userId.");
97
- }
98
- query = __assign({}, (input.checkpointLabelFilter !== undefined && { checkpointLabelFilter: input.checkpointLabelFilter }));
41
+ resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
42
+ resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
44
+ query = map({
45
+ checkpointLabelFilter: [, input.checkpointLabelFilter],
46
+ });
99
47
  return [2, new __HttpRequest({
100
48
  protocol: protocol,
101
49
  hostname: hostname,
@@ -110,51 +58,34 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
110
58
  });
111
59
  }); };
112
60
  export var serializeAws_restJson1PostContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
113
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
61
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
114
62
  return __generator(this, function (_c) {
115
63
  switch (_c.label) {
116
64
  case 0: return [4, context.endpoint()];
117
65
  case 1:
118
66
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
119
- headers = __assign(__assign(__assign(__assign(__assign({ "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD" }, (isSerializableHeaderValue(input.sessionAttributes) && {
120
- "x-amz-lex-session-attributes": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))),
121
- })), (isSerializableHeaderValue(input.requestAttributes) && {
122
- "x-amz-lex-request-attributes": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))),
123
- })), (isSerializableHeaderValue(input.contentType) && { "content-type": input.contentType })), (isSerializableHeaderValue(input.accept) && { accept: input.accept })), (isSerializableHeaderValue(input.activeContexts) && {
124
- "x-amz-lex-active-contexts": context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.activeContexts))),
125
- }));
67
+ headers = map({}, isSerializableHeaderValue, {
68
+ "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
69
+ "content-type": input.contentType || "application/octet-stream",
70
+ "x-amz-lex-session-attributes": [
71
+ function () { return isSerializableHeaderValue(input.sessionAttributes); },
72
+ function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes))); },
73
+ ],
74
+ "x-amz-lex-request-attributes": [
75
+ function () { return isSerializableHeaderValue(input.requestAttributes); },
76
+ function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.requestAttributes))); },
77
+ ],
78
+ accept: input.accept,
79
+ "x-amz-lex-active-contexts": [
80
+ function () { return isSerializableHeaderValue(input.activeContexts); },
81
+ function () { return context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input.activeContexts))); },
82
+ ],
83
+ });
126
84
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
127
85
  "/bot/{botName}/alias/{botAlias}/user/{userId}/content";
128
- if (input.botName !== undefined) {
129
- labelValue = input.botName;
130
- if (labelValue.length <= 0) {
131
- throw new Error("Empty value provided for input HTTP label: botName.");
132
- }
133
- resolvedPath = resolvedPath.replace("{botName}", __extendedEncodeURIComponent(labelValue));
134
- }
135
- else {
136
- throw new Error("No value provided for input HTTP label: botName.");
137
- }
138
- if (input.botAlias !== undefined) {
139
- labelValue = input.botAlias;
140
- if (labelValue.length <= 0) {
141
- throw new Error("Empty value provided for input HTTP label: botAlias.");
142
- }
143
- resolvedPath = resolvedPath.replace("{botAlias}", __extendedEncodeURIComponent(labelValue));
144
- }
145
- else {
146
- throw new Error("No value provided for input HTTP label: botAlias.");
147
- }
148
- if (input.userId !== undefined) {
149
- labelValue = input.userId;
150
- if (labelValue.length <= 0) {
151
- throw new Error("Empty value provided for input HTTP label: userId.");
152
- }
153
- resolvedPath = resolvedPath.replace("{userId}", __extendedEncodeURIComponent(labelValue));
154
- }
155
- else {
156
- throw new Error("No value provided for input HTTP label: userId.");
157
- }
86
+ resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
87
+ resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
88
+ resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
158
89
  if (input.inputStream !== undefined) {
159
90
  body = input.inputStream;
160
91
  }
@@ -171,7 +102,7 @@ export var serializeAws_restJson1PostContentCommand = function (input, context)
171
102
  });
172
103
  }); };
173
104
  export var serializeAws_restJson1PostTextCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
174
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
105
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
175
106
  return __generator(this, function (_c) {
176
107
  switch (_c.label) {
177
108
  case 0: return [4, context.endpoint()];
@@ -182,36 +113,9 @@ export var serializeAws_restJson1PostTextCommand = function (input, context) { r
182
113
  };
183
114
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
184
115
  "/bot/{botName}/alias/{botAlias}/user/{userId}/text";
185
- if (input.botName !== undefined) {
186
- labelValue = input.botName;
187
- if (labelValue.length <= 0) {
188
- throw new Error("Empty value provided for input HTTP label: botName.");
189
- }
190
- resolvedPath = resolvedPath.replace("{botName}", __extendedEncodeURIComponent(labelValue));
191
- }
192
- else {
193
- throw new Error("No value provided for input HTTP label: botName.");
194
- }
195
- if (input.botAlias !== undefined) {
196
- labelValue = input.botAlias;
197
- if (labelValue.length <= 0) {
198
- throw new Error("Empty value provided for input HTTP label: botAlias.");
199
- }
200
- resolvedPath = resolvedPath.replace("{botAlias}", __extendedEncodeURIComponent(labelValue));
201
- }
202
- else {
203
- throw new Error("No value provided for input HTTP label: botAlias.");
204
- }
205
- if (input.userId !== undefined) {
206
- labelValue = input.userId;
207
- if (labelValue.length <= 0) {
208
- throw new Error("Empty value provided for input HTTP label: userId.");
209
- }
210
- resolvedPath = resolvedPath.replace("{userId}", __extendedEncodeURIComponent(labelValue));
211
- }
212
- else {
213
- throw new Error("No value provided for input HTTP label: userId.");
214
- }
116
+ resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
117
+ resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
118
+ resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
215
119
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.activeContexts != null && {
216
120
  activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context),
217
121
  })), (input.inputText != null && { inputText: input.inputText })), (input.requestAttributes != null && {
@@ -232,45 +136,21 @@ export var serializeAws_restJson1PostTextCommand = function (input, context) { r
232
136
  });
233
137
  }); };
234
138
  export var serializeAws_restJson1PutSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
235
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
139
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
236
140
  return __generator(this, function (_c) {
237
141
  switch (_c.label) {
238
142
  case 0: return [4, context.endpoint()];
239
143
  case 1:
240
144
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
241
- headers = __assign({ "content-type": "application/json" }, (isSerializableHeaderValue(input.accept) && { accept: input.accept }));
145
+ headers = map({}, isSerializableHeaderValue, {
146
+ "content-type": "application/json",
147
+ accept: input.accept,
148
+ });
242
149
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
243
150
  "/bot/{botName}/alias/{botAlias}/user/{userId}/session";
244
- if (input.botName !== undefined) {
245
- labelValue = input.botName;
246
- if (labelValue.length <= 0) {
247
- throw new Error("Empty value provided for input HTTP label: botName.");
248
- }
249
- resolvedPath = resolvedPath.replace("{botName}", __extendedEncodeURIComponent(labelValue));
250
- }
251
- else {
252
- throw new Error("No value provided for input HTTP label: botName.");
253
- }
254
- if (input.botAlias !== undefined) {
255
- labelValue = input.botAlias;
256
- if (labelValue.length <= 0) {
257
- throw new Error("Empty value provided for input HTTP label: botAlias.");
258
- }
259
- resolvedPath = resolvedPath.replace("{botAlias}", __extendedEncodeURIComponent(labelValue));
260
- }
261
- else {
262
- throw new Error("No value provided for input HTTP label: botAlias.");
263
- }
264
- if (input.userId !== undefined) {
265
- labelValue = input.userId;
266
- if (labelValue.length <= 0) {
267
- throw new Error("Empty value provided for input HTTP label: userId.");
268
- }
269
- resolvedPath = resolvedPath.replace("{userId}", __extendedEncodeURIComponent(labelValue));
270
- }
271
- else {
272
- throw new Error("No value provided for input HTTP label: userId.");
273
- }
151
+ resolvedPath = __resolvedPath(resolvedPath, input, "botName", function () { return input.botName; }, "{botName}", false);
152
+ resolvedPath = __resolvedPath(resolvedPath, input, "botAlias", function () { return input.botAlias; }, "{botAlias}", false);
153
+ resolvedPath = __resolvedPath(resolvedPath, input, "userId", function () { return input.userId; }, "{userId}", false);
274
154
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.activeContexts != null && {
275
155
  activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context),
276
156
  })), (input.dialogAction != null && {
@@ -300,36 +180,32 @@ export var deserializeAws_restJson1DeleteSessionCommand = function (output, cont
300
180
  if (output.statusCode !== 200 && output.statusCode >= 300) {
301
181
  return [2, deserializeAws_restJson1DeleteSessionCommandError(output, context)];
302
182
  }
303
- contents = {
183
+ contents = map({
304
184
  $metadata: deserializeMetadata(output),
305
- botAlias: undefined,
306
- botName: undefined,
307
- sessionId: undefined,
308
- userId: undefined,
309
- };
185
+ });
310
186
  _a = __expectNonNull;
311
187
  _b = __expectObject;
312
188
  return [4, parseBody(output.body, context)];
313
189
  case 1:
314
190
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
315
- if (data.botAlias !== undefined && data.botAlias !== null) {
191
+ if (data.botAlias != null) {
316
192
  contents.botAlias = __expectString(data.botAlias);
317
193
  }
318
- if (data.botName !== undefined && data.botName !== null) {
194
+ if (data.botName != null) {
319
195
  contents.botName = __expectString(data.botName);
320
196
  }
321
- if (data.sessionId !== undefined && data.sessionId !== null) {
197
+ if (data.sessionId != null) {
322
198
  contents.sessionId = __expectString(data.sessionId);
323
199
  }
324
- if (data.userId !== undefined && data.userId !== null) {
200
+ if (data.userId != null) {
325
201
  contents.userId = __expectString(data.userId);
326
202
  }
327
- return [2, Promise.resolve(contents)];
203
+ return [2, contents];
328
204
  }
329
205
  });
330
206
  }); };
331
207
  var deserializeAws_restJson1DeleteSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
332
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
208
+ var parsedOutput, _a, errorCode, _b, parsedBody;
333
209
  var _c;
334
210
  return __generator(this, function (_d) {
335
211
  switch (_d.label) {
@@ -366,14 +242,14 @@ var deserializeAws_restJson1DeleteSessionCommandError = function (output, contex
366
242
  case 11: throw _d.sent();
367
243
  case 12:
368
244
  parsedBody = parsedOutput.body;
369
- $metadata = deserializeMetadata(output);
370
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
371
- response = new __BaseException({
372
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
373
- $fault: "client",
374
- $metadata: $metadata,
245
+ throwDefaultError({
246
+ output: output,
247
+ parsedBody: parsedBody,
248
+ exceptionCtor: __BaseException,
249
+ errorCode: errorCode,
375
250
  });
376
- throw __decorateServiceException(response, parsedBody);
251
+ _d.label = 13;
252
+ case 13: return [2];
377
253
  }
378
254
  });
379
255
  }); };
@@ -385,40 +261,35 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
385
261
  if (output.statusCode !== 200 && output.statusCode >= 300) {
386
262
  return [2, deserializeAws_restJson1GetSessionCommandError(output, context)];
387
263
  }
388
- contents = {
264
+ contents = map({
389
265
  $metadata: deserializeMetadata(output),
390
- activeContexts: undefined,
391
- dialogAction: undefined,
392
- recentIntentSummaryView: undefined,
393
- sessionAttributes: undefined,
394
- sessionId: undefined,
395
- };
266
+ });
396
267
  _a = __expectNonNull;
397
268
  _b = __expectObject;
398
269
  return [4, parseBody(output.body, context)];
399
270
  case 1:
400
271
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
401
- if (data.activeContexts !== undefined && data.activeContexts !== null) {
272
+ if (data.activeContexts != null) {
402
273
  contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
403
274
  }
404
- if (data.dialogAction !== undefined && data.dialogAction !== null) {
275
+ if (data.dialogAction != null) {
405
276
  contents.dialogAction = deserializeAws_restJson1DialogAction(data.dialogAction, context);
406
277
  }
407
- if (data.recentIntentSummaryView !== undefined && data.recentIntentSummaryView !== null) {
278
+ if (data.recentIntentSummaryView != null) {
408
279
  contents.recentIntentSummaryView = deserializeAws_restJson1IntentSummaryList(data.recentIntentSummaryView, context);
409
280
  }
410
- if (data.sessionAttributes !== undefined && data.sessionAttributes !== null) {
281
+ if (data.sessionAttributes != null) {
411
282
  contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
412
283
  }
413
- if (data.sessionId !== undefined && data.sessionId !== null) {
284
+ if (data.sessionId != null) {
414
285
  contents.sessionId = __expectString(data.sessionId);
415
286
  }
416
- return [2, Promise.resolve(contents)];
287
+ return [2, contents];
417
288
  }
418
289
  });
419
290
  }); };
420
291
  var deserializeAws_restJson1GetSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
421
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
292
+ var parsedOutput, _a, errorCode, _b, parsedBody;
422
293
  var _c;
423
294
  return __generator(this, function (_d) {
424
295
  switch (_d.label) {
@@ -451,14 +322,14 @@ var deserializeAws_restJson1GetSessionCommandError = function (output, context)
451
322
  case 9: throw _d.sent();
452
323
  case 10:
453
324
  parsedBody = parsedOutput.body;
454
- $metadata = deserializeMetadata(output);
455
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
456
- response = new __BaseException({
457
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
458
- $fault: "client",
459
- $metadata: $metadata,
325
+ throwDefaultError({
326
+ output: output,
327
+ parsedBody: parsedBody,
328
+ exceptionCtor: __BaseException,
329
+ errorCode: errorCode,
460
330
  });
461
- throw __decorateServiceException(response, parsedBody);
331
+ _d.label = 11;
332
+ case 11: return [2];
462
333
  }
463
334
  });
464
335
  }); };
@@ -468,85 +339,58 @@ export var deserializeAws_restJson1PostContentCommand = function (output, contex
468
339
  if (output.statusCode !== 200 && output.statusCode >= 300) {
469
340
  return [2, deserializeAws_restJson1PostContentCommandError(output, context)];
470
341
  }
471
- contents = {
342
+ contents = map({
472
343
  $metadata: deserializeMetadata(output),
473
- activeContexts: undefined,
474
- alternativeIntents: undefined,
475
- audioStream: undefined,
476
- botVersion: undefined,
477
- contentType: undefined,
478
- dialogState: undefined,
479
- encodedInputTranscript: undefined,
480
- encodedMessage: undefined,
481
- inputTranscript: undefined,
482
- intentName: undefined,
483
- message: undefined,
484
- messageFormat: undefined,
485
- nluIntentConfidence: undefined,
486
- sentimentResponse: undefined,
487
- sessionAttributes: undefined,
488
- sessionId: undefined,
489
- slotToElicit: undefined,
490
- slots: undefined,
491
- };
492
- if (output.headers["content-type"] !== undefined) {
493
- contents.contentType = output.headers["content-type"];
494
- }
495
- if (output.headers["x-amz-lex-intent-name"] !== undefined) {
496
- contents.intentName = output.headers["x-amz-lex-intent-name"];
497
- }
498
- if (output.headers["x-amz-lex-nlu-intent-confidence"] !== undefined) {
499
- contents.nluIntentConfidence = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"));
500
- }
501
- if (output.headers["x-amz-lex-alternative-intents"] !== undefined) {
502
- contents.alternativeIntents = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8"));
503
- }
504
- if (output.headers["x-amz-lex-slots"] !== undefined) {
505
- contents.slots = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
506
- }
507
- if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
508
- contents.sessionAttributes = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
509
- }
510
- if (output.headers["x-amz-lex-sentiment"] !== undefined) {
511
- contents.sentimentResponse = output.headers["x-amz-lex-sentiment"];
512
- }
513
- if (output.headers["x-amz-lex-message"] !== undefined) {
514
- contents.message = output.headers["x-amz-lex-message"];
515
- }
516
- if (output.headers["x-amz-lex-encoded-message"] !== undefined) {
517
- contents.encodedMessage = output.headers["x-amz-lex-encoded-message"];
518
- }
519
- if (output.headers["x-amz-lex-message-format"] !== undefined) {
520
- contents.messageFormat = output.headers["x-amz-lex-message-format"];
521
- }
522
- if (output.headers["x-amz-lex-dialog-state"] !== undefined) {
523
- contents.dialogState = output.headers["x-amz-lex-dialog-state"];
524
- }
525
- if (output.headers["x-amz-lex-slot-to-elicit"] !== undefined) {
526
- contents.slotToElicit = output.headers["x-amz-lex-slot-to-elicit"];
527
- }
528
- if (output.headers["x-amz-lex-input-transcript"] !== undefined) {
529
- contents.inputTranscript = output.headers["x-amz-lex-input-transcript"];
530
- }
531
- if (output.headers["x-amz-lex-encoded-input-transcript"] !== undefined) {
532
- contents.encodedInputTranscript = output.headers["x-amz-lex-encoded-input-transcript"];
533
- }
534
- if (output.headers["x-amz-lex-bot-version"] !== undefined) {
535
- contents.botVersion = output.headers["x-amz-lex-bot-version"];
536
- }
537
- if (output.headers["x-amz-lex-session-id"] !== undefined) {
538
- contents.sessionId = output.headers["x-amz-lex-session-id"];
539
- }
540
- if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
541
- contents.activeContexts = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
542
- }
344
+ contentType: [, output.headers["content-type"]],
345
+ intentName: [, output.headers["x-amz-lex-intent-name"]],
346
+ nluIntentConfidence: [
347
+ function () { return void 0 !== output.headers["x-amz-lex-nlu-intent-confidence"]; },
348
+ function () {
349
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"));
350
+ },
351
+ ],
352
+ alternativeIntents: [
353
+ function () { return void 0 !== output.headers["x-amz-lex-alternative-intents"]; },
354
+ function () {
355
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-alternative-intents"])).toString("utf8"));
356
+ },
357
+ ],
358
+ slots: [
359
+ function () { return void 0 !== output.headers["x-amz-lex-slots"]; },
360
+ function () {
361
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
362
+ },
363
+ ],
364
+ sessionAttributes: [
365
+ function () { return void 0 !== output.headers["x-amz-lex-session-attributes"]; },
366
+ function () {
367
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
368
+ },
369
+ ],
370
+ sentimentResponse: [, output.headers["x-amz-lex-sentiment"]],
371
+ message: [, output.headers["x-amz-lex-message"]],
372
+ encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
373
+ messageFormat: [, output.headers["x-amz-lex-message-format"]],
374
+ dialogState: [, output.headers["x-amz-lex-dialog-state"]],
375
+ slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
376
+ inputTranscript: [, output.headers["x-amz-lex-input-transcript"]],
377
+ encodedInputTranscript: [, output.headers["x-amz-lex-encoded-input-transcript"]],
378
+ botVersion: [, output.headers["x-amz-lex-bot-version"]],
379
+ sessionId: [, output.headers["x-amz-lex-session-id"]],
380
+ activeContexts: [
381
+ function () { return void 0 !== output.headers["x-amz-lex-active-contexts"]; },
382
+ function () {
383
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
384
+ },
385
+ ],
386
+ });
543
387
  data = output.body;
544
388
  contents.audioStream = data;
545
- return [2, Promise.resolve(contents)];
389
+ return [2, contents];
546
390
  });
547
391
  }); };
548
392
  var deserializeAws_restJson1PostContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
549
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
393
+ var parsedOutput, _a, errorCode, _b, parsedBody;
550
394
  var _c;
551
395
  return __generator(this, function (_d) {
552
396
  switch (_d.label) {
@@ -607,14 +451,14 @@ var deserializeAws_restJson1PostContentCommandError = function (output, context)
607
451
  case 23: throw _d.sent();
608
452
  case 24:
609
453
  parsedBody = parsedOutput.body;
610
- $metadata = deserializeMetadata(output);
611
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
612
- response = new __BaseException({
613
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
614
- $fault: "client",
615
- $metadata: $metadata,
454
+ throwDefaultError({
455
+ output: output,
456
+ parsedBody: parsedBody,
457
+ exceptionCtor: __BaseException,
458
+ errorCode: errorCode,
616
459
  });
617
- throw __decorateServiceException(response, parsedBody);
460
+ _d.label = 25;
461
+ case 25: return [2];
618
462
  }
619
463
  });
620
464
  }); };
@@ -626,76 +470,62 @@ export var deserializeAws_restJson1PostTextCommand = function (output, context)
626
470
  if (output.statusCode !== 200 && output.statusCode >= 300) {
627
471
  return [2, deserializeAws_restJson1PostTextCommandError(output, context)];
628
472
  }
629
- contents = {
473
+ contents = map({
630
474
  $metadata: deserializeMetadata(output),
631
- activeContexts: undefined,
632
- alternativeIntents: undefined,
633
- botVersion: undefined,
634
- dialogState: undefined,
635
- intentName: undefined,
636
- message: undefined,
637
- messageFormat: undefined,
638
- nluIntentConfidence: undefined,
639
- responseCard: undefined,
640
- sentimentResponse: undefined,
641
- sessionAttributes: undefined,
642
- sessionId: undefined,
643
- slotToElicit: undefined,
644
- slots: undefined,
645
- };
475
+ });
646
476
  _a = __expectNonNull;
647
477
  _b = __expectObject;
648
478
  return [4, parseBody(output.body, context)];
649
479
  case 1:
650
480
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
651
- if (data.activeContexts !== undefined && data.activeContexts !== null) {
481
+ if (data.activeContexts != null) {
652
482
  contents.activeContexts = deserializeAws_restJson1ActiveContextsList(data.activeContexts, context);
653
483
  }
654
- if (data.alternativeIntents !== undefined && data.alternativeIntents !== null) {
484
+ if (data.alternativeIntents != null) {
655
485
  contents.alternativeIntents = deserializeAws_restJson1IntentList(data.alternativeIntents, context);
656
486
  }
657
- if (data.botVersion !== undefined && data.botVersion !== null) {
487
+ if (data.botVersion != null) {
658
488
  contents.botVersion = __expectString(data.botVersion);
659
489
  }
660
- if (data.dialogState !== undefined && data.dialogState !== null) {
490
+ if (data.dialogState != null) {
661
491
  contents.dialogState = __expectString(data.dialogState);
662
492
  }
663
- if (data.intentName !== undefined && data.intentName !== null) {
493
+ if (data.intentName != null) {
664
494
  contents.intentName = __expectString(data.intentName);
665
495
  }
666
- if (data.message !== undefined && data.message !== null) {
496
+ if (data.message != null) {
667
497
  contents.message = __expectString(data.message);
668
498
  }
669
- if (data.messageFormat !== undefined && data.messageFormat !== null) {
499
+ if (data.messageFormat != null) {
670
500
  contents.messageFormat = __expectString(data.messageFormat);
671
501
  }
672
- if (data.nluIntentConfidence !== undefined && data.nluIntentConfidence !== null) {
502
+ if (data.nluIntentConfidence != null) {
673
503
  contents.nluIntentConfidence = deserializeAws_restJson1IntentConfidence(data.nluIntentConfidence, context);
674
504
  }
675
- if (data.responseCard !== undefined && data.responseCard !== null) {
505
+ if (data.responseCard != null) {
676
506
  contents.responseCard = deserializeAws_restJson1ResponseCard(data.responseCard, context);
677
507
  }
678
- if (data.sentimentResponse !== undefined && data.sentimentResponse !== null) {
508
+ if (data.sentimentResponse != null) {
679
509
  contents.sentimentResponse = deserializeAws_restJson1SentimentResponse(data.sentimentResponse, context);
680
510
  }
681
- if (data.sessionAttributes !== undefined && data.sessionAttributes !== null) {
511
+ if (data.sessionAttributes != null) {
682
512
  contents.sessionAttributes = deserializeAws_restJson1StringMap(data.sessionAttributes, context);
683
513
  }
684
- if (data.sessionId !== undefined && data.sessionId !== null) {
514
+ if (data.sessionId != null) {
685
515
  contents.sessionId = __expectString(data.sessionId);
686
516
  }
687
- if (data.slotToElicit !== undefined && data.slotToElicit !== null) {
517
+ if (data.slotToElicit != null) {
688
518
  contents.slotToElicit = __expectString(data.slotToElicit);
689
519
  }
690
- if (data.slots !== undefined && data.slots !== null) {
520
+ if (data.slots != null) {
691
521
  contents.slots = deserializeAws_restJson1StringMap(data.slots, context);
692
522
  }
693
- return [2, Promise.resolve(contents)];
523
+ return [2, contents];
694
524
  }
695
525
  });
696
526
  }); };
697
527
  var deserializeAws_restJson1PostTextCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
698
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
528
+ var parsedOutput, _a, errorCode, _b, parsedBody;
699
529
  var _c;
700
530
  return __generator(this, function (_d) {
701
531
  switch (_d.label) {
@@ -744,14 +574,14 @@ var deserializeAws_restJson1PostTextCommandError = function (output, context) {
744
574
  case 17: throw _d.sent();
745
575
  case 18:
746
576
  parsedBody = parsedOutput.body;
747
- $metadata = deserializeMetadata(output);
748
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
749
- response = new __BaseException({
750
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
751
- $fault: "client",
752
- $metadata: $metadata,
577
+ throwDefaultError({
578
+ output: output,
579
+ parsedBody: parsedBody,
580
+ exceptionCtor: __BaseException,
581
+ errorCode: errorCode,
753
582
  });
754
- throw __decorateServiceException(response, parsedBody);
583
+ _d.label = 19;
584
+ case 19: return [2];
755
585
  }
756
586
  });
757
587
  }); };
@@ -761,61 +591,42 @@ export var deserializeAws_restJson1PutSessionCommand = function (output, context
761
591
  if (output.statusCode !== 200 && output.statusCode >= 300) {
762
592
  return [2, deserializeAws_restJson1PutSessionCommandError(output, context)];
763
593
  }
764
- contents = {
594
+ contents = map({
765
595
  $metadata: deserializeMetadata(output),
766
- activeContexts: undefined,
767
- audioStream: undefined,
768
- contentType: undefined,
769
- dialogState: undefined,
770
- encodedMessage: undefined,
771
- intentName: undefined,
772
- message: undefined,
773
- messageFormat: undefined,
774
- sessionAttributes: undefined,
775
- sessionId: undefined,
776
- slotToElicit: undefined,
777
- slots: undefined,
778
- };
779
- if (output.headers["content-type"] !== undefined) {
780
- contents.contentType = output.headers["content-type"];
781
- }
782
- if (output.headers["x-amz-lex-intent-name"] !== undefined) {
783
- contents.intentName = output.headers["x-amz-lex-intent-name"];
784
- }
785
- if (output.headers["x-amz-lex-slots"] !== undefined) {
786
- contents.slots = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
787
- }
788
- if (output.headers["x-amz-lex-session-attributes"] !== undefined) {
789
- contents.sessionAttributes = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
790
- }
791
- if (output.headers["x-amz-lex-message"] !== undefined) {
792
- contents.message = output.headers["x-amz-lex-message"];
793
- }
794
- if (output.headers["x-amz-lex-encoded-message"] !== undefined) {
795
- contents.encodedMessage = output.headers["x-amz-lex-encoded-message"];
796
- }
797
- if (output.headers["x-amz-lex-message-format"] !== undefined) {
798
- contents.messageFormat = output.headers["x-amz-lex-message-format"];
799
- }
800
- if (output.headers["x-amz-lex-dialog-state"] !== undefined) {
801
- contents.dialogState = output.headers["x-amz-lex-dialog-state"];
802
- }
803
- if (output.headers["x-amz-lex-slot-to-elicit"] !== undefined) {
804
- contents.slotToElicit = output.headers["x-amz-lex-slot-to-elicit"];
805
- }
806
- if (output.headers["x-amz-lex-session-id"] !== undefined) {
807
- contents.sessionId = output.headers["x-amz-lex-session-id"];
808
- }
809
- if (output.headers["x-amz-lex-active-contexts"] !== undefined) {
810
- contents.activeContexts = new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
811
- }
596
+ contentType: [, output.headers["content-type"]],
597
+ intentName: [, output.headers["x-amz-lex-intent-name"]],
598
+ slots: [
599
+ function () { return void 0 !== output.headers["x-amz-lex-slots"]; },
600
+ function () {
601
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-slots"])).toString("utf8"));
602
+ },
603
+ ],
604
+ sessionAttributes: [
605
+ function () { return void 0 !== output.headers["x-amz-lex-session-attributes"]; },
606
+ function () {
607
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-session-attributes"])).toString("utf8"));
608
+ },
609
+ ],
610
+ message: [, output.headers["x-amz-lex-message"]],
611
+ encodedMessage: [, output.headers["x-amz-lex-encoded-message"]],
612
+ messageFormat: [, output.headers["x-amz-lex-message-format"]],
613
+ dialogState: [, output.headers["x-amz-lex-dialog-state"]],
614
+ slotToElicit: [, output.headers["x-amz-lex-slot-to-elicit"]],
615
+ sessionId: [, output.headers["x-amz-lex-session-id"]],
616
+ activeContexts: [
617
+ function () { return void 0 !== output.headers["x-amz-lex-active-contexts"]; },
618
+ function () {
619
+ return new __LazyJsonString(Buffer.from(context.base64Decoder(output.headers["x-amz-lex-active-contexts"])).toString("utf8"));
620
+ },
621
+ ],
622
+ });
812
623
  data = output.body;
813
624
  contents.audioStream = data;
814
- return [2, Promise.resolve(contents)];
625
+ return [2, contents];
815
626
  });
816
627
  }); };
817
628
  var deserializeAws_restJson1PutSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
818
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
629
+ var parsedOutput, _a, errorCode, _b, parsedBody;
819
630
  var _c;
820
631
  return __generator(this, function (_d) {
821
632
  switch (_d.label) {
@@ -864,23 +675,24 @@ var deserializeAws_restJson1PutSessionCommandError = function (output, context)
864
675
  case 17: throw _d.sent();
865
676
  case 18:
866
677
  parsedBody = parsedOutput.body;
867
- $metadata = deserializeMetadata(output);
868
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
869
- response = new __BaseException({
870
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
871
- $fault: "client",
872
- $metadata: $metadata,
678
+ throwDefaultError({
679
+ output: output,
680
+ parsedBody: parsedBody,
681
+ exceptionCtor: __BaseException,
682
+ errorCode: errorCode,
873
683
  });
874
- throw __decorateServiceException(response, parsedBody);
684
+ _d.label = 19;
685
+ case 19: return [2];
875
686
  }
876
687
  });
877
688
  }); };
689
+ var map = __map;
878
690
  var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
879
691
  var contents, data, exception;
880
692
  return __generator(this, function (_a) {
881
- contents = {};
693
+ contents = map({});
882
694
  data = parsedOutput.body;
883
- if (data.Message !== undefined && data.Message !== null) {
695
+ if (data.Message != null) {
884
696
  contents.Message = __expectString(data.Message);
885
697
  }
886
698
  exception = new BadGatewayException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -890,9 +702,9 @@ var deserializeAws_restJson1BadGatewayExceptionResponse = function (parsedOutput
890
702
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
891
703
  var contents, data, exception;
892
704
  return __generator(this, function (_a) {
893
- contents = {};
705
+ contents = map({});
894
706
  data = parsedOutput.body;
895
- if (data.message !== undefined && data.message !== null) {
707
+ if (data.message != null) {
896
708
  contents.message = __expectString(data.message);
897
709
  }
898
710
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -902,9 +714,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
902
714
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
903
715
  var contents, data, exception;
904
716
  return __generator(this, function (_a) {
905
- contents = {};
717
+ contents = map({});
906
718
  data = parsedOutput.body;
907
- if (data.message !== undefined && data.message !== null) {
719
+ if (data.message != null) {
908
720
  contents.message = __expectString(data.message);
909
721
  }
910
722
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -914,9 +726,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
914
726
  var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
915
727
  var contents, data, exception;
916
728
  return __generator(this, function (_a) {
917
- contents = {};
729
+ contents = map({});
918
730
  data = parsedOutput.body;
919
- if (data.Message !== undefined && data.Message !== null) {
731
+ if (data.Message != null) {
920
732
  contents.Message = __expectString(data.Message);
921
733
  }
922
734
  exception = new DependencyFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -926,9 +738,9 @@ var deserializeAws_restJson1DependencyFailedExceptionResponse = function (parsed
926
738
  var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
927
739
  var contents, data, exception;
928
740
  return __generator(this, function (_a) {
929
- contents = {};
741
+ contents = map({});
930
742
  data = parsedOutput.body;
931
- if (data.message !== undefined && data.message !== null) {
743
+ if (data.message != null) {
932
744
  contents.message = __expectString(data.message);
933
745
  }
934
746
  exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -938,12 +750,11 @@ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedO
938
750
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
939
751
  var contents, data, exception;
940
752
  return __generator(this, function (_a) {
941
- contents = {};
942
- if (parsedOutput.headers["retry-after"] !== undefined) {
943
- contents.retryAfterSeconds = parsedOutput.headers["retry-after"];
944
- }
753
+ contents = map({
754
+ retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
755
+ });
945
756
  data = parsedOutput.body;
946
- if (data.message !== undefined && data.message !== null) {
757
+ if (data.message != null) {
947
758
  contents.message = __expectString(data.message);
948
759
  }
949
760
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -953,9 +764,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
953
764
  var deserializeAws_restJson1LoopDetectedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
954
765
  var contents, data, exception;
955
766
  return __generator(this, function (_a) {
956
- contents = {};
767
+ contents = map({});
957
768
  data = parsedOutput.body;
958
- if (data.Message !== undefined && data.Message !== null) {
769
+ if (data.Message != null) {
959
770
  contents.Message = __expectString(data.Message);
960
771
  }
961
772
  exception = new LoopDetectedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -965,9 +776,9 @@ var deserializeAws_restJson1LoopDetectedExceptionResponse = function (parsedOutp
965
776
  var deserializeAws_restJson1NotAcceptableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
966
777
  var contents, data, exception;
967
778
  return __generator(this, function (_a) {
968
- contents = {};
779
+ contents = map({});
969
780
  data = parsedOutput.body;
970
- if (data.message !== undefined && data.message !== null) {
781
+ if (data.message != null) {
971
782
  contents.message = __expectString(data.message);
972
783
  }
973
784
  exception = new NotAcceptableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -977,9 +788,9 @@ var deserializeAws_restJson1NotAcceptableExceptionResponse = function (parsedOut
977
788
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
978
789
  var contents, data, exception;
979
790
  return __generator(this, function (_a) {
980
- contents = {};
791
+ contents = map({});
981
792
  data = parsedOutput.body;
982
- if (data.message !== undefined && data.message !== null) {
793
+ if (data.message != null) {
983
794
  contents.message = __expectString(data.message);
984
795
  }
985
796
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -989,9 +800,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
989
800
  var deserializeAws_restJson1RequestTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
990
801
  var contents, data, exception;
991
802
  return __generator(this, function (_a) {
992
- contents = {};
803
+ contents = map({});
993
804
  data = parsedOutput.body;
994
- if (data.message !== undefined && data.message !== null) {
805
+ if (data.message != null) {
995
806
  contents.message = __expectString(data.message);
996
807
  }
997
808
  exception = new RequestTimeoutException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1001,9 +812,9 @@ var deserializeAws_restJson1RequestTimeoutExceptionResponse = function (parsedOu
1001
812
  var deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1002
813
  var contents, data, exception;
1003
814
  return __generator(this, function (_a) {
1004
- contents = {};
815
+ contents = map({});
1005
816
  data = parsedOutput.body;
1006
- if (data.message !== undefined && data.message !== null) {
817
+ if (data.message != null) {
1007
818
  contents.message = __expectString(data.message);
1008
819
  }
1009
820
  exception = new UnsupportedMediaTypeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1031,9 +842,6 @@ var serializeAws_restJson1ActiveContextsList = function (input, context) {
1031
842
  return input
1032
843
  .filter(function (e) { return e != null; })
1033
844
  .map(function (entry) {
1034
- if (entry === null) {
1035
- return null;
1036
- }
1037
845
  return serializeAws_restJson1ActiveContext(entry, context);
1038
846
  });
1039
847
  };
@@ -1050,9 +858,6 @@ var serializeAws_restJson1IntentSummaryList = function (input, context) {
1050
858
  return input
1051
859
  .filter(function (e) { return e != null; })
1052
860
  .map(function (entry) {
1053
- if (entry === null) {
1054
- return null;
1055
- }
1056
861
  return serializeAws_restJson1IntentSummary(entry, context);
1057
862
  });
1058
863
  };