@aws-sdk/client-wisdom 3.131.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/CreateAssistantAssociationCommand.js +2 -2
  4. package/dist-cjs/commands/CreateAssistantCommand.js +2 -2
  5. package/dist-cjs/commands/CreateContentCommand.js +2 -2
  6. package/dist-cjs/commands/CreateKnowledgeBaseCommand.js +2 -2
  7. package/dist-cjs/commands/CreateSessionCommand.js +2 -2
  8. package/dist-cjs/commands/DeleteAssistantAssociationCommand.js +2 -2
  9. package/dist-cjs/commands/DeleteAssistantCommand.js +2 -2
  10. package/dist-cjs/commands/DeleteContentCommand.js +2 -2
  11. package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js +2 -2
  12. package/dist-cjs/commands/GetAssistantAssociationCommand.js +2 -2
  13. package/dist-cjs/commands/GetAssistantCommand.js +2 -2
  14. package/dist-cjs/commands/GetContentCommand.js +2 -2
  15. package/dist-cjs/commands/GetContentSummaryCommand.js +2 -2
  16. package/dist-cjs/commands/GetKnowledgeBaseCommand.js +2 -2
  17. package/dist-cjs/commands/GetRecommendationsCommand.js +2 -2
  18. package/dist-cjs/commands/GetSessionCommand.js +2 -2
  19. package/dist-cjs/commands/ListAssistantAssociationsCommand.js +2 -2
  20. package/dist-cjs/commands/ListAssistantsCommand.js +2 -2
  21. package/dist-cjs/commands/ListContentsCommand.js +2 -2
  22. package/dist-cjs/commands/ListKnowledgeBasesCommand.js +2 -2
  23. package/dist-cjs/commands/ListTagsForResourceCommand.js +2 -2
  24. package/dist-cjs/commands/NotifyRecommendationsReceivedCommand.js +2 -2
  25. package/dist-cjs/commands/QueryAssistantCommand.js +2 -2
  26. package/dist-cjs/commands/RemoveKnowledgeBaseTemplateUriCommand.js +2 -2
  27. package/dist-cjs/commands/SearchContentCommand.js +2 -2
  28. package/dist-cjs/commands/SearchSessionsCommand.js +2 -2
  29. package/dist-cjs/commands/StartContentUploadCommand.js +2 -2
  30. package/dist-cjs/commands/TagResourceCommand.js +2 -2
  31. package/dist-cjs/commands/UntagResourceCommand.js +2 -2
  32. package/dist-cjs/commands/UpdateContentCommand.js +2 -2
  33. package/dist-cjs/commands/UpdateKnowledgeBaseTemplateUriCommand.js +2 -2
  34. package/dist-cjs/models/models_0.js +428 -600
  35. package/dist-cjs/protocols/Aws_restJson1.js +371 -832
  36. package/dist-es/commands/CreateAssistantAssociationCommand.js +3 -3
  37. package/dist-es/commands/CreateAssistantCommand.js +3 -3
  38. package/dist-es/commands/CreateContentCommand.js +3 -3
  39. package/dist-es/commands/CreateKnowledgeBaseCommand.js +3 -3
  40. package/dist-es/commands/CreateSessionCommand.js +3 -3
  41. package/dist-es/commands/DeleteAssistantAssociationCommand.js +3 -3
  42. package/dist-es/commands/DeleteAssistantCommand.js +3 -3
  43. package/dist-es/commands/DeleteContentCommand.js +3 -3
  44. package/dist-es/commands/DeleteKnowledgeBaseCommand.js +3 -3
  45. package/dist-es/commands/GetAssistantAssociationCommand.js +3 -3
  46. package/dist-es/commands/GetAssistantCommand.js +3 -3
  47. package/dist-es/commands/GetContentCommand.js +3 -3
  48. package/dist-es/commands/GetContentSummaryCommand.js +3 -3
  49. package/dist-es/commands/GetKnowledgeBaseCommand.js +3 -3
  50. package/dist-es/commands/GetRecommendationsCommand.js +3 -3
  51. package/dist-es/commands/GetSessionCommand.js +3 -3
  52. package/dist-es/commands/ListAssistantAssociationsCommand.js +3 -3
  53. package/dist-es/commands/ListAssistantsCommand.js +3 -3
  54. package/dist-es/commands/ListContentsCommand.js +3 -3
  55. package/dist-es/commands/ListKnowledgeBasesCommand.js +3 -3
  56. package/dist-es/commands/ListTagsForResourceCommand.js +3 -3
  57. package/dist-es/commands/NotifyRecommendationsReceivedCommand.js +3 -3
  58. package/dist-es/commands/QueryAssistantCommand.js +3 -3
  59. package/dist-es/commands/RemoveKnowledgeBaseTemplateUriCommand.js +3 -3
  60. package/dist-es/commands/SearchContentCommand.js +3 -3
  61. package/dist-es/commands/SearchSessionsCommand.js +3 -3
  62. package/dist-es/commands/StartContentUploadCommand.js +3 -3
  63. package/dist-es/commands/TagResourceCommand.js +3 -3
  64. package/dist-es/commands/UntagResourceCommand.js +3 -3
  65. package/dist-es/commands/UpdateContentCommand.js +3 -3
  66. package/dist-es/commands/UpdateKnowledgeBaseTemplateUriCommand.js +3 -3
  67. package/dist-es/models/models_0.js +137 -400
  68. package/dist-es/protocols/Aws_restJson1.js +492 -837
  69. package/dist-types/models/models_0.d.ts +364 -538
  70. package/dist-types/ts3.4/models/models_0.d.ts +182 -356
  71. package/package.json +6 -6
@@ -1,6 +1,6 @@
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, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AccessDeniedException, AssistantAssociationInputData, ConflictException, PreconditionFailedException, ResourceNotFoundException, ServiceQuotaExceededException, SourceConfiguration, TooManyTagsException, ValidationException, } from "../models/models_0";
6
6
  import { WisdomServiceException as __BaseException } from "../models/WisdomServiceException";
@@ -32,7 +32,7 @@ export var serializeAws_restJson1CreateAssistantCommand = function (input, conte
32
32
  });
33
33
  }); };
34
34
  export var serializeAws_restJson1CreateAssistantAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
35
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
36
  var _c;
37
37
  return __generator(this, function (_d) {
38
38
  switch (_d.label) {
@@ -43,16 +43,7 @@ export var serializeAws_restJson1CreateAssistantAssociationCommand = function (i
43
43
  "content-type": "application/json",
44
44
  };
45
45
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/associations";
46
- if (input.assistantId !== undefined) {
47
- labelValue = input.assistantId;
48
- if (labelValue.length <= 0) {
49
- throw new Error("Empty value provided for input HTTP label: assistantId.");
50
- }
51
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
52
- }
53
- else {
54
- throw new Error("No value provided for input HTTP label: assistantId.");
55
- }
46
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
56
47
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.association != null && {
57
48
  association: serializeAws_restJson1AssistantAssociationInputData(input.association, context),
58
49
  })), (input.associationType != null && { associationType: input.associationType })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
@@ -69,7 +60,7 @@ export var serializeAws_restJson1CreateAssistantAssociationCommand = function (i
69
60
  });
70
61
  }); };
71
62
  export var serializeAws_restJson1CreateContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
72
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
63
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
73
64
  var _c;
74
65
  return __generator(this, function (_d) {
75
66
  switch (_d.label) {
@@ -81,16 +72,7 @@ export var serializeAws_restJson1CreateContentCommand = function (input, context
81
72
  };
82
73
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
83
74
  "/knowledgeBases/{knowledgeBaseId}/contents";
84
- if (input.knowledgeBaseId !== undefined) {
85
- labelValue = input.knowledgeBaseId;
86
- if (labelValue.length <= 0) {
87
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
88
- }
89
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
90
- }
91
- else {
92
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
93
- }
75
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
94
76
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.metadata != null && { metadata: serializeAws_restJson1ContentMetadata(input.metadata, context) })), (input.name != null && { name: input.name })), (input.overrideLinkOutUri != null && { overrideLinkOutUri: input.overrideLinkOutUri })), (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })), (input.title != null && { title: input.title })), (input.uploadId != null && { uploadId: input.uploadId })));
95
77
  return [2, new __HttpRequest({
96
78
  protocol: protocol,
@@ -136,7 +118,7 @@ export var serializeAws_restJson1CreateKnowledgeBaseCommand = function (input, c
136
118
  });
137
119
  }); };
138
120
  export var serializeAws_restJson1CreateSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
121
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
140
122
  var _c;
141
123
  return __generator(this, function (_d) {
142
124
  switch (_d.label) {
@@ -147,16 +129,7 @@ export var serializeAws_restJson1CreateSessionCommand = function (input, context
147
129
  "content-type": "application/json",
148
130
  };
149
131
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/sessions";
150
- if (input.assistantId !== undefined) {
151
- labelValue = input.assistantId;
152
- if (labelValue.length <= 0) {
153
- throw new Error("Empty value provided for input HTTP label: assistantId.");
154
- }
155
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
156
- }
157
- else {
158
- throw new Error("No value provided for input HTTP label: assistantId.");
159
- }
132
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
160
133
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.description != null && { description: input.description })), (input.name != null && { name: input.name })), (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
161
134
  return [2, new __HttpRequest({
162
135
  protocol: protocol,
@@ -171,7 +144,7 @@ export var serializeAws_restJson1CreateSessionCommand = function (input, context
171
144
  });
172
145
  }); };
173
146
  export var serializeAws_restJson1DeleteAssistantCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
174
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
147
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
175
148
  return __generator(this, function (_c) {
176
149
  switch (_c.label) {
177
150
  case 0: return [4, context.endpoint()];
@@ -179,16 +152,7 @@ export var serializeAws_restJson1DeleteAssistantCommand = function (input, conte
179
152
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
180
153
  headers = {};
181
154
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}";
182
- if (input.assistantId !== undefined) {
183
- labelValue = input.assistantId;
184
- if (labelValue.length <= 0) {
185
- throw new Error("Empty value provided for input HTTP label: assistantId.");
186
- }
187
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
188
- }
189
- else {
190
- throw new Error("No value provided for input HTTP label: assistantId.");
191
- }
155
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
192
156
  return [2, new __HttpRequest({
193
157
  protocol: protocol,
194
158
  hostname: hostname,
@@ -202,7 +166,7 @@ export var serializeAws_restJson1DeleteAssistantCommand = function (input, conte
202
166
  });
203
167
  }); };
204
168
  export var serializeAws_restJson1DeleteAssistantAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
205
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
169
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
206
170
  return __generator(this, function (_c) {
207
171
  switch (_c.label) {
208
172
  case 0: return [4, context.endpoint()];
@@ -211,26 +175,8 @@ export var serializeAws_restJson1DeleteAssistantAssociationCommand = function (i
211
175
  headers = {};
212
176
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
213
177
  "/assistants/{assistantId}/associations/{assistantAssociationId}";
214
- if (input.assistantAssociationId !== undefined) {
215
- labelValue = input.assistantAssociationId;
216
- if (labelValue.length <= 0) {
217
- throw new Error("Empty value provided for input HTTP label: assistantAssociationId.");
218
- }
219
- resolvedPath = resolvedPath.replace("{assistantAssociationId}", __extendedEncodeURIComponent(labelValue));
220
- }
221
- else {
222
- throw new Error("No value provided for input HTTP label: assistantAssociationId.");
223
- }
224
- if (input.assistantId !== undefined) {
225
- labelValue = input.assistantId;
226
- if (labelValue.length <= 0) {
227
- throw new Error("Empty value provided for input HTTP label: assistantId.");
228
- }
229
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
230
- }
231
- else {
232
- throw new Error("No value provided for input HTTP label: assistantId.");
233
- }
178
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantAssociationId", function () { return input.assistantAssociationId; }, "{assistantAssociationId}", false);
179
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
234
180
  return [2, new __HttpRequest({
235
181
  protocol: protocol,
236
182
  hostname: hostname,
@@ -244,7 +190,7 @@ export var serializeAws_restJson1DeleteAssistantAssociationCommand = function (i
244
190
  });
245
191
  }); };
246
192
  export var serializeAws_restJson1DeleteContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
247
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
193
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
248
194
  return __generator(this, function (_c) {
249
195
  switch (_c.label) {
250
196
  case 0: return [4, context.endpoint()];
@@ -253,26 +199,8 @@ export var serializeAws_restJson1DeleteContentCommand = function (input, context
253
199
  headers = {};
254
200
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
255
201
  "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
256
- if (input.knowledgeBaseId !== undefined) {
257
- labelValue = input.knowledgeBaseId;
258
- if (labelValue.length <= 0) {
259
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
260
- }
261
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
262
- }
263
- else {
264
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
265
- }
266
- if (input.contentId !== undefined) {
267
- labelValue = input.contentId;
268
- if (labelValue.length <= 0) {
269
- throw new Error("Empty value provided for input HTTP label: contentId.");
270
- }
271
- resolvedPath = resolvedPath.replace("{contentId}", __extendedEncodeURIComponent(labelValue));
272
- }
273
- else {
274
- throw new Error("No value provided for input HTTP label: contentId.");
275
- }
202
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
203
+ resolvedPath = __resolvedPath(resolvedPath, input, "contentId", function () { return input.contentId; }, "{contentId}", false);
276
204
  return [2, new __HttpRequest({
277
205
  protocol: protocol,
278
206
  hostname: hostname,
@@ -286,7 +214,7 @@ export var serializeAws_restJson1DeleteContentCommand = function (input, context
286
214
  });
287
215
  }); };
288
216
  export var serializeAws_restJson1DeleteKnowledgeBaseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
289
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
217
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
290
218
  return __generator(this, function (_c) {
291
219
  switch (_c.label) {
292
220
  case 0: return [4, context.endpoint()];
@@ -294,16 +222,7 @@ export var serializeAws_restJson1DeleteKnowledgeBaseCommand = function (input, c
294
222
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
295
223
  headers = {};
296
224
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/knowledgeBases/{knowledgeBaseId}";
297
- if (input.knowledgeBaseId !== undefined) {
298
- labelValue = input.knowledgeBaseId;
299
- if (labelValue.length <= 0) {
300
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
301
- }
302
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
303
- }
304
- else {
305
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
306
- }
225
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
307
226
  return [2, new __HttpRequest({
308
227
  protocol: protocol,
309
228
  hostname: hostname,
@@ -317,7 +236,7 @@ export var serializeAws_restJson1DeleteKnowledgeBaseCommand = function (input, c
317
236
  });
318
237
  }); };
319
238
  export var serializeAws_restJson1GetAssistantCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
320
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
239
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
321
240
  return __generator(this, function (_c) {
322
241
  switch (_c.label) {
323
242
  case 0: return [4, context.endpoint()];
@@ -325,16 +244,7 @@ export var serializeAws_restJson1GetAssistantCommand = function (input, context)
325
244
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
326
245
  headers = {};
327
246
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}";
328
- if (input.assistantId !== undefined) {
329
- labelValue = input.assistantId;
330
- if (labelValue.length <= 0) {
331
- throw new Error("Empty value provided for input HTTP label: assistantId.");
332
- }
333
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
334
- }
335
- else {
336
- throw new Error("No value provided for input HTTP label: assistantId.");
337
- }
247
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
338
248
  return [2, new __HttpRequest({
339
249
  protocol: protocol,
340
250
  hostname: hostname,
@@ -348,7 +258,7 @@ export var serializeAws_restJson1GetAssistantCommand = function (input, context)
348
258
  });
349
259
  }); };
350
260
  export var serializeAws_restJson1GetAssistantAssociationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
351
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
261
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
352
262
  return __generator(this, function (_c) {
353
263
  switch (_c.label) {
354
264
  case 0: return [4, context.endpoint()];
@@ -357,26 +267,8 @@ export var serializeAws_restJson1GetAssistantAssociationCommand = function (inpu
357
267
  headers = {};
358
268
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
359
269
  "/assistants/{assistantId}/associations/{assistantAssociationId}";
360
- if (input.assistantAssociationId !== undefined) {
361
- labelValue = input.assistantAssociationId;
362
- if (labelValue.length <= 0) {
363
- throw new Error("Empty value provided for input HTTP label: assistantAssociationId.");
364
- }
365
- resolvedPath = resolvedPath.replace("{assistantAssociationId}", __extendedEncodeURIComponent(labelValue));
366
- }
367
- else {
368
- throw new Error("No value provided for input HTTP label: assistantAssociationId.");
369
- }
370
- if (input.assistantId !== undefined) {
371
- labelValue = input.assistantId;
372
- if (labelValue.length <= 0) {
373
- throw new Error("Empty value provided for input HTTP label: assistantId.");
374
- }
375
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
376
- }
377
- else {
378
- throw new Error("No value provided for input HTTP label: assistantId.");
379
- }
270
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantAssociationId", function () { return input.assistantAssociationId; }, "{assistantAssociationId}", false);
271
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
380
272
  return [2, new __HttpRequest({
381
273
  protocol: protocol,
382
274
  hostname: hostname,
@@ -390,7 +282,7 @@ export var serializeAws_restJson1GetAssistantAssociationCommand = function (inpu
390
282
  });
391
283
  }); };
392
284
  export var serializeAws_restJson1GetContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
393
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
285
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
394
286
  return __generator(this, function (_c) {
395
287
  switch (_c.label) {
396
288
  case 0: return [4, context.endpoint()];
@@ -399,26 +291,8 @@ export var serializeAws_restJson1GetContentCommand = function (input, context) {
399
291
  headers = {};
400
292
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
401
293
  "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
402
- if (input.contentId !== undefined) {
403
- labelValue = input.contentId;
404
- if (labelValue.length <= 0) {
405
- throw new Error("Empty value provided for input HTTP label: contentId.");
406
- }
407
- resolvedPath = resolvedPath.replace("{contentId}", __extendedEncodeURIComponent(labelValue));
408
- }
409
- else {
410
- throw new Error("No value provided for input HTTP label: contentId.");
411
- }
412
- if (input.knowledgeBaseId !== undefined) {
413
- labelValue = input.knowledgeBaseId;
414
- if (labelValue.length <= 0) {
415
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
416
- }
417
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
418
- }
419
- else {
420
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
421
- }
294
+ resolvedPath = __resolvedPath(resolvedPath, input, "contentId", function () { return input.contentId; }, "{contentId}", false);
295
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
422
296
  return [2, new __HttpRequest({
423
297
  protocol: protocol,
424
298
  hostname: hostname,
@@ -432,7 +306,7 @@ export var serializeAws_restJson1GetContentCommand = function (input, context) {
432
306
  });
433
307
  }); };
434
308
  export var serializeAws_restJson1GetContentSummaryCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
435
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
309
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
436
310
  return __generator(this, function (_c) {
437
311
  switch (_c.label) {
438
312
  case 0: return [4, context.endpoint()];
@@ -441,26 +315,8 @@ export var serializeAws_restJson1GetContentSummaryCommand = function (input, con
441
315
  headers = {};
442
316
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
443
317
  "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary";
444
- if (input.contentId !== undefined) {
445
- labelValue = input.contentId;
446
- if (labelValue.length <= 0) {
447
- throw new Error("Empty value provided for input HTTP label: contentId.");
448
- }
449
- resolvedPath = resolvedPath.replace("{contentId}", __extendedEncodeURIComponent(labelValue));
450
- }
451
- else {
452
- throw new Error("No value provided for input HTTP label: contentId.");
453
- }
454
- if (input.knowledgeBaseId !== undefined) {
455
- labelValue = input.knowledgeBaseId;
456
- if (labelValue.length <= 0) {
457
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
458
- }
459
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
460
- }
461
- else {
462
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
463
- }
318
+ resolvedPath = __resolvedPath(resolvedPath, input, "contentId", function () { return input.contentId; }, "{contentId}", false);
319
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
464
320
  return [2, new __HttpRequest({
465
321
  protocol: protocol,
466
322
  hostname: hostname,
@@ -474,7 +330,7 @@ export var serializeAws_restJson1GetContentSummaryCommand = function (input, con
474
330
  });
475
331
  }); };
476
332
  export var serializeAws_restJson1GetKnowledgeBaseCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
477
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
333
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
478
334
  return __generator(this, function (_c) {
479
335
  switch (_c.label) {
480
336
  case 0: return [4, context.endpoint()];
@@ -482,16 +338,7 @@ export var serializeAws_restJson1GetKnowledgeBaseCommand = function (input, cont
482
338
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
483
339
  headers = {};
484
340
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/knowledgeBases/{knowledgeBaseId}";
485
- if (input.knowledgeBaseId !== undefined) {
486
- labelValue = input.knowledgeBaseId;
487
- if (labelValue.length <= 0) {
488
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
489
- }
490
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
491
- }
492
- else {
493
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
494
- }
341
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
495
342
  return [2, new __HttpRequest({
496
343
  protocol: protocol,
497
344
  hostname: hostname,
@@ -505,7 +352,7 @@ export var serializeAws_restJson1GetKnowledgeBaseCommand = function (input, cont
505
352
  });
506
353
  }); };
507
354
  export var serializeAws_restJson1GetRecommendationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
508
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
355
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
509
356
  return __generator(this, function (_c) {
510
357
  switch (_c.label) {
511
358
  case 0: return [4, context.endpoint()];
@@ -514,27 +361,12 @@ export var serializeAws_restJson1GetRecommendationsCommand = function (input, co
514
361
  headers = {};
515
362
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
516
363
  "/assistants/{assistantId}/sessions/{sessionId}/recommendations";
517
- if (input.assistantId !== undefined) {
518
- labelValue = input.assistantId;
519
- if (labelValue.length <= 0) {
520
- throw new Error("Empty value provided for input HTTP label: assistantId.");
521
- }
522
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
523
- }
524
- else {
525
- throw new Error("No value provided for input HTTP label: assistantId.");
526
- }
527
- if (input.sessionId !== undefined) {
528
- labelValue = input.sessionId;
529
- if (labelValue.length <= 0) {
530
- throw new Error("Empty value provided for input HTTP label: sessionId.");
531
- }
532
- resolvedPath = resolvedPath.replace("{sessionId}", __extendedEncodeURIComponent(labelValue));
533
- }
534
- else {
535
- throw new Error("No value provided for input HTTP label: sessionId.");
536
- }
537
- query = __assign(__assign({}, (input.maxResults !== undefined && { maxResults: input.maxResults.toString() })), (input.waitTimeSeconds !== undefined && { waitTimeSeconds: input.waitTimeSeconds.toString() }));
364
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
365
+ resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
366
+ query = map({
367
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
368
+ waitTimeSeconds: [function () { return input.waitTimeSeconds !== void 0; }, function () { return input.waitTimeSeconds.toString(); }],
369
+ });
538
370
  return [2, new __HttpRequest({
539
371
  protocol: protocol,
540
372
  hostname: hostname,
@@ -549,7 +381,7 @@ export var serializeAws_restJson1GetRecommendationsCommand = function (input, co
549
381
  });
550
382
  }); };
551
383
  export var serializeAws_restJson1GetSessionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
552
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
384
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
553
385
  return __generator(this, function (_c) {
554
386
  switch (_c.label) {
555
387
  case 0: return [4, context.endpoint()];
@@ -558,26 +390,8 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
558
390
  headers = {};
559
391
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
560
392
  "/assistants/{assistantId}/sessions/{sessionId}";
561
- if (input.assistantId !== undefined) {
562
- labelValue = input.assistantId;
563
- if (labelValue.length <= 0) {
564
- throw new Error("Empty value provided for input HTTP label: assistantId.");
565
- }
566
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
567
- }
568
- else {
569
- throw new Error("No value provided for input HTTP label: assistantId.");
570
- }
571
- if (input.sessionId !== undefined) {
572
- labelValue = input.sessionId;
573
- if (labelValue.length <= 0) {
574
- throw new Error("Empty value provided for input HTTP label: sessionId.");
575
- }
576
- resolvedPath = resolvedPath.replace("{sessionId}", __extendedEncodeURIComponent(labelValue));
577
- }
578
- else {
579
- throw new Error("No value provided for input HTTP label: sessionId.");
580
- }
393
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
394
+ resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
581
395
  return [2, new __HttpRequest({
582
396
  protocol: protocol,
583
397
  hostname: hostname,
@@ -591,7 +405,7 @@ export var serializeAws_restJson1GetSessionCommand = function (input, context) {
591
405
  });
592
406
  }); };
593
407
  export var serializeAws_restJson1ListAssistantAssociationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
594
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
408
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
595
409
  return __generator(this, function (_c) {
596
410
  switch (_c.label) {
597
411
  case 0: return [4, context.endpoint()];
@@ -599,17 +413,11 @@ export var serializeAws_restJson1ListAssistantAssociationsCommand = function (in
599
413
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
600
414
  headers = {};
601
415
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/associations";
602
- if (input.assistantId !== undefined) {
603
- labelValue = input.assistantId;
604
- if (labelValue.length <= 0) {
605
- throw new Error("Empty value provided for input HTTP label: assistantId.");
606
- }
607
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
608
- }
609
- else {
610
- throw new Error("No value provided for input HTTP label: assistantId.");
611
- }
612
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
416
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
417
+ query = map({
418
+ nextToken: [, input.nextToken],
419
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
420
+ });
613
421
  return [2, new __HttpRequest({
614
422
  protocol: protocol,
615
423
  hostname: hostname,
@@ -632,7 +440,10 @@ export var serializeAws_restJson1ListAssistantsCommand = function (input, contex
632
440
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
633
441
  headers = {};
634
442
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants";
635
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
443
+ query = map({
444
+ nextToken: [, input.nextToken],
445
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
446
+ });
636
447
  return [2, new __HttpRequest({
637
448
  protocol: protocol,
638
449
  hostname: hostname,
@@ -647,7 +458,7 @@ export var serializeAws_restJson1ListAssistantsCommand = function (input, contex
647
458
  });
648
459
  }); };
649
460
  export var serializeAws_restJson1ListContentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
650
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
461
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
651
462
  return __generator(this, function (_c) {
652
463
  switch (_c.label) {
653
464
  case 0: return [4, context.endpoint()];
@@ -656,17 +467,11 @@ export var serializeAws_restJson1ListContentsCommand = function (input, context)
656
467
  headers = {};
657
468
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
658
469
  "/knowledgeBases/{knowledgeBaseId}/contents";
659
- if (input.knowledgeBaseId !== undefined) {
660
- labelValue = input.knowledgeBaseId;
661
- if (labelValue.length <= 0) {
662
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
663
- }
664
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
665
- }
666
- else {
667
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
668
- }
669
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
470
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
471
+ query = map({
472
+ nextToken: [, input.nextToken],
473
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
474
+ });
670
475
  return [2, new __HttpRequest({
671
476
  protocol: protocol,
672
477
  hostname: hostname,
@@ -689,7 +494,10 @@ export var serializeAws_restJson1ListKnowledgeBasesCommand = function (input, co
689
494
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
690
495
  headers = {};
691
496
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/knowledgeBases";
692
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
497
+ query = map({
498
+ nextToken: [, input.nextToken],
499
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
500
+ });
693
501
  return [2, new __HttpRequest({
694
502
  protocol: protocol,
695
503
  hostname: hostname,
@@ -704,7 +512,7 @@ export var serializeAws_restJson1ListKnowledgeBasesCommand = function (input, co
704
512
  });
705
513
  }); };
706
514
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
707
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
515
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
708
516
  return __generator(this, function (_c) {
709
517
  switch (_c.label) {
710
518
  case 0: return [4, context.endpoint()];
@@ -712,16 +520,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
712
520
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
713
521
  headers = {};
714
522
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
715
- if (input.resourceArn !== undefined) {
716
- labelValue = input.resourceArn;
717
- if (labelValue.length <= 0) {
718
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
719
- }
720
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
721
- }
722
- else {
723
- throw new Error("No value provided for input HTTP label: resourceArn.");
724
- }
523
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
725
524
  return [2, new __HttpRequest({
726
525
  protocol: protocol,
727
526
  hostname: hostname,
@@ -735,7 +534,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
735
534
  });
736
535
  }); };
737
536
  export var serializeAws_restJson1NotifyRecommendationsReceivedCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
738
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
537
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
739
538
  return __generator(this, function (_c) {
740
539
  switch (_c.label) {
741
540
  case 0: return [4, context.endpoint()];
@@ -746,26 +545,8 @@ export var serializeAws_restJson1NotifyRecommendationsReceivedCommand = function
746
545
  };
747
546
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
748
547
  "/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify";
749
- if (input.assistantId !== undefined) {
750
- labelValue = input.assistantId;
751
- if (labelValue.length <= 0) {
752
- throw new Error("Empty value provided for input HTTP label: assistantId.");
753
- }
754
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
755
- }
756
- else {
757
- throw new Error("No value provided for input HTTP label: assistantId.");
758
- }
759
- if (input.sessionId !== undefined) {
760
- labelValue = input.sessionId;
761
- if (labelValue.length <= 0) {
762
- throw new Error("Empty value provided for input HTTP label: sessionId.");
763
- }
764
- resolvedPath = resolvedPath.replace("{sessionId}", __extendedEncodeURIComponent(labelValue));
765
- }
766
- else {
767
- throw new Error("No value provided for input HTTP label: sessionId.");
768
- }
548
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
549
+ resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", function () { return input.sessionId; }, "{sessionId}", false);
769
550
  body = JSON.stringify(__assign({}, (input.recommendationIds != null && {
770
551
  recommendationIds: serializeAws_restJson1RecommendationIdList(input.recommendationIds, context),
771
552
  })));
@@ -782,7 +563,7 @@ export var serializeAws_restJson1NotifyRecommendationsReceivedCommand = function
782
563
  });
783
564
  }); };
784
565
  export var serializeAws_restJson1QueryAssistantCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
785
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
566
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
786
567
  return __generator(this, function (_c) {
787
568
  switch (_c.label) {
788
569
  case 0: return [4, context.endpoint()];
@@ -792,16 +573,7 @@ export var serializeAws_restJson1QueryAssistantCommand = function (input, contex
792
573
  "content-type": "application/json",
793
574
  };
794
575
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/query";
795
- if (input.assistantId !== undefined) {
796
- labelValue = input.assistantId;
797
- if (labelValue.length <= 0) {
798
- throw new Error("Empty value provided for input HTTP label: assistantId.");
799
- }
800
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
801
- }
802
- else {
803
- throw new Error("No value provided for input HTTP label: assistantId.");
804
- }
576
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
805
577
  body = JSON.stringify(__assign(__assign(__assign({}, (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.queryText != null && { queryText: input.queryText })));
806
578
  return [2, new __HttpRequest({
807
579
  protocol: protocol,
@@ -816,7 +588,7 @@ export var serializeAws_restJson1QueryAssistantCommand = function (input, contex
816
588
  });
817
589
  }); };
818
590
  export var serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
819
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
591
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
820
592
  return __generator(this, function (_c) {
821
593
  switch (_c.label) {
822
594
  case 0: return [4, context.endpoint()];
@@ -825,16 +597,7 @@ export var serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = functio
825
597
  headers = {};
826
598
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
827
599
  "/knowledgeBases/{knowledgeBaseId}/templateUri";
828
- if (input.knowledgeBaseId !== undefined) {
829
- labelValue = input.knowledgeBaseId;
830
- if (labelValue.length <= 0) {
831
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
832
- }
833
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
834
- }
835
- else {
836
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
837
- }
600
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
838
601
  return [2, new __HttpRequest({
839
602
  protocol: protocol,
840
603
  hostname: hostname,
@@ -848,7 +611,7 @@ export var serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = functio
848
611
  });
849
612
  }); };
850
613
  export var serializeAws_restJson1SearchContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
851
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
614
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
852
615
  return __generator(this, function (_c) {
853
616
  switch (_c.label) {
854
617
  case 0: return [4, context.endpoint()];
@@ -858,17 +621,11 @@ export var serializeAws_restJson1SearchContentCommand = function (input, context
858
621
  "content-type": "application/json",
859
622
  };
860
623
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/knowledgeBases/{knowledgeBaseId}/search";
861
- if (input.knowledgeBaseId !== undefined) {
862
- labelValue = input.knowledgeBaseId;
863
- if (labelValue.length <= 0) {
864
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
865
- }
866
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
867
- }
868
- else {
869
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
870
- }
871
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
624
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
625
+ query = map({
626
+ nextToken: [, input.nextToken],
627
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
628
+ });
872
629
  body = JSON.stringify(__assign({}, (input.searchExpression != null && {
873
630
  searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
874
631
  })));
@@ -886,7 +643,7 @@ export var serializeAws_restJson1SearchContentCommand = function (input, context
886
643
  });
887
644
  }); };
888
645
  export var serializeAws_restJson1SearchSessionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
889
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
646
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
890
647
  return __generator(this, function (_c) {
891
648
  switch (_c.label) {
892
649
  case 0: return [4, context.endpoint()];
@@ -896,17 +653,11 @@ export var serializeAws_restJson1SearchSessionsCommand = function (input, contex
896
653
  "content-type": "application/json",
897
654
  };
898
655
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/searchSessions";
899
- if (input.assistantId !== undefined) {
900
- labelValue = input.assistantId;
901
- if (labelValue.length <= 0) {
902
- throw new Error("Empty value provided for input HTTP label: assistantId.");
903
- }
904
- resolvedPath = resolvedPath.replace("{assistantId}", __extendedEncodeURIComponent(labelValue));
905
- }
906
- else {
907
- throw new Error("No value provided for input HTTP label: assistantId.");
908
- }
909
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
656
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
657
+ query = map({
658
+ nextToken: [, input.nextToken],
659
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
660
+ });
910
661
  body = JSON.stringify(__assign({}, (input.searchExpression != null && {
911
662
  searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
912
663
  })));
@@ -924,7 +675,7 @@ export var serializeAws_restJson1SearchSessionsCommand = function (input, contex
924
675
  });
925
676
  }); };
926
677
  export var serializeAws_restJson1StartContentUploadCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
927
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
678
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
928
679
  return __generator(this, function (_c) {
929
680
  switch (_c.label) {
930
681
  case 0: return [4, context.endpoint()];
@@ -934,16 +685,7 @@ export var serializeAws_restJson1StartContentUploadCommand = function (input, co
934
685
  "content-type": "application/json",
935
686
  };
936
687
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/knowledgeBases/{knowledgeBaseId}/upload";
937
- if (input.knowledgeBaseId !== undefined) {
938
- labelValue = input.knowledgeBaseId;
939
- if (labelValue.length <= 0) {
940
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
941
- }
942
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
943
- }
944
- else {
945
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
946
- }
688
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
947
689
  body = JSON.stringify(__assign({}, (input.contentType != null && { contentType: input.contentType })));
948
690
  return [2, new __HttpRequest({
949
691
  protocol: protocol,
@@ -958,7 +700,7 @@ export var serializeAws_restJson1StartContentUploadCommand = function (input, co
958
700
  });
959
701
  }); };
960
702
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
961
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
703
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
962
704
  return __generator(this, function (_c) {
963
705
  switch (_c.label) {
964
706
  case 0: return [4, context.endpoint()];
@@ -968,16 +710,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
968
710
  "content-type": "application/json",
969
711
  };
970
712
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
971
- if (input.resourceArn !== undefined) {
972
- labelValue = input.resourceArn;
973
- if (labelValue.length <= 0) {
974
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
975
- }
976
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
977
- }
978
- else {
979
- throw new Error("No value provided for input HTTP label: resourceArn.");
980
- }
713
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
981
714
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
982
715
  return [2, new __HttpRequest({
983
716
  protocol: protocol,
@@ -992,7 +725,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
992
725
  });
993
726
  }); };
994
727
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
995
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
728
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
996
729
  return __generator(this, function (_c) {
997
730
  switch (_c.label) {
998
731
  case 0: return [4, context.endpoint()];
@@ -1000,17 +733,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1000
733
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1001
734
  headers = {};
1002
735
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
1003
- if (input.resourceArn !== undefined) {
1004
- labelValue = input.resourceArn;
1005
- if (labelValue.length <= 0) {
1006
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
1007
- }
1008
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
1009
- }
1010
- else {
1011
- throw new Error("No value provided for input HTTP label: resourceArn.");
1012
- }
1013
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
736
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
737
+ query = map({
738
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
739
+ });
1014
740
  return [2, new __HttpRequest({
1015
741
  protocol: protocol,
1016
742
  hostname: hostname,
@@ -1025,7 +751,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1025
751
  });
1026
752
  }); };
1027
753
  export var serializeAws_restJson1UpdateContentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1028
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
754
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1029
755
  return __generator(this, function (_c) {
1030
756
  switch (_c.label) {
1031
757
  case 0: return [4, context.endpoint()];
@@ -1036,26 +762,8 @@ export var serializeAws_restJson1UpdateContentCommand = function (input, context
1036
762
  };
1037
763
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1038
764
  "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
1039
- if (input.knowledgeBaseId !== undefined) {
1040
- labelValue = input.knowledgeBaseId;
1041
- if (labelValue.length <= 0) {
1042
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
1043
- }
1044
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
1045
- }
1046
- else {
1047
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
1048
- }
1049
- if (input.contentId !== undefined) {
1050
- labelValue = input.contentId;
1051
- if (labelValue.length <= 0) {
1052
- throw new Error("Empty value provided for input HTTP label: contentId.");
1053
- }
1054
- resolvedPath = resolvedPath.replace("{contentId}", __extendedEncodeURIComponent(labelValue));
1055
- }
1056
- else {
1057
- throw new Error("No value provided for input HTTP label: contentId.");
1058
- }
765
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
766
+ resolvedPath = __resolvedPath(resolvedPath, input, "contentId", function () { return input.contentId; }, "{contentId}", false);
1059
767
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.metadata != null && { metadata: serializeAws_restJson1ContentMetadata(input.metadata, context) })), (input.overrideLinkOutUri != null && { overrideLinkOutUri: input.overrideLinkOutUri })), (input.removeOverrideLinkOutUri != null && { removeOverrideLinkOutUri: input.removeOverrideLinkOutUri })), (input.revisionId != null && { revisionId: input.revisionId })), (input.title != null && { title: input.title })), (input.uploadId != null && { uploadId: input.uploadId })));
1060
768
  return [2, new __HttpRequest({
1061
769
  protocol: protocol,
@@ -1070,7 +778,7 @@ export var serializeAws_restJson1UpdateContentCommand = function (input, context
1070
778
  });
1071
779
  }); };
1072
780
  export var serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1073
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
781
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1074
782
  return __generator(this, function (_c) {
1075
783
  switch (_c.label) {
1076
784
  case 0: return [4, context.endpoint()];
@@ -1081,16 +789,7 @@ export var serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = functio
1081
789
  };
1082
790
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1083
791
  "/knowledgeBases/{knowledgeBaseId}/templateUri";
1084
- if (input.knowledgeBaseId !== undefined) {
1085
- labelValue = input.knowledgeBaseId;
1086
- if (labelValue.length <= 0) {
1087
- throw new Error("Empty value provided for input HTTP label: knowledgeBaseId.");
1088
- }
1089
- resolvedPath = resolvedPath.replace("{knowledgeBaseId}", __extendedEncodeURIComponent(labelValue));
1090
- }
1091
- else {
1092
- throw new Error("No value provided for input HTTP label: knowledgeBaseId.");
1093
- }
792
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
1094
793
  body = JSON.stringify(__assign({}, (input.templateUri != null && { templateUri: input.templateUri })));
1095
794
  return [2, new __HttpRequest({
1096
795
  protocol: protocol,
@@ -1112,24 +811,23 @@ export var deserializeAws_restJson1CreateAssistantCommand = function (output, co
1112
811
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1113
812
  return [2, deserializeAws_restJson1CreateAssistantCommandError(output, context)];
1114
813
  }
1115
- contents = {
814
+ contents = map({
1116
815
  $metadata: deserializeMetadata(output),
1117
- assistant: undefined,
1118
- };
816
+ });
1119
817
  _a = __expectNonNull;
1120
818
  _b = __expectObject;
1121
819
  return [4, parseBody(output.body, context)];
1122
820
  case 1:
1123
821
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1124
- if (data.assistant !== undefined && data.assistant !== null) {
822
+ if (data.assistant != null) {
1125
823
  contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
1126
824
  }
1127
- return [2, Promise.resolve(contents)];
825
+ return [2, contents];
1128
826
  }
1129
827
  });
1130
828
  }); };
1131
829
  var deserializeAws_restJson1CreateAssistantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1132
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
830
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1133
831
  var _c;
1134
832
  return __generator(this, function (_d) {
1135
833
  switch (_d.label) {
@@ -1162,14 +860,14 @@ var deserializeAws_restJson1CreateAssistantCommandError = function (output, cont
1162
860
  case 9: throw _d.sent();
1163
861
  case 10:
1164
862
  parsedBody = parsedOutput.body;
1165
- $metadata = deserializeMetadata(output);
1166
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1167
- response = new __BaseException({
1168
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1169
- $fault: "client",
1170
- $metadata: $metadata,
863
+ throwDefaultError({
864
+ output: output,
865
+ parsedBody: parsedBody,
866
+ exceptionCtor: __BaseException,
867
+ errorCode: errorCode,
1171
868
  });
1172
- throw __decorateServiceException(response, parsedBody);
869
+ _d.label = 11;
870
+ case 11: return [2];
1173
871
  }
1174
872
  });
1175
873
  }); };
@@ -1181,24 +879,23 @@ export var deserializeAws_restJson1CreateAssistantAssociationCommand = function
1181
879
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1182
880
  return [2, deserializeAws_restJson1CreateAssistantAssociationCommandError(output, context)];
1183
881
  }
1184
- contents = {
882
+ contents = map({
1185
883
  $metadata: deserializeMetadata(output),
1186
- assistantAssociation: undefined,
1187
- };
884
+ });
1188
885
  _a = __expectNonNull;
1189
886
  _b = __expectObject;
1190
887
  return [4, parseBody(output.body, context)];
1191
888
  case 1:
1192
889
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1193
- if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
890
+ if (data.assistantAssociation != null) {
1194
891
  contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
1195
892
  }
1196
- return [2, Promise.resolve(contents)];
893
+ return [2, contents];
1197
894
  }
1198
895
  });
1199
896
  }); };
1200
897
  var deserializeAws_restJson1CreateAssistantAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1201
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
898
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1202
899
  var _c;
1203
900
  return __generator(this, function (_d) {
1204
901
  switch (_d.label) {
@@ -1235,14 +932,14 @@ var deserializeAws_restJson1CreateAssistantAssociationCommandError = function (o
1235
932
  case 11: throw _d.sent();
1236
933
  case 12:
1237
934
  parsedBody = parsedOutput.body;
1238
- $metadata = deserializeMetadata(output);
1239
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1240
- response = new __BaseException({
1241
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1242
- $fault: "client",
1243
- $metadata: $metadata,
935
+ throwDefaultError({
936
+ output: output,
937
+ parsedBody: parsedBody,
938
+ exceptionCtor: __BaseException,
939
+ errorCode: errorCode,
1244
940
  });
1245
- throw __decorateServiceException(response, parsedBody);
941
+ _d.label = 13;
942
+ case 13: return [2];
1246
943
  }
1247
944
  });
1248
945
  }); };
@@ -1254,24 +951,23 @@ export var deserializeAws_restJson1CreateContentCommand = function (output, cont
1254
951
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1255
952
  return [2, deserializeAws_restJson1CreateContentCommandError(output, context)];
1256
953
  }
1257
- contents = {
954
+ contents = map({
1258
955
  $metadata: deserializeMetadata(output),
1259
- content: undefined,
1260
- };
956
+ });
1261
957
  _a = __expectNonNull;
1262
958
  _b = __expectObject;
1263
959
  return [4, parseBody(output.body, context)];
1264
960
  case 1:
1265
961
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1266
- if (data.content !== undefined && data.content !== null) {
962
+ if (data.content != null) {
1267
963
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
1268
964
  }
1269
- return [2, Promise.resolve(contents)];
965
+ return [2, contents];
1270
966
  }
1271
967
  });
1272
968
  }); };
1273
969
  var deserializeAws_restJson1CreateContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1274
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
970
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1275
971
  var _c;
1276
972
  return __generator(this, function (_d) {
1277
973
  switch (_d.label) {
@@ -1308,14 +1004,14 @@ var deserializeAws_restJson1CreateContentCommandError = function (output, contex
1308
1004
  case 11: throw _d.sent();
1309
1005
  case 12:
1310
1006
  parsedBody = parsedOutput.body;
1311
- $metadata = deserializeMetadata(output);
1312
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1313
- response = new __BaseException({
1314
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1315
- $fault: "client",
1316
- $metadata: $metadata,
1007
+ throwDefaultError({
1008
+ output: output,
1009
+ parsedBody: parsedBody,
1010
+ exceptionCtor: __BaseException,
1011
+ errorCode: errorCode,
1317
1012
  });
1318
- throw __decorateServiceException(response, parsedBody);
1013
+ _d.label = 13;
1014
+ case 13: return [2];
1319
1015
  }
1320
1016
  });
1321
1017
  }); };
@@ -1327,24 +1023,23 @@ export var deserializeAws_restJson1CreateKnowledgeBaseCommand = function (output
1327
1023
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1328
1024
  return [2, deserializeAws_restJson1CreateKnowledgeBaseCommandError(output, context)];
1329
1025
  }
1330
- contents = {
1026
+ contents = map({
1331
1027
  $metadata: deserializeMetadata(output),
1332
- knowledgeBase: undefined,
1333
- };
1028
+ });
1334
1029
  _a = __expectNonNull;
1335
1030
  _b = __expectObject;
1336
1031
  return [4, parseBody(output.body, context)];
1337
1032
  case 1:
1338
1033
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1339
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
1034
+ if (data.knowledgeBase != null) {
1340
1035
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
1341
1036
  }
1342
- return [2, Promise.resolve(contents)];
1037
+ return [2, contents];
1343
1038
  }
1344
1039
  });
1345
1040
  }); };
1346
1041
  var deserializeAws_restJson1CreateKnowledgeBaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1347
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1042
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1348
1043
  var _c;
1349
1044
  return __generator(this, function (_d) {
1350
1045
  switch (_d.label) {
@@ -1377,14 +1072,14 @@ var deserializeAws_restJson1CreateKnowledgeBaseCommandError = function (output,
1377
1072
  case 9: throw _d.sent();
1378
1073
  case 10:
1379
1074
  parsedBody = parsedOutput.body;
1380
- $metadata = deserializeMetadata(output);
1381
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1382
- response = new __BaseException({
1383
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1384
- $fault: "client",
1385
- $metadata: $metadata,
1075
+ throwDefaultError({
1076
+ output: output,
1077
+ parsedBody: parsedBody,
1078
+ exceptionCtor: __BaseException,
1079
+ errorCode: errorCode,
1386
1080
  });
1387
- throw __decorateServiceException(response, parsedBody);
1081
+ _d.label = 11;
1082
+ case 11: return [2];
1388
1083
  }
1389
1084
  });
1390
1085
  }); };
@@ -1396,24 +1091,23 @@ export var deserializeAws_restJson1CreateSessionCommand = function (output, cont
1396
1091
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1397
1092
  return [2, deserializeAws_restJson1CreateSessionCommandError(output, context)];
1398
1093
  }
1399
- contents = {
1094
+ contents = map({
1400
1095
  $metadata: deserializeMetadata(output),
1401
- session: undefined,
1402
- };
1096
+ });
1403
1097
  _a = __expectNonNull;
1404
1098
  _b = __expectObject;
1405
1099
  return [4, parseBody(output.body, context)];
1406
1100
  case 1:
1407
1101
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1408
- if (data.session !== undefined && data.session !== null) {
1102
+ if (data.session != null) {
1409
1103
  contents.session = deserializeAws_restJson1SessionData(data.session, context);
1410
1104
  }
1411
- return [2, Promise.resolve(contents)];
1105
+ return [2, contents];
1412
1106
  }
1413
1107
  });
1414
1108
  }); };
1415
1109
  var deserializeAws_restJson1CreateSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1416
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1110
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1417
1111
  var _c;
1418
1112
  return __generator(this, function (_d) {
1419
1113
  switch (_d.label) {
@@ -1442,14 +1136,14 @@ var deserializeAws_restJson1CreateSessionCommandError = function (output, contex
1442
1136
  case 7: throw _d.sent();
1443
1137
  case 8:
1444
1138
  parsedBody = parsedOutput.body;
1445
- $metadata = deserializeMetadata(output);
1446
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1447
- response = new __BaseException({
1448
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1449
- $fault: "client",
1450
- $metadata: $metadata,
1139
+ throwDefaultError({
1140
+ output: output,
1141
+ parsedBody: parsedBody,
1142
+ exceptionCtor: __BaseException,
1143
+ errorCode: errorCode,
1451
1144
  });
1452
- throw __decorateServiceException(response, parsedBody);
1145
+ _d.label = 9;
1146
+ case 9: return [2];
1453
1147
  }
1454
1148
  });
1455
1149
  }); };
@@ -1461,18 +1155,18 @@ export var deserializeAws_restJson1DeleteAssistantCommand = function (output, co
1461
1155
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1462
1156
  return [2, deserializeAws_restJson1DeleteAssistantCommandError(output, context)];
1463
1157
  }
1464
- contents = {
1158
+ contents = map({
1465
1159
  $metadata: deserializeMetadata(output),
1466
- };
1160
+ });
1467
1161
  return [4, collectBody(output.body, context)];
1468
1162
  case 1:
1469
1163
  _a.sent();
1470
- return [2, Promise.resolve(contents)];
1164
+ return [2, contents];
1471
1165
  }
1472
1166
  });
1473
1167
  }); };
1474
1168
  var deserializeAws_restJson1DeleteAssistantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1475
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1169
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1476
1170
  var _c;
1477
1171
  return __generator(this, function (_d) {
1478
1172
  switch (_d.label) {
@@ -1501,14 +1195,14 @@ var deserializeAws_restJson1DeleteAssistantCommandError = function (output, cont
1501
1195
  case 7: throw _d.sent();
1502
1196
  case 8:
1503
1197
  parsedBody = parsedOutput.body;
1504
- $metadata = deserializeMetadata(output);
1505
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1506
- response = new __BaseException({
1507
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1508
- $fault: "client",
1509
- $metadata: $metadata,
1198
+ throwDefaultError({
1199
+ output: output,
1200
+ parsedBody: parsedBody,
1201
+ exceptionCtor: __BaseException,
1202
+ errorCode: errorCode,
1510
1203
  });
1511
- throw __decorateServiceException(response, parsedBody);
1204
+ _d.label = 9;
1205
+ case 9: return [2];
1512
1206
  }
1513
1207
  });
1514
1208
  }); };
@@ -1520,18 +1214,18 @@ export var deserializeAws_restJson1DeleteAssistantAssociationCommand = function
1520
1214
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1521
1215
  return [2, deserializeAws_restJson1DeleteAssistantAssociationCommandError(output, context)];
1522
1216
  }
1523
- contents = {
1217
+ contents = map({
1524
1218
  $metadata: deserializeMetadata(output),
1525
- };
1219
+ });
1526
1220
  return [4, collectBody(output.body, context)];
1527
1221
  case 1:
1528
1222
  _a.sent();
1529
- return [2, Promise.resolve(contents)];
1223
+ return [2, contents];
1530
1224
  }
1531
1225
  });
1532
1226
  }); };
1533
1227
  var deserializeAws_restJson1DeleteAssistantAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1534
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1228
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1535
1229
  var _c;
1536
1230
  return __generator(this, function (_d) {
1537
1231
  switch (_d.label) {
@@ -1560,14 +1254,14 @@ var deserializeAws_restJson1DeleteAssistantAssociationCommandError = function (o
1560
1254
  case 7: throw _d.sent();
1561
1255
  case 8:
1562
1256
  parsedBody = parsedOutput.body;
1563
- $metadata = deserializeMetadata(output);
1564
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1565
- response = new __BaseException({
1566
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1567
- $fault: "client",
1568
- $metadata: $metadata,
1257
+ throwDefaultError({
1258
+ output: output,
1259
+ parsedBody: parsedBody,
1260
+ exceptionCtor: __BaseException,
1261
+ errorCode: errorCode,
1569
1262
  });
1570
- throw __decorateServiceException(response, parsedBody);
1263
+ _d.label = 9;
1264
+ case 9: return [2];
1571
1265
  }
1572
1266
  });
1573
1267
  }); };
@@ -1579,18 +1273,18 @@ export var deserializeAws_restJson1DeleteContentCommand = function (output, cont
1579
1273
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1580
1274
  return [2, deserializeAws_restJson1DeleteContentCommandError(output, context)];
1581
1275
  }
1582
- contents = {
1276
+ contents = map({
1583
1277
  $metadata: deserializeMetadata(output),
1584
- };
1278
+ });
1585
1279
  return [4, collectBody(output.body, context)];
1586
1280
  case 1:
1587
1281
  _a.sent();
1588
- return [2, Promise.resolve(contents)];
1282
+ return [2, contents];
1589
1283
  }
1590
1284
  });
1591
1285
  }); };
1592
1286
  var deserializeAws_restJson1DeleteContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1593
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1287
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1594
1288
  var _c;
1595
1289
  return __generator(this, function (_d) {
1596
1290
  switch (_d.label) {
@@ -1619,14 +1313,14 @@ var deserializeAws_restJson1DeleteContentCommandError = function (output, contex
1619
1313
  case 7: throw _d.sent();
1620
1314
  case 8:
1621
1315
  parsedBody = parsedOutput.body;
1622
- $metadata = deserializeMetadata(output);
1623
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1624
- response = new __BaseException({
1625
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1626
- $fault: "client",
1627
- $metadata: $metadata,
1316
+ throwDefaultError({
1317
+ output: output,
1318
+ parsedBody: parsedBody,
1319
+ exceptionCtor: __BaseException,
1320
+ errorCode: errorCode,
1628
1321
  });
1629
- throw __decorateServiceException(response, parsedBody);
1322
+ _d.label = 9;
1323
+ case 9: return [2];
1630
1324
  }
1631
1325
  });
1632
1326
  }); };
@@ -1638,18 +1332,18 @@ export var deserializeAws_restJson1DeleteKnowledgeBaseCommand = function (output
1638
1332
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1639
1333
  return [2, deserializeAws_restJson1DeleteKnowledgeBaseCommandError(output, context)];
1640
1334
  }
1641
- contents = {
1335
+ contents = map({
1642
1336
  $metadata: deserializeMetadata(output),
1643
- };
1337
+ });
1644
1338
  return [4, collectBody(output.body, context)];
1645
1339
  case 1:
1646
1340
  _a.sent();
1647
- return [2, Promise.resolve(contents)];
1341
+ return [2, contents];
1648
1342
  }
1649
1343
  });
1650
1344
  }); };
1651
1345
  var deserializeAws_restJson1DeleteKnowledgeBaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1652
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1346
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1653
1347
  var _c;
1654
1348
  return __generator(this, function (_d) {
1655
1349
  switch (_d.label) {
@@ -1682,14 +1376,14 @@ var deserializeAws_restJson1DeleteKnowledgeBaseCommandError = function (output,
1682
1376
  case 9: throw _d.sent();
1683
1377
  case 10:
1684
1378
  parsedBody = parsedOutput.body;
1685
- $metadata = deserializeMetadata(output);
1686
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1687
- response = new __BaseException({
1688
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1689
- $fault: "client",
1690
- $metadata: $metadata,
1379
+ throwDefaultError({
1380
+ output: output,
1381
+ parsedBody: parsedBody,
1382
+ exceptionCtor: __BaseException,
1383
+ errorCode: errorCode,
1691
1384
  });
1692
- throw __decorateServiceException(response, parsedBody);
1385
+ _d.label = 11;
1386
+ case 11: return [2];
1693
1387
  }
1694
1388
  });
1695
1389
  }); };
@@ -1701,24 +1395,23 @@ export var deserializeAws_restJson1GetAssistantCommand = function (output, conte
1701
1395
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1702
1396
  return [2, deserializeAws_restJson1GetAssistantCommandError(output, context)];
1703
1397
  }
1704
- contents = {
1398
+ contents = map({
1705
1399
  $metadata: deserializeMetadata(output),
1706
- assistant: undefined,
1707
- };
1400
+ });
1708
1401
  _a = __expectNonNull;
1709
1402
  _b = __expectObject;
1710
1403
  return [4, parseBody(output.body, context)];
1711
1404
  case 1:
1712
1405
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1713
- if (data.assistant !== undefined && data.assistant !== null) {
1406
+ if (data.assistant != null) {
1714
1407
  contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
1715
1408
  }
1716
- return [2, Promise.resolve(contents)];
1409
+ return [2, contents];
1717
1410
  }
1718
1411
  });
1719
1412
  }); };
1720
1413
  var deserializeAws_restJson1GetAssistantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1721
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1414
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1722
1415
  var _c;
1723
1416
  return __generator(this, function (_d) {
1724
1417
  switch (_d.label) {
@@ -1747,14 +1440,14 @@ var deserializeAws_restJson1GetAssistantCommandError = function (output, context
1747
1440
  case 7: throw _d.sent();
1748
1441
  case 8:
1749
1442
  parsedBody = parsedOutput.body;
1750
- $metadata = deserializeMetadata(output);
1751
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1752
- response = new __BaseException({
1753
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1754
- $fault: "client",
1755
- $metadata: $metadata,
1443
+ throwDefaultError({
1444
+ output: output,
1445
+ parsedBody: parsedBody,
1446
+ exceptionCtor: __BaseException,
1447
+ errorCode: errorCode,
1756
1448
  });
1757
- throw __decorateServiceException(response, parsedBody);
1449
+ _d.label = 9;
1450
+ case 9: return [2];
1758
1451
  }
1759
1452
  });
1760
1453
  }); };
@@ -1766,24 +1459,23 @@ export var deserializeAws_restJson1GetAssistantAssociationCommand = function (ou
1766
1459
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1767
1460
  return [2, deserializeAws_restJson1GetAssistantAssociationCommandError(output, context)];
1768
1461
  }
1769
- contents = {
1462
+ contents = map({
1770
1463
  $metadata: deserializeMetadata(output),
1771
- assistantAssociation: undefined,
1772
- };
1464
+ });
1773
1465
  _a = __expectNonNull;
1774
1466
  _b = __expectObject;
1775
1467
  return [4, parseBody(output.body, context)];
1776
1468
  case 1:
1777
1469
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1778
- if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
1470
+ if (data.assistantAssociation != null) {
1779
1471
  contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
1780
1472
  }
1781
- return [2, Promise.resolve(contents)];
1473
+ return [2, contents];
1782
1474
  }
1783
1475
  });
1784
1476
  }); };
1785
1477
  var deserializeAws_restJson1GetAssistantAssociationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1786
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1478
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1787
1479
  var _c;
1788
1480
  return __generator(this, function (_d) {
1789
1481
  switch (_d.label) {
@@ -1812,14 +1504,14 @@ var deserializeAws_restJson1GetAssistantAssociationCommandError = function (outp
1812
1504
  case 7: throw _d.sent();
1813
1505
  case 8:
1814
1506
  parsedBody = parsedOutput.body;
1815
- $metadata = deserializeMetadata(output);
1816
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1817
- response = new __BaseException({
1818
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1819
- $fault: "client",
1820
- $metadata: $metadata,
1507
+ throwDefaultError({
1508
+ output: output,
1509
+ parsedBody: parsedBody,
1510
+ exceptionCtor: __BaseException,
1511
+ errorCode: errorCode,
1821
1512
  });
1822
- throw __decorateServiceException(response, parsedBody);
1513
+ _d.label = 9;
1514
+ case 9: return [2];
1823
1515
  }
1824
1516
  });
1825
1517
  }); };
@@ -1831,24 +1523,23 @@ export var deserializeAws_restJson1GetContentCommand = function (output, context
1831
1523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1832
1524
  return [2, deserializeAws_restJson1GetContentCommandError(output, context)];
1833
1525
  }
1834
- contents = {
1526
+ contents = map({
1835
1527
  $metadata: deserializeMetadata(output),
1836
- content: undefined,
1837
- };
1528
+ });
1838
1529
  _a = __expectNonNull;
1839
1530
  _b = __expectObject;
1840
1531
  return [4, parseBody(output.body, context)];
1841
1532
  case 1:
1842
1533
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1843
- if (data.content !== undefined && data.content !== null) {
1534
+ if (data.content != null) {
1844
1535
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
1845
1536
  }
1846
- return [2, Promise.resolve(contents)];
1537
+ return [2, contents];
1847
1538
  }
1848
1539
  });
1849
1540
  }); };
1850
1541
  var deserializeAws_restJson1GetContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1851
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1542
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1852
1543
  var _c;
1853
1544
  return __generator(this, function (_d) {
1854
1545
  switch (_d.label) {
@@ -1877,14 +1568,14 @@ var deserializeAws_restJson1GetContentCommandError = function (output, context)
1877
1568
  case 7: throw _d.sent();
1878
1569
  case 8:
1879
1570
  parsedBody = parsedOutput.body;
1880
- $metadata = deserializeMetadata(output);
1881
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1882
- response = new __BaseException({
1883
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1884
- $fault: "client",
1885
- $metadata: $metadata,
1571
+ throwDefaultError({
1572
+ output: output,
1573
+ parsedBody: parsedBody,
1574
+ exceptionCtor: __BaseException,
1575
+ errorCode: errorCode,
1886
1576
  });
1887
- throw __decorateServiceException(response, parsedBody);
1577
+ _d.label = 9;
1578
+ case 9: return [2];
1888
1579
  }
1889
1580
  });
1890
1581
  }); };
@@ -1896,24 +1587,23 @@ export var deserializeAws_restJson1GetContentSummaryCommand = function (output,
1896
1587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1897
1588
  return [2, deserializeAws_restJson1GetContentSummaryCommandError(output, context)];
1898
1589
  }
1899
- contents = {
1590
+ contents = map({
1900
1591
  $metadata: deserializeMetadata(output),
1901
- contentSummary: undefined,
1902
- };
1592
+ });
1903
1593
  _a = __expectNonNull;
1904
1594
  _b = __expectObject;
1905
1595
  return [4, parseBody(output.body, context)];
1906
1596
  case 1:
1907
1597
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1908
- if (data.contentSummary !== undefined && data.contentSummary !== null) {
1598
+ if (data.contentSummary != null) {
1909
1599
  contents.contentSummary = deserializeAws_restJson1ContentSummary(data.contentSummary, context);
1910
1600
  }
1911
- return [2, Promise.resolve(contents)];
1601
+ return [2, contents];
1912
1602
  }
1913
1603
  });
1914
1604
  }); };
1915
1605
  var deserializeAws_restJson1GetContentSummaryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1916
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1606
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1917
1607
  var _c;
1918
1608
  return __generator(this, function (_d) {
1919
1609
  switch (_d.label) {
@@ -1942,14 +1632,14 @@ var deserializeAws_restJson1GetContentSummaryCommandError = function (output, co
1942
1632
  case 7: throw _d.sent();
1943
1633
  case 8:
1944
1634
  parsedBody = parsedOutput.body;
1945
- $metadata = deserializeMetadata(output);
1946
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1947
- response = new __BaseException({
1948
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1949
- $fault: "client",
1950
- $metadata: $metadata,
1635
+ throwDefaultError({
1636
+ output: output,
1637
+ parsedBody: parsedBody,
1638
+ exceptionCtor: __BaseException,
1639
+ errorCode: errorCode,
1951
1640
  });
1952
- throw __decorateServiceException(response, parsedBody);
1641
+ _d.label = 9;
1642
+ case 9: return [2];
1953
1643
  }
1954
1644
  });
1955
1645
  }); };
@@ -1961,24 +1651,23 @@ export var deserializeAws_restJson1GetKnowledgeBaseCommand = function (output, c
1961
1651
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1962
1652
  return [2, deserializeAws_restJson1GetKnowledgeBaseCommandError(output, context)];
1963
1653
  }
1964
- contents = {
1654
+ contents = map({
1965
1655
  $metadata: deserializeMetadata(output),
1966
- knowledgeBase: undefined,
1967
- };
1656
+ });
1968
1657
  _a = __expectNonNull;
1969
1658
  _b = __expectObject;
1970
1659
  return [4, parseBody(output.body, context)];
1971
1660
  case 1:
1972
1661
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1973
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
1662
+ if (data.knowledgeBase != null) {
1974
1663
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
1975
1664
  }
1976
- return [2, Promise.resolve(contents)];
1665
+ return [2, contents];
1977
1666
  }
1978
1667
  });
1979
1668
  }); };
1980
1669
  var deserializeAws_restJson1GetKnowledgeBaseCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1981
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1670
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1982
1671
  var _c;
1983
1672
  return __generator(this, function (_d) {
1984
1673
  switch (_d.label) {
@@ -2007,14 +1696,14 @@ var deserializeAws_restJson1GetKnowledgeBaseCommandError = function (output, con
2007
1696
  case 7: throw _d.sent();
2008
1697
  case 8:
2009
1698
  parsedBody = parsedOutput.body;
2010
- $metadata = deserializeMetadata(output);
2011
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2012
- response = new __BaseException({
2013
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2014
- $fault: "client",
2015
- $metadata: $metadata,
1699
+ throwDefaultError({
1700
+ output: output,
1701
+ parsedBody: parsedBody,
1702
+ exceptionCtor: __BaseException,
1703
+ errorCode: errorCode,
2016
1704
  });
2017
- throw __decorateServiceException(response, parsedBody);
1705
+ _d.label = 9;
1706
+ case 9: return [2];
2018
1707
  }
2019
1708
  });
2020
1709
  }); };
@@ -2026,28 +1715,26 @@ export var deserializeAws_restJson1GetRecommendationsCommand = function (output,
2026
1715
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2027
1716
  return [2, deserializeAws_restJson1GetRecommendationsCommandError(output, context)];
2028
1717
  }
2029
- contents = {
1718
+ contents = map({
2030
1719
  $metadata: deserializeMetadata(output),
2031
- recommendations: undefined,
2032
- triggers: undefined,
2033
- };
1720
+ });
2034
1721
  _a = __expectNonNull;
2035
1722
  _b = __expectObject;
2036
1723
  return [4, parseBody(output.body, context)];
2037
1724
  case 1:
2038
1725
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2039
- if (data.recommendations !== undefined && data.recommendations !== null) {
1726
+ if (data.recommendations != null) {
2040
1727
  contents.recommendations = deserializeAws_restJson1RecommendationList(data.recommendations, context);
2041
1728
  }
2042
- if (data.triggers !== undefined && data.triggers !== null) {
1729
+ if (data.triggers != null) {
2043
1730
  contents.triggers = deserializeAws_restJson1RecommendationTriggerList(data.triggers, context);
2044
1731
  }
2045
- return [2, Promise.resolve(contents)];
1732
+ return [2, contents];
2046
1733
  }
2047
1734
  });
2048
1735
  }); };
2049
1736
  var deserializeAws_restJson1GetRecommendationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2050
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1737
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2051
1738
  var _c;
2052
1739
  return __generator(this, function (_d) {
2053
1740
  switch (_d.label) {
@@ -2076,14 +1763,14 @@ var deserializeAws_restJson1GetRecommendationsCommandError = function (output, c
2076
1763
  case 7: throw _d.sent();
2077
1764
  case 8:
2078
1765
  parsedBody = parsedOutput.body;
2079
- $metadata = deserializeMetadata(output);
2080
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2081
- response = new __BaseException({
2082
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2083
- $fault: "client",
2084
- $metadata: $metadata,
1766
+ throwDefaultError({
1767
+ output: output,
1768
+ parsedBody: parsedBody,
1769
+ exceptionCtor: __BaseException,
1770
+ errorCode: errorCode,
2085
1771
  });
2086
- throw __decorateServiceException(response, parsedBody);
1772
+ _d.label = 9;
1773
+ case 9: return [2];
2087
1774
  }
2088
1775
  });
2089
1776
  }); };
@@ -2095,24 +1782,23 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
2095
1782
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2096
1783
  return [2, deserializeAws_restJson1GetSessionCommandError(output, context)];
2097
1784
  }
2098
- contents = {
1785
+ contents = map({
2099
1786
  $metadata: deserializeMetadata(output),
2100
- session: undefined,
2101
- };
1787
+ });
2102
1788
  _a = __expectNonNull;
2103
1789
  _b = __expectObject;
2104
1790
  return [4, parseBody(output.body, context)];
2105
1791
  case 1:
2106
1792
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2107
- if (data.session !== undefined && data.session !== null) {
1793
+ if (data.session != null) {
2108
1794
  contents.session = deserializeAws_restJson1SessionData(data.session, context);
2109
1795
  }
2110
- return [2, Promise.resolve(contents)];
1796
+ return [2, contents];
2111
1797
  }
2112
1798
  });
2113
1799
  }); };
2114
1800
  var deserializeAws_restJson1GetSessionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2115
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1801
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2116
1802
  var _c;
2117
1803
  return __generator(this, function (_d) {
2118
1804
  switch (_d.label) {
@@ -2141,14 +1827,14 @@ var deserializeAws_restJson1GetSessionCommandError = function (output, context)
2141
1827
  case 7: throw _d.sent();
2142
1828
  case 8:
2143
1829
  parsedBody = parsedOutput.body;
2144
- $metadata = deserializeMetadata(output);
2145
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2146
- response = new __BaseException({
2147
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2148
- $fault: "client",
2149
- $metadata: $metadata,
1830
+ throwDefaultError({
1831
+ output: output,
1832
+ parsedBody: parsedBody,
1833
+ exceptionCtor: __BaseException,
1834
+ errorCode: errorCode,
2150
1835
  });
2151
- throw __decorateServiceException(response, parsedBody);
1836
+ _d.label = 9;
1837
+ case 9: return [2];
2152
1838
  }
2153
1839
  });
2154
1840
  }); };
@@ -2160,28 +1846,26 @@ export var deserializeAws_restJson1ListAssistantAssociationsCommand = function (
2160
1846
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2161
1847
  return [2, deserializeAws_restJson1ListAssistantAssociationsCommandError(output, context)];
2162
1848
  }
2163
- contents = {
1849
+ contents = map({
2164
1850
  $metadata: deserializeMetadata(output),
2165
- assistantAssociationSummaries: undefined,
2166
- nextToken: undefined,
2167
- };
1851
+ });
2168
1852
  _a = __expectNonNull;
2169
1853
  _b = __expectObject;
2170
1854
  return [4, parseBody(output.body, context)];
2171
1855
  case 1:
2172
1856
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2173
- if (data.assistantAssociationSummaries !== undefined && data.assistantAssociationSummaries !== null) {
1857
+ if (data.assistantAssociationSummaries != null) {
2174
1858
  contents.assistantAssociationSummaries = deserializeAws_restJson1AssistantAssociationSummaryList(data.assistantAssociationSummaries, context);
2175
1859
  }
2176
- if (data.nextToken !== undefined && data.nextToken !== null) {
1860
+ if (data.nextToken != null) {
2177
1861
  contents.nextToken = __expectString(data.nextToken);
2178
1862
  }
2179
- return [2, Promise.resolve(contents)];
1863
+ return [2, contents];
2180
1864
  }
2181
1865
  });
2182
1866
  }); };
2183
1867
  var deserializeAws_restJson1ListAssistantAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2184
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1868
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2185
1869
  var _c;
2186
1870
  return __generator(this, function (_d) {
2187
1871
  switch (_d.label) {
@@ -2210,14 +1894,14 @@ var deserializeAws_restJson1ListAssistantAssociationsCommandError = function (ou
2210
1894
  case 7: throw _d.sent();
2211
1895
  case 8:
2212
1896
  parsedBody = parsedOutput.body;
2213
- $metadata = deserializeMetadata(output);
2214
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2215
- response = new __BaseException({
2216
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2217
- $fault: "client",
2218
- $metadata: $metadata,
1897
+ throwDefaultError({
1898
+ output: output,
1899
+ parsedBody: parsedBody,
1900
+ exceptionCtor: __BaseException,
1901
+ errorCode: errorCode,
2219
1902
  });
2220
- throw __decorateServiceException(response, parsedBody);
1903
+ _d.label = 9;
1904
+ case 9: return [2];
2221
1905
  }
2222
1906
  });
2223
1907
  }); };
@@ -2229,28 +1913,26 @@ export var deserializeAws_restJson1ListAssistantsCommand = function (output, con
2229
1913
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2230
1914
  return [2, deserializeAws_restJson1ListAssistantsCommandError(output, context)];
2231
1915
  }
2232
- contents = {
1916
+ contents = map({
2233
1917
  $metadata: deserializeMetadata(output),
2234
- assistantSummaries: undefined,
2235
- nextToken: undefined,
2236
- };
1918
+ });
2237
1919
  _a = __expectNonNull;
2238
1920
  _b = __expectObject;
2239
1921
  return [4, parseBody(output.body, context)];
2240
1922
  case 1:
2241
1923
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2242
- if (data.assistantSummaries !== undefined && data.assistantSummaries !== null) {
1924
+ if (data.assistantSummaries != null) {
2243
1925
  contents.assistantSummaries = deserializeAws_restJson1AssistantList(data.assistantSummaries, context);
2244
1926
  }
2245
- if (data.nextToken !== undefined && data.nextToken !== null) {
1927
+ if (data.nextToken != null) {
2246
1928
  contents.nextToken = __expectString(data.nextToken);
2247
1929
  }
2248
- return [2, Promise.resolve(contents)];
1930
+ return [2, contents];
2249
1931
  }
2250
1932
  });
2251
1933
  }); };
2252
1934
  var deserializeAws_restJson1ListAssistantsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2253
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1935
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2254
1936
  var _c;
2255
1937
  return __generator(this, function (_d) {
2256
1938
  switch (_d.label) {
@@ -2275,14 +1957,14 @@ var deserializeAws_restJson1ListAssistantsCommandError = function (output, conte
2275
1957
  case 5: throw _d.sent();
2276
1958
  case 6:
2277
1959
  parsedBody = parsedOutput.body;
2278
- $metadata = deserializeMetadata(output);
2279
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2280
- response = new __BaseException({
2281
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2282
- $fault: "client",
2283
- $metadata: $metadata,
1960
+ throwDefaultError({
1961
+ output: output,
1962
+ parsedBody: parsedBody,
1963
+ exceptionCtor: __BaseException,
1964
+ errorCode: errorCode,
2284
1965
  });
2285
- throw __decorateServiceException(response, parsedBody);
1966
+ _d.label = 7;
1967
+ case 7: return [2];
2286
1968
  }
2287
1969
  });
2288
1970
  }); };
@@ -2294,28 +1976,26 @@ export var deserializeAws_restJson1ListContentsCommand = function (output, conte
2294
1976
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2295
1977
  return [2, deserializeAws_restJson1ListContentsCommandError(output, context)];
2296
1978
  }
2297
- contents = {
1979
+ contents = map({
2298
1980
  $metadata: deserializeMetadata(output),
2299
- contentSummaries: undefined,
2300
- nextToken: undefined,
2301
- };
1981
+ });
2302
1982
  _a = __expectNonNull;
2303
1983
  _b = __expectObject;
2304
1984
  return [4, parseBody(output.body, context)];
2305
1985
  case 1:
2306
1986
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2307
- if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
1987
+ if (data.contentSummaries != null) {
2308
1988
  contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
2309
1989
  }
2310
- if (data.nextToken !== undefined && data.nextToken !== null) {
1990
+ if (data.nextToken != null) {
2311
1991
  contents.nextToken = __expectString(data.nextToken);
2312
1992
  }
2313
- return [2, Promise.resolve(contents)];
1993
+ return [2, contents];
2314
1994
  }
2315
1995
  });
2316
1996
  }); };
2317
1997
  var deserializeAws_restJson1ListContentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2318
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1998
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2319
1999
  var _c;
2320
2000
  return __generator(this, function (_d) {
2321
2001
  switch (_d.label) {
@@ -2344,14 +2024,14 @@ var deserializeAws_restJson1ListContentsCommandError = function (output, context
2344
2024
  case 7: throw _d.sent();
2345
2025
  case 8:
2346
2026
  parsedBody = parsedOutput.body;
2347
- $metadata = deserializeMetadata(output);
2348
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2349
- response = new __BaseException({
2350
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2351
- $fault: "client",
2352
- $metadata: $metadata,
2027
+ throwDefaultError({
2028
+ output: output,
2029
+ parsedBody: parsedBody,
2030
+ exceptionCtor: __BaseException,
2031
+ errorCode: errorCode,
2353
2032
  });
2354
- throw __decorateServiceException(response, parsedBody);
2033
+ _d.label = 9;
2034
+ case 9: return [2];
2355
2035
  }
2356
2036
  });
2357
2037
  }); };
@@ -2363,28 +2043,26 @@ export var deserializeAws_restJson1ListKnowledgeBasesCommand = function (output,
2363
2043
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2364
2044
  return [2, deserializeAws_restJson1ListKnowledgeBasesCommandError(output, context)];
2365
2045
  }
2366
- contents = {
2046
+ contents = map({
2367
2047
  $metadata: deserializeMetadata(output),
2368
- knowledgeBaseSummaries: undefined,
2369
- nextToken: undefined,
2370
- };
2048
+ });
2371
2049
  _a = __expectNonNull;
2372
2050
  _b = __expectObject;
2373
2051
  return [4, parseBody(output.body, context)];
2374
2052
  case 1:
2375
2053
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2376
- if (data.knowledgeBaseSummaries !== undefined && data.knowledgeBaseSummaries !== null) {
2054
+ if (data.knowledgeBaseSummaries != null) {
2377
2055
  contents.knowledgeBaseSummaries = deserializeAws_restJson1KnowledgeBaseList(data.knowledgeBaseSummaries, context);
2378
2056
  }
2379
- if (data.nextToken !== undefined && data.nextToken !== null) {
2057
+ if (data.nextToken != null) {
2380
2058
  contents.nextToken = __expectString(data.nextToken);
2381
2059
  }
2382
- return [2, Promise.resolve(contents)];
2060
+ return [2, contents];
2383
2061
  }
2384
2062
  });
2385
2063
  }); };
2386
2064
  var deserializeAws_restJson1ListKnowledgeBasesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2387
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2065
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2388
2066
  var _c;
2389
2067
  return __generator(this, function (_d) {
2390
2068
  switch (_d.label) {
@@ -2409,14 +2087,14 @@ var deserializeAws_restJson1ListKnowledgeBasesCommandError = function (output, c
2409
2087
  case 5: throw _d.sent();
2410
2088
  case 6:
2411
2089
  parsedBody = parsedOutput.body;
2412
- $metadata = deserializeMetadata(output);
2413
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2414
- response = new __BaseException({
2415
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2416
- $fault: "client",
2417
- $metadata: $metadata,
2090
+ throwDefaultError({
2091
+ output: output,
2092
+ parsedBody: parsedBody,
2093
+ exceptionCtor: __BaseException,
2094
+ errorCode: errorCode,
2418
2095
  });
2419
- throw __decorateServiceException(response, parsedBody);
2096
+ _d.label = 7;
2097
+ case 7: return [2];
2420
2098
  }
2421
2099
  });
2422
2100
  }); };
@@ -2428,24 +2106,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2428
2106
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2429
2107
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2430
2108
  }
2431
- contents = {
2109
+ contents = map({
2432
2110
  $metadata: deserializeMetadata(output),
2433
- tags: undefined,
2434
- };
2111
+ });
2435
2112
  _a = __expectNonNull;
2436
2113
  _b = __expectObject;
2437
2114
  return [4, parseBody(output.body, context)];
2438
2115
  case 1:
2439
2116
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2440
- if (data.tags !== undefined && data.tags !== null) {
2117
+ if (data.tags != null) {
2441
2118
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
2442
2119
  }
2443
- return [2, Promise.resolve(contents)];
2120
+ return [2, contents];
2444
2121
  }
2445
2122
  });
2446
2123
  }); };
2447
2124
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2448
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2125
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2449
2126
  var _c;
2450
2127
  return __generator(this, function (_d) {
2451
2128
  switch (_d.label) {
@@ -2466,14 +2143,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2466
2143
  case 3: throw _d.sent();
2467
2144
  case 4:
2468
2145
  parsedBody = parsedOutput.body;
2469
- $metadata = deserializeMetadata(output);
2470
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2471
- response = new __BaseException({
2472
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2473
- $fault: "client",
2474
- $metadata: $metadata,
2146
+ throwDefaultError({
2147
+ output: output,
2148
+ parsedBody: parsedBody,
2149
+ exceptionCtor: __BaseException,
2150
+ errorCode: errorCode,
2475
2151
  });
2476
- throw __decorateServiceException(response, parsedBody);
2152
+ _d.label = 5;
2153
+ case 5: return [2];
2477
2154
  }
2478
2155
  });
2479
2156
  }); };
@@ -2485,28 +2162,26 @@ export var deserializeAws_restJson1NotifyRecommendationsReceivedCommand = functi
2485
2162
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2486
2163
  return [2, deserializeAws_restJson1NotifyRecommendationsReceivedCommandError(output, context)];
2487
2164
  }
2488
- contents = {
2165
+ contents = map({
2489
2166
  $metadata: deserializeMetadata(output),
2490
- errors: undefined,
2491
- recommendationIds: undefined,
2492
- };
2167
+ });
2493
2168
  _a = __expectNonNull;
2494
2169
  _b = __expectObject;
2495
2170
  return [4, parseBody(output.body, context)];
2496
2171
  case 1:
2497
2172
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2498
- if (data.errors !== undefined && data.errors !== null) {
2173
+ if (data.errors != null) {
2499
2174
  contents.errors = deserializeAws_restJson1NotifyRecommendationsReceivedErrorList(data.errors, context);
2500
2175
  }
2501
- if (data.recommendationIds !== undefined && data.recommendationIds !== null) {
2176
+ if (data.recommendationIds != null) {
2502
2177
  contents.recommendationIds = deserializeAws_restJson1RecommendationIdList(data.recommendationIds, context);
2503
2178
  }
2504
- return [2, Promise.resolve(contents)];
2179
+ return [2, contents];
2505
2180
  }
2506
2181
  });
2507
2182
  }); };
2508
2183
  var deserializeAws_restJson1NotifyRecommendationsReceivedCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2509
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2184
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2510
2185
  var _c;
2511
2186
  return __generator(this, function (_d) {
2512
2187
  switch (_d.label) {
@@ -2535,14 +2210,14 @@ var deserializeAws_restJson1NotifyRecommendationsReceivedCommandError = function
2535
2210
  case 7: throw _d.sent();
2536
2211
  case 8:
2537
2212
  parsedBody = parsedOutput.body;
2538
- $metadata = deserializeMetadata(output);
2539
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2540
- response = new __BaseException({
2541
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2542
- $fault: "client",
2543
- $metadata: $metadata,
2213
+ throwDefaultError({
2214
+ output: output,
2215
+ parsedBody: parsedBody,
2216
+ exceptionCtor: __BaseException,
2217
+ errorCode: errorCode,
2544
2218
  });
2545
- throw __decorateServiceException(response, parsedBody);
2219
+ _d.label = 9;
2220
+ case 9: return [2];
2546
2221
  }
2547
2222
  });
2548
2223
  }); };
@@ -2554,28 +2229,26 @@ export var deserializeAws_restJson1QueryAssistantCommand = function (output, con
2554
2229
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2555
2230
  return [2, deserializeAws_restJson1QueryAssistantCommandError(output, context)];
2556
2231
  }
2557
- contents = {
2232
+ contents = map({
2558
2233
  $metadata: deserializeMetadata(output),
2559
- nextToken: undefined,
2560
- results: undefined,
2561
- };
2234
+ });
2562
2235
  _a = __expectNonNull;
2563
2236
  _b = __expectObject;
2564
2237
  return [4, parseBody(output.body, context)];
2565
2238
  case 1:
2566
2239
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2567
- if (data.nextToken !== undefined && data.nextToken !== null) {
2240
+ if (data.nextToken != null) {
2568
2241
  contents.nextToken = __expectString(data.nextToken);
2569
2242
  }
2570
- if (data.results !== undefined && data.results !== null) {
2243
+ if (data.results != null) {
2571
2244
  contents.results = deserializeAws_restJson1QueryResultsList(data.results, context);
2572
2245
  }
2573
- return [2, Promise.resolve(contents)];
2246
+ return [2, contents];
2574
2247
  }
2575
2248
  });
2576
2249
  }); };
2577
2250
  var deserializeAws_restJson1QueryAssistantCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2578
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2251
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2579
2252
  var _c;
2580
2253
  return __generator(this, function (_d) {
2581
2254
  switch (_d.label) {
@@ -2604,14 +2277,14 @@ var deserializeAws_restJson1QueryAssistantCommandError = function (output, conte
2604
2277
  case 7: throw _d.sent();
2605
2278
  case 8:
2606
2279
  parsedBody = parsedOutput.body;
2607
- $metadata = deserializeMetadata(output);
2608
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2609
- response = new __BaseException({
2610
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2611
- $fault: "client",
2612
- $metadata: $metadata,
2280
+ throwDefaultError({
2281
+ output: output,
2282
+ parsedBody: parsedBody,
2283
+ exceptionCtor: __BaseException,
2284
+ errorCode: errorCode,
2613
2285
  });
2614
- throw __decorateServiceException(response, parsedBody);
2286
+ _d.label = 9;
2287
+ case 9: return [2];
2615
2288
  }
2616
2289
  });
2617
2290
  }); };
@@ -2623,18 +2296,18 @@ export var deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = funct
2623
2296
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2624
2297
  return [2, deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError(output, context)];
2625
2298
  }
2626
- contents = {
2299
+ contents = map({
2627
2300
  $metadata: deserializeMetadata(output),
2628
- };
2301
+ });
2629
2302
  return [4, collectBody(output.body, context)];
2630
2303
  case 1:
2631
2304
  _a.sent();
2632
- return [2, Promise.resolve(contents)];
2305
+ return [2, contents];
2633
2306
  }
2634
2307
  });
2635
2308
  }); };
2636
2309
  var deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2637
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2310
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2638
2311
  var _c;
2639
2312
  return __generator(this, function (_d) {
2640
2313
  switch (_d.label) {
@@ -2663,14 +2336,14 @@ var deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError = functio
2663
2336
  case 7: throw _d.sent();
2664
2337
  case 8:
2665
2338
  parsedBody = parsedOutput.body;
2666
- $metadata = deserializeMetadata(output);
2667
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2668
- response = new __BaseException({
2669
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2670
- $fault: "client",
2671
- $metadata: $metadata,
2339
+ throwDefaultError({
2340
+ output: output,
2341
+ parsedBody: parsedBody,
2342
+ exceptionCtor: __BaseException,
2343
+ errorCode: errorCode,
2672
2344
  });
2673
- throw __decorateServiceException(response, parsedBody);
2345
+ _d.label = 9;
2346
+ case 9: return [2];
2674
2347
  }
2675
2348
  });
2676
2349
  }); };
@@ -2682,28 +2355,26 @@ export var deserializeAws_restJson1SearchContentCommand = function (output, cont
2682
2355
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2683
2356
  return [2, deserializeAws_restJson1SearchContentCommandError(output, context)];
2684
2357
  }
2685
- contents = {
2358
+ contents = map({
2686
2359
  $metadata: deserializeMetadata(output),
2687
- contentSummaries: undefined,
2688
- nextToken: undefined,
2689
- };
2360
+ });
2690
2361
  _a = __expectNonNull;
2691
2362
  _b = __expectObject;
2692
2363
  return [4, parseBody(output.body, context)];
2693
2364
  case 1:
2694
2365
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2695
- if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
2366
+ if (data.contentSummaries != null) {
2696
2367
  contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
2697
2368
  }
2698
- if (data.nextToken !== undefined && data.nextToken !== null) {
2369
+ if (data.nextToken != null) {
2699
2370
  contents.nextToken = __expectString(data.nextToken);
2700
2371
  }
2701
- return [2, Promise.resolve(contents)];
2372
+ return [2, contents];
2702
2373
  }
2703
2374
  });
2704
2375
  }); };
2705
2376
  var deserializeAws_restJson1SearchContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2706
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2377
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2707
2378
  var _c;
2708
2379
  return __generator(this, function (_d) {
2709
2380
  switch (_d.label) {
@@ -2732,14 +2403,14 @@ var deserializeAws_restJson1SearchContentCommandError = function (output, contex
2732
2403
  case 7: throw _d.sent();
2733
2404
  case 8:
2734
2405
  parsedBody = parsedOutput.body;
2735
- $metadata = deserializeMetadata(output);
2736
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2737
- response = new __BaseException({
2738
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2739
- $fault: "client",
2740
- $metadata: $metadata,
2406
+ throwDefaultError({
2407
+ output: output,
2408
+ parsedBody: parsedBody,
2409
+ exceptionCtor: __BaseException,
2410
+ errorCode: errorCode,
2741
2411
  });
2742
- throw __decorateServiceException(response, parsedBody);
2412
+ _d.label = 9;
2413
+ case 9: return [2];
2743
2414
  }
2744
2415
  });
2745
2416
  }); };
@@ -2751,28 +2422,26 @@ export var deserializeAws_restJson1SearchSessionsCommand = function (output, con
2751
2422
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2752
2423
  return [2, deserializeAws_restJson1SearchSessionsCommandError(output, context)];
2753
2424
  }
2754
- contents = {
2425
+ contents = map({
2755
2426
  $metadata: deserializeMetadata(output),
2756
- nextToken: undefined,
2757
- sessionSummaries: undefined,
2758
- };
2427
+ });
2759
2428
  _a = __expectNonNull;
2760
2429
  _b = __expectObject;
2761
2430
  return [4, parseBody(output.body, context)];
2762
2431
  case 1:
2763
2432
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2764
- if (data.nextToken !== undefined && data.nextToken !== null) {
2433
+ if (data.nextToken != null) {
2765
2434
  contents.nextToken = __expectString(data.nextToken);
2766
2435
  }
2767
- if (data.sessionSummaries !== undefined && data.sessionSummaries !== null) {
2436
+ if (data.sessionSummaries != null) {
2768
2437
  contents.sessionSummaries = deserializeAws_restJson1SessionSummaries(data.sessionSummaries, context);
2769
2438
  }
2770
- return [2, Promise.resolve(contents)];
2439
+ return [2, contents];
2771
2440
  }
2772
2441
  });
2773
2442
  }); };
2774
2443
  var deserializeAws_restJson1SearchSessionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2775
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2444
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2776
2445
  var _c;
2777
2446
  return __generator(this, function (_d) {
2778
2447
  switch (_d.label) {
@@ -2801,14 +2470,14 @@ var deserializeAws_restJson1SearchSessionsCommandError = function (output, conte
2801
2470
  case 7: throw _d.sent();
2802
2471
  case 8:
2803
2472
  parsedBody = parsedOutput.body;
2804
- $metadata = deserializeMetadata(output);
2805
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2806
- response = new __BaseException({
2807
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2808
- $fault: "client",
2809
- $metadata: $metadata,
2473
+ throwDefaultError({
2474
+ output: output,
2475
+ parsedBody: parsedBody,
2476
+ exceptionCtor: __BaseException,
2477
+ errorCode: errorCode,
2810
2478
  });
2811
- throw __decorateServiceException(response, parsedBody);
2479
+ _d.label = 9;
2480
+ case 9: return [2];
2812
2481
  }
2813
2482
  });
2814
2483
  }); };
@@ -2820,36 +2489,32 @@ export var deserializeAws_restJson1StartContentUploadCommand = function (output,
2820
2489
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2821
2490
  return [2, deserializeAws_restJson1StartContentUploadCommandError(output, context)];
2822
2491
  }
2823
- contents = {
2492
+ contents = map({
2824
2493
  $metadata: deserializeMetadata(output),
2825
- headersToInclude: undefined,
2826
- uploadId: undefined,
2827
- url: undefined,
2828
- urlExpiry: undefined,
2829
- };
2494
+ });
2830
2495
  _a = __expectNonNull;
2831
2496
  _b = __expectObject;
2832
2497
  return [4, parseBody(output.body, context)];
2833
2498
  case 1:
2834
2499
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2835
- if (data.headersToInclude !== undefined && data.headersToInclude !== null) {
2500
+ if (data.headersToInclude != null) {
2836
2501
  contents.headersToInclude = deserializeAws_restJson1Headers(data.headersToInclude, context);
2837
2502
  }
2838
- if (data.uploadId !== undefined && data.uploadId !== null) {
2503
+ if (data.uploadId != null) {
2839
2504
  contents.uploadId = __expectString(data.uploadId);
2840
2505
  }
2841
- if (data.url !== undefined && data.url !== null) {
2506
+ if (data.url != null) {
2842
2507
  contents.url = __expectString(data.url);
2843
2508
  }
2844
- if (data.urlExpiry !== undefined && data.urlExpiry !== null) {
2509
+ if (data.urlExpiry != null) {
2845
2510
  contents.urlExpiry = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.urlExpiry)));
2846
2511
  }
2847
- return [2, Promise.resolve(contents)];
2512
+ return [2, contents];
2848
2513
  }
2849
2514
  });
2850
2515
  }); };
2851
2516
  var deserializeAws_restJson1StartContentUploadCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2852
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2517
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2853
2518
  var _c;
2854
2519
  return __generator(this, function (_d) {
2855
2520
  switch (_d.label) {
@@ -2878,14 +2543,14 @@ var deserializeAws_restJson1StartContentUploadCommandError = function (output, c
2878
2543
  case 7: throw _d.sent();
2879
2544
  case 8:
2880
2545
  parsedBody = parsedOutput.body;
2881
- $metadata = deserializeMetadata(output);
2882
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2883
- response = new __BaseException({
2884
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2885
- $fault: "client",
2886
- $metadata: $metadata,
2546
+ throwDefaultError({
2547
+ output: output,
2548
+ parsedBody: parsedBody,
2549
+ exceptionCtor: __BaseException,
2550
+ errorCode: errorCode,
2887
2551
  });
2888
- throw __decorateServiceException(response, parsedBody);
2552
+ _d.label = 9;
2553
+ case 9: return [2];
2889
2554
  }
2890
2555
  });
2891
2556
  }); };
@@ -2897,18 +2562,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2897
2562
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2898
2563
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2899
2564
  }
2900
- contents = {
2565
+ contents = map({
2901
2566
  $metadata: deserializeMetadata(output),
2902
- };
2567
+ });
2903
2568
  return [4, collectBody(output.body, context)];
2904
2569
  case 1:
2905
2570
  _a.sent();
2906
- return [2, Promise.resolve(contents)];
2571
+ return [2, contents];
2907
2572
  }
2908
2573
  });
2909
2574
  }); };
2910
2575
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2911
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2576
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2912
2577
  var _c;
2913
2578
  return __generator(this, function (_d) {
2914
2579
  switch (_d.label) {
@@ -2933,14 +2598,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2933
2598
  case 5: throw _d.sent();
2934
2599
  case 6:
2935
2600
  parsedBody = parsedOutput.body;
2936
- $metadata = deserializeMetadata(output);
2937
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2938
- response = new __BaseException({
2939
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2940
- $fault: "client",
2941
- $metadata: $metadata,
2601
+ throwDefaultError({
2602
+ output: output,
2603
+ parsedBody: parsedBody,
2604
+ exceptionCtor: __BaseException,
2605
+ errorCode: errorCode,
2942
2606
  });
2943
- throw __decorateServiceException(response, parsedBody);
2607
+ _d.label = 7;
2608
+ case 7: return [2];
2944
2609
  }
2945
2610
  });
2946
2611
  }); };
@@ -2952,18 +2617,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2952
2617
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2953
2618
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2954
2619
  }
2955
- contents = {
2620
+ contents = map({
2956
2621
  $metadata: deserializeMetadata(output),
2957
- };
2622
+ });
2958
2623
  return [4, collectBody(output.body, context)];
2959
2624
  case 1:
2960
2625
  _a.sent();
2961
- return [2, Promise.resolve(contents)];
2626
+ return [2, contents];
2962
2627
  }
2963
2628
  });
2964
2629
  }); };
2965
2630
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2966
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2631
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2967
2632
  var _c;
2968
2633
  return __generator(this, function (_d) {
2969
2634
  switch (_d.label) {
@@ -2984,14 +2649,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2984
2649
  case 3: throw _d.sent();
2985
2650
  case 4:
2986
2651
  parsedBody = parsedOutput.body;
2987
- $metadata = deserializeMetadata(output);
2988
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2989
- response = new __BaseException({
2990
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2991
- $fault: "client",
2992
- $metadata: $metadata,
2652
+ throwDefaultError({
2653
+ output: output,
2654
+ parsedBody: parsedBody,
2655
+ exceptionCtor: __BaseException,
2656
+ errorCode: errorCode,
2993
2657
  });
2994
- throw __decorateServiceException(response, parsedBody);
2658
+ _d.label = 5;
2659
+ case 5: return [2];
2995
2660
  }
2996
2661
  });
2997
2662
  }); };
@@ -3003,24 +2668,23 @@ export var deserializeAws_restJson1UpdateContentCommand = function (output, cont
3003
2668
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3004
2669
  return [2, deserializeAws_restJson1UpdateContentCommandError(output, context)];
3005
2670
  }
3006
- contents = {
2671
+ contents = map({
3007
2672
  $metadata: deserializeMetadata(output),
3008
- content: undefined,
3009
- };
2673
+ });
3010
2674
  _a = __expectNonNull;
3011
2675
  _b = __expectObject;
3012
2676
  return [4, parseBody(output.body, context)];
3013
2677
  case 1:
3014
2678
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3015
- if (data.content !== undefined && data.content !== null) {
2679
+ if (data.content != null) {
3016
2680
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
3017
2681
  }
3018
- return [2, Promise.resolve(contents)];
2682
+ return [2, contents];
3019
2683
  }
3020
2684
  });
3021
2685
  }); };
3022
2686
  var deserializeAws_restJson1UpdateContentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3023
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2687
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3024
2688
  var _c;
3025
2689
  return __generator(this, function (_d) {
3026
2690
  switch (_d.label) {
@@ -3053,14 +2717,14 @@ var deserializeAws_restJson1UpdateContentCommandError = function (output, contex
3053
2717
  case 9: throw _d.sent();
3054
2718
  case 10:
3055
2719
  parsedBody = parsedOutput.body;
3056
- $metadata = deserializeMetadata(output);
3057
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3058
- response = new __BaseException({
3059
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3060
- $fault: "client",
3061
- $metadata: $metadata,
2720
+ throwDefaultError({
2721
+ output: output,
2722
+ parsedBody: parsedBody,
2723
+ exceptionCtor: __BaseException,
2724
+ errorCode: errorCode,
3062
2725
  });
3063
- throw __decorateServiceException(response, parsedBody);
2726
+ _d.label = 11;
2727
+ case 11: return [2];
3064
2728
  }
3065
2729
  });
3066
2730
  }); };
@@ -3072,24 +2736,23 @@ export var deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = funct
3072
2736
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3073
2737
  return [2, deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError(output, context)];
3074
2738
  }
3075
- contents = {
2739
+ contents = map({
3076
2740
  $metadata: deserializeMetadata(output),
3077
- knowledgeBase: undefined,
3078
- };
2741
+ });
3079
2742
  _a = __expectNonNull;
3080
2743
  _b = __expectObject;
3081
2744
  return [4, parseBody(output.body, context)];
3082
2745
  case 1:
3083
2746
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3084
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
2747
+ if (data.knowledgeBase != null) {
3085
2748
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
3086
2749
  }
3087
- return [2, Promise.resolve(contents)];
2750
+ return [2, contents];
3088
2751
  }
3089
2752
  });
3090
2753
  }); };
3091
2754
  var deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3092
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2755
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3093
2756
  var _c;
3094
2757
  return __generator(this, function (_d) {
3095
2758
  switch (_d.label) {
@@ -3118,23 +2781,24 @@ var deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError = functio
3118
2781
  case 7: throw _d.sent();
3119
2782
  case 8:
3120
2783
  parsedBody = parsedOutput.body;
3121
- $metadata = deserializeMetadata(output);
3122
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3123
- response = new __BaseException({
3124
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3125
- $fault: "client",
3126
- $metadata: $metadata,
2784
+ throwDefaultError({
2785
+ output: output,
2786
+ parsedBody: parsedBody,
2787
+ exceptionCtor: __BaseException,
2788
+ errorCode: errorCode,
3127
2789
  });
3128
- throw __decorateServiceException(response, parsedBody);
2790
+ _d.label = 9;
2791
+ case 9: return [2];
3129
2792
  }
3130
2793
  });
3131
2794
  }); };
2795
+ var map = __map;
3132
2796
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3133
2797
  var contents, data, exception;
3134
2798
  return __generator(this, function (_a) {
3135
- contents = {};
2799
+ contents = map({});
3136
2800
  data = parsedOutput.body;
3137
- if (data.message !== undefined && data.message !== null) {
2801
+ if (data.message != null) {
3138
2802
  contents.message = __expectString(data.message);
3139
2803
  }
3140
2804
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3144,9 +2808,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3144
2808
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3145
2809
  var contents, data, exception;
3146
2810
  return __generator(this, function (_a) {
3147
- contents = {};
2811
+ contents = map({});
3148
2812
  data = parsedOutput.body;
3149
- if (data.message !== undefined && data.message !== null) {
2813
+ if (data.message != null) {
3150
2814
  contents.message = __expectString(data.message);
3151
2815
  }
3152
2816
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3156,9 +2820,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3156
2820
  var deserializeAws_restJson1PreconditionFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3157
2821
  var contents, data, exception;
3158
2822
  return __generator(this, function (_a) {
3159
- contents = {};
2823
+ contents = map({});
3160
2824
  data = parsedOutput.body;
3161
- if (data.message !== undefined && data.message !== null) {
2825
+ if (data.message != null) {
3162
2826
  contents.message = __expectString(data.message);
3163
2827
  }
3164
2828
  exception = new PreconditionFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3168,12 +2832,12 @@ var deserializeAws_restJson1PreconditionFailedExceptionResponse = function (pars
3168
2832
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3169
2833
  var contents, data, exception;
3170
2834
  return __generator(this, function (_a) {
3171
- contents = {};
2835
+ contents = map({});
3172
2836
  data = parsedOutput.body;
3173
- if (data.message !== undefined && data.message !== null) {
2837
+ if (data.message != null) {
3174
2838
  contents.message = __expectString(data.message);
3175
2839
  }
3176
- if (data.resourceName !== undefined && data.resourceName !== null) {
2840
+ if (data.resourceName != null) {
3177
2841
  contents.resourceName = __expectString(data.resourceName);
3178
2842
  }
3179
2843
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3183,9 +2847,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3183
2847
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3184
2848
  var contents, data, exception;
3185
2849
  return __generator(this, function (_a) {
3186
- contents = {};
2850
+ contents = map({});
3187
2851
  data = parsedOutput.body;
3188
- if (data.message !== undefined && data.message !== null) {
2852
+ if (data.message != null) {
3189
2853
  contents.message = __expectString(data.message);
3190
2854
  }
3191
2855
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3195,12 +2859,12 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
3195
2859
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3196
2860
  var contents, data, exception;
3197
2861
  return __generator(this, function (_a) {
3198
- contents = {};
2862
+ contents = map({});
3199
2863
  data = parsedOutput.body;
3200
- if (data.message !== undefined && data.message !== null) {
2864
+ if (data.message != null) {
3201
2865
  contents.message = __expectString(data.message);
3202
2866
  }
3203
- if (data.resourceName !== undefined && data.resourceName !== null) {
2867
+ if (data.resourceName != null) {
3204
2868
  contents.resourceName = __expectString(data.resourceName);
3205
2869
  }
3206
2870
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3210,9 +2874,9 @@ var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutpu
3210
2874
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3211
2875
  var contents, data, exception;
3212
2876
  return __generator(this, function (_a) {
3213
- contents = {};
2877
+ contents = map({});
3214
2878
  data = parsedOutput.body;
3215
- if (data.message !== undefined && data.message !== null) {
2879
+ if (data.message != null) {
3216
2880
  contents.message = __expectString(data.message);
3217
2881
  }
3218
2882
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3247,9 +2911,6 @@ var serializeAws_restJson1FilterList = function (input, context) {
3247
2911
  return input
3248
2912
  .filter(function (e) { return e != null; })
3249
2913
  .map(function (entry) {
3250
- if (entry === null) {
3251
- return null;
3252
- }
3253
2914
  return serializeAws_restJson1Filter(entry, context);
3254
2915
  });
3255
2916
  };
@@ -3257,9 +2918,6 @@ var serializeAws_restJson1ObjectFieldsList = function (input, context) {
3257
2918
  return input
3258
2919
  .filter(function (e) { return e != null; })
3259
2920
  .map(function (entry) {
3260
- if (entry === null) {
3261
- return null;
3262
- }
3263
2921
  return entry;
3264
2922
  });
3265
2923
  };
@@ -3267,9 +2925,6 @@ var serializeAws_restJson1RecommendationIdList = function (input, context) {
3267
2925
  return input
3268
2926
  .filter(function (e) { return e != null; })
3269
2927
  .map(function (entry) {
3270
- if (entry === null) {
3271
- return null;
3272
- }
3273
2928
  return entry;
3274
2929
  });
3275
2930
  };
@@ -3320,7 +2975,7 @@ var deserializeAws_restJson1AssistantAssociationData = function (output, context
3320
2975
  };
3321
2976
  };
3322
2977
  var deserializeAws_restJson1AssistantAssociationOutputData = function (output, context) {
3323
- if (output.knowledgeBaseAssociation !== undefined && output.knowledgeBaseAssociation !== null) {
2978
+ if (output.knowledgeBaseAssociation != null) {
3324
2979
  return {
3325
2980
  knowledgeBaseAssociation: deserializeAws_restJson1KnowledgeBaseAssociationData(output.knowledgeBaseAssociation, context),
3326
2981
  };
@@ -3643,7 +3298,7 @@ var deserializeAws_restJson1RecommendationTrigger = function (output, context) {
3643
3298
  };
3644
3299
  };
3645
3300
  var deserializeAws_restJson1RecommendationTriggerData = function (output, context) {
3646
- if (output.query !== undefined && output.query !== null) {
3301
+ if (output.query != null) {
3647
3302
  return {
3648
3303
  query: deserializeAws_restJson1QueryRecommendationTriggerData(output.query, context),
3649
3304
  };
@@ -3707,7 +3362,7 @@ var deserializeAws_restJson1SessionSummary = function (output, context) {
3707
3362
  };
3708
3363
  };
3709
3364
  var deserializeAws_restJson1SourceConfiguration = function (output, context) {
3710
- if (output.appIntegrations !== undefined && output.appIntegrations !== null) {
3365
+ if (output.appIntegrations != null) {
3711
3366
  return {
3712
3367
  appIntegrations: deserializeAws_restJson1AppIntegrationsConfiguration(output.appIntegrations, context),
3713
3368
  };