@aws-sdk/client-wisdom 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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
  })));
@@ -781,8 +562,33 @@ export var serializeAws_restJson1NotifyRecommendationsReceivedCommand = function
781
562
  }
782
563
  });
783
564
  }); };
565
+ export var serializeAws_restJson1PutFeedbackCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
566
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
567
+ return __generator(this, function (_c) {
568
+ switch (_c.label) {
569
+ case 0: return [4, context.endpoint()];
570
+ case 1:
571
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
572
+ headers = {
573
+ "content-type": "application/json",
574
+ };
575
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assistants/{assistantId}/feedback";
576
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
577
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.feedback != null && { feedback: serializeAws_restJson1FeedbackData(input.feedback, context) })), (input.targetId != null && { targetId: input.targetId })), (input.targetType != null && { targetType: input.targetType })));
578
+ return [2, new __HttpRequest({
579
+ protocol: protocol,
580
+ hostname: hostname,
581
+ port: port,
582
+ method: "PUT",
583
+ headers: headers,
584
+ path: resolvedPath,
585
+ body: body,
586
+ })];
587
+ }
588
+ });
589
+ }); };
784
590
  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;
591
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
786
592
  return __generator(this, function (_c) {
787
593
  switch (_c.label) {
788
594
  case 0: return [4, context.endpoint()];
@@ -792,16 +598,7 @@ export var serializeAws_restJson1QueryAssistantCommand = function (input, contex
792
598
  "content-type": "application/json",
793
599
  };
794
600
  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
- }
601
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
805
602
  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
603
  return [2, new __HttpRequest({
807
604
  protocol: protocol,
@@ -816,7 +613,7 @@ export var serializeAws_restJson1QueryAssistantCommand = function (input, contex
816
613
  });
817
614
  }); };
818
615
  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;
616
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
820
617
  return __generator(this, function (_c) {
821
618
  switch (_c.label) {
822
619
  case 0: return [4, context.endpoint()];
@@ -825,16 +622,7 @@ export var serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = functio
825
622
  headers = {};
826
623
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
827
624
  "/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
- }
625
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
838
626
  return [2, new __HttpRequest({
839
627
  protocol: protocol,
840
628
  hostname: hostname,
@@ -848,7 +636,7 @@ export var serializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = functio
848
636
  });
849
637
  }); };
850
638
  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;
639
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
852
640
  return __generator(this, function (_c) {
853
641
  switch (_c.label) {
854
642
  case 0: return [4, context.endpoint()];
@@ -858,17 +646,11 @@ export var serializeAws_restJson1SearchContentCommand = function (input, context
858
646
  "content-type": "application/json",
859
647
  };
860
648
  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() }));
649
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
650
+ query = map({
651
+ nextToken: [, input.nextToken],
652
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
653
+ });
872
654
  body = JSON.stringify(__assign({}, (input.searchExpression != null && {
873
655
  searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
874
656
  })));
@@ -886,7 +668,7 @@ export var serializeAws_restJson1SearchContentCommand = function (input, context
886
668
  });
887
669
  }); };
888
670
  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;
671
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
890
672
  return __generator(this, function (_c) {
891
673
  switch (_c.label) {
892
674
  case 0: return [4, context.endpoint()];
@@ -896,17 +678,11 @@ export var serializeAws_restJson1SearchSessionsCommand = function (input, contex
896
678
  "content-type": "application/json",
897
679
  };
898
680
  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() }));
681
+ resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", function () { return input.assistantId; }, "{assistantId}", false);
682
+ query = map({
683
+ nextToken: [, input.nextToken],
684
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
685
+ });
910
686
  body = JSON.stringify(__assign({}, (input.searchExpression != null && {
911
687
  searchExpression: serializeAws_restJson1SearchExpression(input.searchExpression, context),
912
688
  })));
@@ -924,7 +700,7 @@ export var serializeAws_restJson1SearchSessionsCommand = function (input, contex
924
700
  });
925
701
  }); };
926
702
  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;
703
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
928
704
  return __generator(this, function (_c) {
929
705
  switch (_c.label) {
930
706
  case 0: return [4, context.endpoint()];
@@ -934,16 +710,7 @@ export var serializeAws_restJson1StartContentUploadCommand = function (input, co
934
710
  "content-type": "application/json",
935
711
  };
936
712
  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
- }
713
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
947
714
  body = JSON.stringify(__assign({}, (input.contentType != null && { contentType: input.contentType })));
948
715
  return [2, new __HttpRequest({
949
716
  protocol: protocol,
@@ -958,7 +725,7 @@ export var serializeAws_restJson1StartContentUploadCommand = function (input, co
958
725
  });
959
726
  }); };
960
727
  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;
728
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
962
729
  return __generator(this, function (_c) {
963
730
  switch (_c.label) {
964
731
  case 0: return [4, context.endpoint()];
@@ -968,16 +735,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
968
735
  "content-type": "application/json",
969
736
  };
970
737
  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
- }
738
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
981
739
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
982
740
  return [2, new __HttpRequest({
983
741
  protocol: protocol,
@@ -992,7 +750,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
992
750
  });
993
751
  }); };
994
752
  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;
753
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
996
754
  return __generator(this, function (_c) {
997
755
  switch (_c.label) {
998
756
  case 0: return [4, context.endpoint()];
@@ -1000,17 +758,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1000
758
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1001
759
  headers = {};
1002
760
  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; }) }));
761
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
762
+ query = map({
763
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
764
+ });
1014
765
  return [2, new __HttpRequest({
1015
766
  protocol: protocol,
1016
767
  hostname: hostname,
@@ -1025,7 +776,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1025
776
  });
1026
777
  }); };
1027
778
  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;
779
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1029
780
  return __generator(this, function (_c) {
1030
781
  switch (_c.label) {
1031
782
  case 0: return [4, context.endpoint()];
@@ -1036,26 +787,8 @@ export var serializeAws_restJson1UpdateContentCommand = function (input, context
1036
787
  };
1037
788
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1038
789
  "/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
- }
790
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
791
+ resolvedPath = __resolvedPath(resolvedPath, input, "contentId", function () { return input.contentId; }, "{contentId}", false);
1059
792
  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
793
  return [2, new __HttpRequest({
1061
794
  protocol: protocol,
@@ -1070,7 +803,7 @@ export var serializeAws_restJson1UpdateContentCommand = function (input, context
1070
803
  });
1071
804
  }); };
1072
805
  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;
806
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1074
807
  return __generator(this, function (_c) {
1075
808
  switch (_c.label) {
1076
809
  case 0: return [4, context.endpoint()];
@@ -1081,16 +814,7 @@ export var serializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = functio
1081
814
  };
1082
815
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1083
816
  "/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
- }
817
+ resolvedPath = __resolvedPath(resolvedPath, input, "knowledgeBaseId", function () { return input.knowledgeBaseId; }, "{knowledgeBaseId}", false);
1094
818
  body = JSON.stringify(__assign({}, (input.templateUri != null && { templateUri: input.templateUri })));
1095
819
  return [2, new __HttpRequest({
1096
820
  protocol: protocol,
@@ -1112,24 +836,23 @@ export var deserializeAws_restJson1CreateAssistantCommand = function (output, co
1112
836
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1113
837
  return [2, deserializeAws_restJson1CreateAssistantCommandError(output, context)];
1114
838
  }
1115
- contents = {
839
+ contents = map({
1116
840
  $metadata: deserializeMetadata(output),
1117
- assistant: undefined,
1118
- };
841
+ });
1119
842
  _a = __expectNonNull;
1120
843
  _b = __expectObject;
1121
844
  return [4, parseBody(output.body, context)];
1122
845
  case 1:
1123
846
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1124
- if (data.assistant !== undefined && data.assistant !== null) {
847
+ if (data.assistant != null) {
1125
848
  contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
1126
849
  }
1127
- return [2, Promise.resolve(contents)];
850
+ return [2, contents];
1128
851
  }
1129
852
  });
1130
853
  }); };
1131
854
  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;
855
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1133
856
  var _c;
1134
857
  return __generator(this, function (_d) {
1135
858
  switch (_d.label) {
@@ -1162,14 +885,14 @@ var deserializeAws_restJson1CreateAssistantCommandError = function (output, cont
1162
885
  case 9: throw _d.sent();
1163
886
  case 10:
1164
887
  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,
888
+ throwDefaultError({
889
+ output: output,
890
+ parsedBody: parsedBody,
891
+ exceptionCtor: __BaseException,
892
+ errorCode: errorCode,
1171
893
  });
1172
- throw __decorateServiceException(response, parsedBody);
894
+ _d.label = 11;
895
+ case 11: return [2];
1173
896
  }
1174
897
  });
1175
898
  }); };
@@ -1181,24 +904,23 @@ export var deserializeAws_restJson1CreateAssistantAssociationCommand = function
1181
904
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1182
905
  return [2, deserializeAws_restJson1CreateAssistantAssociationCommandError(output, context)];
1183
906
  }
1184
- contents = {
907
+ contents = map({
1185
908
  $metadata: deserializeMetadata(output),
1186
- assistantAssociation: undefined,
1187
- };
909
+ });
1188
910
  _a = __expectNonNull;
1189
911
  _b = __expectObject;
1190
912
  return [4, parseBody(output.body, context)];
1191
913
  case 1:
1192
914
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1193
- if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
915
+ if (data.assistantAssociation != null) {
1194
916
  contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
1195
917
  }
1196
- return [2, Promise.resolve(contents)];
918
+ return [2, contents];
1197
919
  }
1198
920
  });
1199
921
  }); };
1200
922
  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;
923
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1202
924
  var _c;
1203
925
  return __generator(this, function (_d) {
1204
926
  switch (_d.label) {
@@ -1235,14 +957,14 @@ var deserializeAws_restJson1CreateAssistantAssociationCommandError = function (o
1235
957
  case 11: throw _d.sent();
1236
958
  case 12:
1237
959
  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,
960
+ throwDefaultError({
961
+ output: output,
962
+ parsedBody: parsedBody,
963
+ exceptionCtor: __BaseException,
964
+ errorCode: errorCode,
1244
965
  });
1245
- throw __decorateServiceException(response, parsedBody);
966
+ _d.label = 13;
967
+ case 13: return [2];
1246
968
  }
1247
969
  });
1248
970
  }); };
@@ -1254,24 +976,23 @@ export var deserializeAws_restJson1CreateContentCommand = function (output, cont
1254
976
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1255
977
  return [2, deserializeAws_restJson1CreateContentCommandError(output, context)];
1256
978
  }
1257
- contents = {
979
+ contents = map({
1258
980
  $metadata: deserializeMetadata(output),
1259
- content: undefined,
1260
- };
981
+ });
1261
982
  _a = __expectNonNull;
1262
983
  _b = __expectObject;
1263
984
  return [4, parseBody(output.body, context)];
1264
985
  case 1:
1265
986
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1266
- if (data.content !== undefined && data.content !== null) {
987
+ if (data.content != null) {
1267
988
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
1268
989
  }
1269
- return [2, Promise.resolve(contents)];
990
+ return [2, contents];
1270
991
  }
1271
992
  });
1272
993
  }); };
1273
994
  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;
995
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1275
996
  var _c;
1276
997
  return __generator(this, function (_d) {
1277
998
  switch (_d.label) {
@@ -1308,14 +1029,14 @@ var deserializeAws_restJson1CreateContentCommandError = function (output, contex
1308
1029
  case 11: throw _d.sent();
1309
1030
  case 12:
1310
1031
  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,
1032
+ throwDefaultError({
1033
+ output: output,
1034
+ parsedBody: parsedBody,
1035
+ exceptionCtor: __BaseException,
1036
+ errorCode: errorCode,
1317
1037
  });
1318
- throw __decorateServiceException(response, parsedBody);
1038
+ _d.label = 13;
1039
+ case 13: return [2];
1319
1040
  }
1320
1041
  });
1321
1042
  }); };
@@ -1327,24 +1048,23 @@ export var deserializeAws_restJson1CreateKnowledgeBaseCommand = function (output
1327
1048
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1328
1049
  return [2, deserializeAws_restJson1CreateKnowledgeBaseCommandError(output, context)];
1329
1050
  }
1330
- contents = {
1051
+ contents = map({
1331
1052
  $metadata: deserializeMetadata(output),
1332
- knowledgeBase: undefined,
1333
- };
1053
+ });
1334
1054
  _a = __expectNonNull;
1335
1055
  _b = __expectObject;
1336
1056
  return [4, parseBody(output.body, context)];
1337
1057
  case 1:
1338
1058
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1339
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
1059
+ if (data.knowledgeBase != null) {
1340
1060
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
1341
1061
  }
1342
- return [2, Promise.resolve(contents)];
1062
+ return [2, contents];
1343
1063
  }
1344
1064
  });
1345
1065
  }); };
1346
1066
  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;
1067
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1348
1068
  var _c;
1349
1069
  return __generator(this, function (_d) {
1350
1070
  switch (_d.label) {
@@ -1377,14 +1097,14 @@ var deserializeAws_restJson1CreateKnowledgeBaseCommandError = function (output,
1377
1097
  case 9: throw _d.sent();
1378
1098
  case 10:
1379
1099
  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,
1100
+ throwDefaultError({
1101
+ output: output,
1102
+ parsedBody: parsedBody,
1103
+ exceptionCtor: __BaseException,
1104
+ errorCode: errorCode,
1386
1105
  });
1387
- throw __decorateServiceException(response, parsedBody);
1106
+ _d.label = 11;
1107
+ case 11: return [2];
1388
1108
  }
1389
1109
  });
1390
1110
  }); };
@@ -1396,24 +1116,23 @@ export var deserializeAws_restJson1CreateSessionCommand = function (output, cont
1396
1116
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1397
1117
  return [2, deserializeAws_restJson1CreateSessionCommandError(output, context)];
1398
1118
  }
1399
- contents = {
1119
+ contents = map({
1400
1120
  $metadata: deserializeMetadata(output),
1401
- session: undefined,
1402
- };
1121
+ });
1403
1122
  _a = __expectNonNull;
1404
1123
  _b = __expectObject;
1405
1124
  return [4, parseBody(output.body, context)];
1406
1125
  case 1:
1407
1126
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1408
- if (data.session !== undefined && data.session !== null) {
1127
+ if (data.session != null) {
1409
1128
  contents.session = deserializeAws_restJson1SessionData(data.session, context);
1410
1129
  }
1411
- return [2, Promise.resolve(contents)];
1130
+ return [2, contents];
1412
1131
  }
1413
1132
  });
1414
1133
  }); };
1415
1134
  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;
1135
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1417
1136
  var _c;
1418
1137
  return __generator(this, function (_d) {
1419
1138
  switch (_d.label) {
@@ -1442,14 +1161,14 @@ var deserializeAws_restJson1CreateSessionCommandError = function (output, contex
1442
1161
  case 7: throw _d.sent();
1443
1162
  case 8:
1444
1163
  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,
1164
+ throwDefaultError({
1165
+ output: output,
1166
+ parsedBody: parsedBody,
1167
+ exceptionCtor: __BaseException,
1168
+ errorCode: errorCode,
1451
1169
  });
1452
- throw __decorateServiceException(response, parsedBody);
1170
+ _d.label = 9;
1171
+ case 9: return [2];
1453
1172
  }
1454
1173
  });
1455
1174
  }); };
@@ -1461,18 +1180,18 @@ export var deserializeAws_restJson1DeleteAssistantCommand = function (output, co
1461
1180
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1462
1181
  return [2, deserializeAws_restJson1DeleteAssistantCommandError(output, context)];
1463
1182
  }
1464
- contents = {
1183
+ contents = map({
1465
1184
  $metadata: deserializeMetadata(output),
1466
- };
1185
+ });
1467
1186
  return [4, collectBody(output.body, context)];
1468
1187
  case 1:
1469
1188
  _a.sent();
1470
- return [2, Promise.resolve(contents)];
1189
+ return [2, contents];
1471
1190
  }
1472
1191
  });
1473
1192
  }); };
1474
1193
  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;
1194
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1476
1195
  var _c;
1477
1196
  return __generator(this, function (_d) {
1478
1197
  switch (_d.label) {
@@ -1501,14 +1220,14 @@ var deserializeAws_restJson1DeleteAssistantCommandError = function (output, cont
1501
1220
  case 7: throw _d.sent();
1502
1221
  case 8:
1503
1222
  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,
1223
+ throwDefaultError({
1224
+ output: output,
1225
+ parsedBody: parsedBody,
1226
+ exceptionCtor: __BaseException,
1227
+ errorCode: errorCode,
1510
1228
  });
1511
- throw __decorateServiceException(response, parsedBody);
1229
+ _d.label = 9;
1230
+ case 9: return [2];
1512
1231
  }
1513
1232
  });
1514
1233
  }); };
@@ -1520,18 +1239,18 @@ export var deserializeAws_restJson1DeleteAssistantAssociationCommand = function
1520
1239
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1521
1240
  return [2, deserializeAws_restJson1DeleteAssistantAssociationCommandError(output, context)];
1522
1241
  }
1523
- contents = {
1242
+ contents = map({
1524
1243
  $metadata: deserializeMetadata(output),
1525
- };
1244
+ });
1526
1245
  return [4, collectBody(output.body, context)];
1527
1246
  case 1:
1528
1247
  _a.sent();
1529
- return [2, Promise.resolve(contents)];
1248
+ return [2, contents];
1530
1249
  }
1531
1250
  });
1532
1251
  }); };
1533
1252
  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;
1253
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1535
1254
  var _c;
1536
1255
  return __generator(this, function (_d) {
1537
1256
  switch (_d.label) {
@@ -1560,14 +1279,14 @@ var deserializeAws_restJson1DeleteAssistantAssociationCommandError = function (o
1560
1279
  case 7: throw _d.sent();
1561
1280
  case 8:
1562
1281
  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,
1282
+ throwDefaultError({
1283
+ output: output,
1284
+ parsedBody: parsedBody,
1285
+ exceptionCtor: __BaseException,
1286
+ errorCode: errorCode,
1569
1287
  });
1570
- throw __decorateServiceException(response, parsedBody);
1288
+ _d.label = 9;
1289
+ case 9: return [2];
1571
1290
  }
1572
1291
  });
1573
1292
  }); };
@@ -1579,18 +1298,18 @@ export var deserializeAws_restJson1DeleteContentCommand = function (output, cont
1579
1298
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1580
1299
  return [2, deserializeAws_restJson1DeleteContentCommandError(output, context)];
1581
1300
  }
1582
- contents = {
1301
+ contents = map({
1583
1302
  $metadata: deserializeMetadata(output),
1584
- };
1303
+ });
1585
1304
  return [4, collectBody(output.body, context)];
1586
1305
  case 1:
1587
1306
  _a.sent();
1588
- return [2, Promise.resolve(contents)];
1307
+ return [2, contents];
1589
1308
  }
1590
1309
  });
1591
1310
  }); };
1592
1311
  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;
1312
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1594
1313
  var _c;
1595
1314
  return __generator(this, function (_d) {
1596
1315
  switch (_d.label) {
@@ -1619,14 +1338,14 @@ var deserializeAws_restJson1DeleteContentCommandError = function (output, contex
1619
1338
  case 7: throw _d.sent();
1620
1339
  case 8:
1621
1340
  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,
1341
+ throwDefaultError({
1342
+ output: output,
1343
+ parsedBody: parsedBody,
1344
+ exceptionCtor: __BaseException,
1345
+ errorCode: errorCode,
1628
1346
  });
1629
- throw __decorateServiceException(response, parsedBody);
1347
+ _d.label = 9;
1348
+ case 9: return [2];
1630
1349
  }
1631
1350
  });
1632
1351
  }); };
@@ -1638,18 +1357,18 @@ export var deserializeAws_restJson1DeleteKnowledgeBaseCommand = function (output
1638
1357
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1639
1358
  return [2, deserializeAws_restJson1DeleteKnowledgeBaseCommandError(output, context)];
1640
1359
  }
1641
- contents = {
1360
+ contents = map({
1642
1361
  $metadata: deserializeMetadata(output),
1643
- };
1362
+ });
1644
1363
  return [4, collectBody(output.body, context)];
1645
1364
  case 1:
1646
1365
  _a.sent();
1647
- return [2, Promise.resolve(contents)];
1366
+ return [2, contents];
1648
1367
  }
1649
1368
  });
1650
1369
  }); };
1651
1370
  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;
1371
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1653
1372
  var _c;
1654
1373
  return __generator(this, function (_d) {
1655
1374
  switch (_d.label) {
@@ -1682,14 +1401,14 @@ var deserializeAws_restJson1DeleteKnowledgeBaseCommandError = function (output,
1682
1401
  case 9: throw _d.sent();
1683
1402
  case 10:
1684
1403
  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,
1404
+ throwDefaultError({
1405
+ output: output,
1406
+ parsedBody: parsedBody,
1407
+ exceptionCtor: __BaseException,
1408
+ errorCode: errorCode,
1691
1409
  });
1692
- throw __decorateServiceException(response, parsedBody);
1410
+ _d.label = 11;
1411
+ case 11: return [2];
1693
1412
  }
1694
1413
  });
1695
1414
  }); };
@@ -1701,24 +1420,23 @@ export var deserializeAws_restJson1GetAssistantCommand = function (output, conte
1701
1420
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1702
1421
  return [2, deserializeAws_restJson1GetAssistantCommandError(output, context)];
1703
1422
  }
1704
- contents = {
1423
+ contents = map({
1705
1424
  $metadata: deserializeMetadata(output),
1706
- assistant: undefined,
1707
- };
1425
+ });
1708
1426
  _a = __expectNonNull;
1709
1427
  _b = __expectObject;
1710
1428
  return [4, parseBody(output.body, context)];
1711
1429
  case 1:
1712
1430
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1713
- if (data.assistant !== undefined && data.assistant !== null) {
1431
+ if (data.assistant != null) {
1714
1432
  contents.assistant = deserializeAws_restJson1AssistantData(data.assistant, context);
1715
1433
  }
1716
- return [2, Promise.resolve(contents)];
1434
+ return [2, contents];
1717
1435
  }
1718
1436
  });
1719
1437
  }); };
1720
1438
  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;
1439
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1722
1440
  var _c;
1723
1441
  return __generator(this, function (_d) {
1724
1442
  switch (_d.label) {
@@ -1747,14 +1465,14 @@ var deserializeAws_restJson1GetAssistantCommandError = function (output, context
1747
1465
  case 7: throw _d.sent();
1748
1466
  case 8:
1749
1467
  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,
1468
+ throwDefaultError({
1469
+ output: output,
1470
+ parsedBody: parsedBody,
1471
+ exceptionCtor: __BaseException,
1472
+ errorCode: errorCode,
1756
1473
  });
1757
- throw __decorateServiceException(response, parsedBody);
1474
+ _d.label = 9;
1475
+ case 9: return [2];
1758
1476
  }
1759
1477
  });
1760
1478
  }); };
@@ -1766,24 +1484,23 @@ export var deserializeAws_restJson1GetAssistantAssociationCommand = function (ou
1766
1484
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1767
1485
  return [2, deserializeAws_restJson1GetAssistantAssociationCommandError(output, context)];
1768
1486
  }
1769
- contents = {
1487
+ contents = map({
1770
1488
  $metadata: deserializeMetadata(output),
1771
- assistantAssociation: undefined,
1772
- };
1489
+ });
1773
1490
  _a = __expectNonNull;
1774
1491
  _b = __expectObject;
1775
1492
  return [4, parseBody(output.body, context)];
1776
1493
  case 1:
1777
1494
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1778
- if (data.assistantAssociation !== undefined && data.assistantAssociation !== null) {
1495
+ if (data.assistantAssociation != null) {
1779
1496
  contents.assistantAssociation = deserializeAws_restJson1AssistantAssociationData(data.assistantAssociation, context);
1780
1497
  }
1781
- return [2, Promise.resolve(contents)];
1498
+ return [2, contents];
1782
1499
  }
1783
1500
  });
1784
1501
  }); };
1785
1502
  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;
1503
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1787
1504
  var _c;
1788
1505
  return __generator(this, function (_d) {
1789
1506
  switch (_d.label) {
@@ -1812,14 +1529,14 @@ var deserializeAws_restJson1GetAssistantAssociationCommandError = function (outp
1812
1529
  case 7: throw _d.sent();
1813
1530
  case 8:
1814
1531
  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,
1532
+ throwDefaultError({
1533
+ output: output,
1534
+ parsedBody: parsedBody,
1535
+ exceptionCtor: __BaseException,
1536
+ errorCode: errorCode,
1821
1537
  });
1822
- throw __decorateServiceException(response, parsedBody);
1538
+ _d.label = 9;
1539
+ case 9: return [2];
1823
1540
  }
1824
1541
  });
1825
1542
  }); };
@@ -1831,24 +1548,23 @@ export var deserializeAws_restJson1GetContentCommand = function (output, context
1831
1548
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1832
1549
  return [2, deserializeAws_restJson1GetContentCommandError(output, context)];
1833
1550
  }
1834
- contents = {
1551
+ contents = map({
1835
1552
  $metadata: deserializeMetadata(output),
1836
- content: undefined,
1837
- };
1553
+ });
1838
1554
  _a = __expectNonNull;
1839
1555
  _b = __expectObject;
1840
1556
  return [4, parseBody(output.body, context)];
1841
1557
  case 1:
1842
1558
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1843
- if (data.content !== undefined && data.content !== null) {
1559
+ if (data.content != null) {
1844
1560
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
1845
1561
  }
1846
- return [2, Promise.resolve(contents)];
1562
+ return [2, contents];
1847
1563
  }
1848
1564
  });
1849
1565
  }); };
1850
1566
  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;
1567
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1852
1568
  var _c;
1853
1569
  return __generator(this, function (_d) {
1854
1570
  switch (_d.label) {
@@ -1877,14 +1593,14 @@ var deserializeAws_restJson1GetContentCommandError = function (output, context)
1877
1593
  case 7: throw _d.sent();
1878
1594
  case 8:
1879
1595
  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,
1596
+ throwDefaultError({
1597
+ output: output,
1598
+ parsedBody: parsedBody,
1599
+ exceptionCtor: __BaseException,
1600
+ errorCode: errorCode,
1886
1601
  });
1887
- throw __decorateServiceException(response, parsedBody);
1602
+ _d.label = 9;
1603
+ case 9: return [2];
1888
1604
  }
1889
1605
  });
1890
1606
  }); };
@@ -1896,24 +1612,23 @@ export var deserializeAws_restJson1GetContentSummaryCommand = function (output,
1896
1612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1897
1613
  return [2, deserializeAws_restJson1GetContentSummaryCommandError(output, context)];
1898
1614
  }
1899
- contents = {
1615
+ contents = map({
1900
1616
  $metadata: deserializeMetadata(output),
1901
- contentSummary: undefined,
1902
- };
1617
+ });
1903
1618
  _a = __expectNonNull;
1904
1619
  _b = __expectObject;
1905
1620
  return [4, parseBody(output.body, context)];
1906
1621
  case 1:
1907
1622
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1908
- if (data.contentSummary !== undefined && data.contentSummary !== null) {
1623
+ if (data.contentSummary != null) {
1909
1624
  contents.contentSummary = deserializeAws_restJson1ContentSummary(data.contentSummary, context);
1910
1625
  }
1911
- return [2, Promise.resolve(contents)];
1626
+ return [2, contents];
1912
1627
  }
1913
1628
  });
1914
1629
  }); };
1915
1630
  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;
1631
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1917
1632
  var _c;
1918
1633
  return __generator(this, function (_d) {
1919
1634
  switch (_d.label) {
@@ -1942,14 +1657,14 @@ var deserializeAws_restJson1GetContentSummaryCommandError = function (output, co
1942
1657
  case 7: throw _d.sent();
1943
1658
  case 8:
1944
1659
  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,
1660
+ throwDefaultError({
1661
+ output: output,
1662
+ parsedBody: parsedBody,
1663
+ exceptionCtor: __BaseException,
1664
+ errorCode: errorCode,
1951
1665
  });
1952
- throw __decorateServiceException(response, parsedBody);
1666
+ _d.label = 9;
1667
+ case 9: return [2];
1953
1668
  }
1954
1669
  });
1955
1670
  }); };
@@ -1961,24 +1676,23 @@ export var deserializeAws_restJson1GetKnowledgeBaseCommand = function (output, c
1961
1676
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1962
1677
  return [2, deserializeAws_restJson1GetKnowledgeBaseCommandError(output, context)];
1963
1678
  }
1964
- contents = {
1679
+ contents = map({
1965
1680
  $metadata: deserializeMetadata(output),
1966
- knowledgeBase: undefined,
1967
- };
1681
+ });
1968
1682
  _a = __expectNonNull;
1969
1683
  _b = __expectObject;
1970
1684
  return [4, parseBody(output.body, context)];
1971
1685
  case 1:
1972
1686
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1973
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
1687
+ if (data.knowledgeBase != null) {
1974
1688
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
1975
1689
  }
1976
- return [2, Promise.resolve(contents)];
1690
+ return [2, contents];
1977
1691
  }
1978
1692
  });
1979
1693
  }); };
1980
1694
  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;
1695
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1982
1696
  var _c;
1983
1697
  return __generator(this, function (_d) {
1984
1698
  switch (_d.label) {
@@ -2007,14 +1721,14 @@ var deserializeAws_restJson1GetKnowledgeBaseCommandError = function (output, con
2007
1721
  case 7: throw _d.sent();
2008
1722
  case 8:
2009
1723
  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,
1724
+ throwDefaultError({
1725
+ output: output,
1726
+ parsedBody: parsedBody,
1727
+ exceptionCtor: __BaseException,
1728
+ errorCode: errorCode,
2016
1729
  });
2017
- throw __decorateServiceException(response, parsedBody);
1730
+ _d.label = 9;
1731
+ case 9: return [2];
2018
1732
  }
2019
1733
  });
2020
1734
  }); };
@@ -2026,28 +1740,26 @@ export var deserializeAws_restJson1GetRecommendationsCommand = function (output,
2026
1740
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2027
1741
  return [2, deserializeAws_restJson1GetRecommendationsCommandError(output, context)];
2028
1742
  }
2029
- contents = {
1743
+ contents = map({
2030
1744
  $metadata: deserializeMetadata(output),
2031
- recommendations: undefined,
2032
- triggers: undefined,
2033
- };
1745
+ });
2034
1746
  _a = __expectNonNull;
2035
1747
  _b = __expectObject;
2036
1748
  return [4, parseBody(output.body, context)];
2037
1749
  case 1:
2038
1750
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2039
- if (data.recommendations !== undefined && data.recommendations !== null) {
1751
+ if (data.recommendations != null) {
2040
1752
  contents.recommendations = deserializeAws_restJson1RecommendationList(data.recommendations, context);
2041
1753
  }
2042
- if (data.triggers !== undefined && data.triggers !== null) {
1754
+ if (data.triggers != null) {
2043
1755
  contents.triggers = deserializeAws_restJson1RecommendationTriggerList(data.triggers, context);
2044
1756
  }
2045
- return [2, Promise.resolve(contents)];
1757
+ return [2, contents];
2046
1758
  }
2047
1759
  });
2048
1760
  }); };
2049
1761
  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;
1762
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2051
1763
  var _c;
2052
1764
  return __generator(this, function (_d) {
2053
1765
  switch (_d.label) {
@@ -2076,14 +1788,14 @@ var deserializeAws_restJson1GetRecommendationsCommandError = function (output, c
2076
1788
  case 7: throw _d.sent();
2077
1789
  case 8:
2078
1790
  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,
1791
+ throwDefaultError({
1792
+ output: output,
1793
+ parsedBody: parsedBody,
1794
+ exceptionCtor: __BaseException,
1795
+ errorCode: errorCode,
2085
1796
  });
2086
- throw __decorateServiceException(response, parsedBody);
1797
+ _d.label = 9;
1798
+ case 9: return [2];
2087
1799
  }
2088
1800
  });
2089
1801
  }); };
@@ -2095,24 +1807,23 @@ export var deserializeAws_restJson1GetSessionCommand = function (output, context
2095
1807
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2096
1808
  return [2, deserializeAws_restJson1GetSessionCommandError(output, context)];
2097
1809
  }
2098
- contents = {
1810
+ contents = map({
2099
1811
  $metadata: deserializeMetadata(output),
2100
- session: undefined,
2101
- };
1812
+ });
2102
1813
  _a = __expectNonNull;
2103
1814
  _b = __expectObject;
2104
1815
  return [4, parseBody(output.body, context)];
2105
1816
  case 1:
2106
1817
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2107
- if (data.session !== undefined && data.session !== null) {
1818
+ if (data.session != null) {
2108
1819
  contents.session = deserializeAws_restJson1SessionData(data.session, context);
2109
1820
  }
2110
- return [2, Promise.resolve(contents)];
1821
+ return [2, contents];
2111
1822
  }
2112
1823
  });
2113
1824
  }); };
2114
1825
  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;
1826
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2116
1827
  var _c;
2117
1828
  return __generator(this, function (_d) {
2118
1829
  switch (_d.label) {
@@ -2141,14 +1852,14 @@ var deserializeAws_restJson1GetSessionCommandError = function (output, context)
2141
1852
  case 7: throw _d.sent();
2142
1853
  case 8:
2143
1854
  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,
1855
+ throwDefaultError({
1856
+ output: output,
1857
+ parsedBody: parsedBody,
1858
+ exceptionCtor: __BaseException,
1859
+ errorCode: errorCode,
2150
1860
  });
2151
- throw __decorateServiceException(response, parsedBody);
1861
+ _d.label = 9;
1862
+ case 9: return [2];
2152
1863
  }
2153
1864
  });
2154
1865
  }); };
@@ -2160,28 +1871,26 @@ export var deserializeAws_restJson1ListAssistantAssociationsCommand = function (
2160
1871
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2161
1872
  return [2, deserializeAws_restJson1ListAssistantAssociationsCommandError(output, context)];
2162
1873
  }
2163
- contents = {
1874
+ contents = map({
2164
1875
  $metadata: deserializeMetadata(output),
2165
- assistantAssociationSummaries: undefined,
2166
- nextToken: undefined,
2167
- };
1876
+ });
2168
1877
  _a = __expectNonNull;
2169
1878
  _b = __expectObject;
2170
1879
  return [4, parseBody(output.body, context)];
2171
1880
  case 1:
2172
1881
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2173
- if (data.assistantAssociationSummaries !== undefined && data.assistantAssociationSummaries !== null) {
1882
+ if (data.assistantAssociationSummaries != null) {
2174
1883
  contents.assistantAssociationSummaries = deserializeAws_restJson1AssistantAssociationSummaryList(data.assistantAssociationSummaries, context);
2175
1884
  }
2176
- if (data.nextToken !== undefined && data.nextToken !== null) {
1885
+ if (data.nextToken != null) {
2177
1886
  contents.nextToken = __expectString(data.nextToken);
2178
1887
  }
2179
- return [2, Promise.resolve(contents)];
1888
+ return [2, contents];
2180
1889
  }
2181
1890
  });
2182
1891
  }); };
2183
1892
  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;
1893
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2185
1894
  var _c;
2186
1895
  return __generator(this, function (_d) {
2187
1896
  switch (_d.label) {
@@ -2210,14 +1919,14 @@ var deserializeAws_restJson1ListAssistantAssociationsCommandError = function (ou
2210
1919
  case 7: throw _d.sent();
2211
1920
  case 8:
2212
1921
  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,
1922
+ throwDefaultError({
1923
+ output: output,
1924
+ parsedBody: parsedBody,
1925
+ exceptionCtor: __BaseException,
1926
+ errorCode: errorCode,
2219
1927
  });
2220
- throw __decorateServiceException(response, parsedBody);
1928
+ _d.label = 9;
1929
+ case 9: return [2];
2221
1930
  }
2222
1931
  });
2223
1932
  }); };
@@ -2229,28 +1938,26 @@ export var deserializeAws_restJson1ListAssistantsCommand = function (output, con
2229
1938
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2230
1939
  return [2, deserializeAws_restJson1ListAssistantsCommandError(output, context)];
2231
1940
  }
2232
- contents = {
1941
+ contents = map({
2233
1942
  $metadata: deserializeMetadata(output),
2234
- assistantSummaries: undefined,
2235
- nextToken: undefined,
2236
- };
1943
+ });
2237
1944
  _a = __expectNonNull;
2238
1945
  _b = __expectObject;
2239
1946
  return [4, parseBody(output.body, context)];
2240
1947
  case 1:
2241
1948
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2242
- if (data.assistantSummaries !== undefined && data.assistantSummaries !== null) {
1949
+ if (data.assistantSummaries != null) {
2243
1950
  contents.assistantSummaries = deserializeAws_restJson1AssistantList(data.assistantSummaries, context);
2244
1951
  }
2245
- if (data.nextToken !== undefined && data.nextToken !== null) {
1952
+ if (data.nextToken != null) {
2246
1953
  contents.nextToken = __expectString(data.nextToken);
2247
1954
  }
2248
- return [2, Promise.resolve(contents)];
1955
+ return [2, contents];
2249
1956
  }
2250
1957
  });
2251
1958
  }); };
2252
1959
  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;
1960
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2254
1961
  var _c;
2255
1962
  return __generator(this, function (_d) {
2256
1963
  switch (_d.label) {
@@ -2275,14 +1982,14 @@ var deserializeAws_restJson1ListAssistantsCommandError = function (output, conte
2275
1982
  case 5: throw _d.sent();
2276
1983
  case 6:
2277
1984
  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,
1985
+ throwDefaultError({
1986
+ output: output,
1987
+ parsedBody: parsedBody,
1988
+ exceptionCtor: __BaseException,
1989
+ errorCode: errorCode,
2284
1990
  });
2285
- throw __decorateServiceException(response, parsedBody);
1991
+ _d.label = 7;
1992
+ case 7: return [2];
2286
1993
  }
2287
1994
  });
2288
1995
  }); };
@@ -2294,28 +2001,26 @@ export var deserializeAws_restJson1ListContentsCommand = function (output, conte
2294
2001
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2295
2002
  return [2, deserializeAws_restJson1ListContentsCommandError(output, context)];
2296
2003
  }
2297
- contents = {
2004
+ contents = map({
2298
2005
  $metadata: deserializeMetadata(output),
2299
- contentSummaries: undefined,
2300
- nextToken: undefined,
2301
- };
2006
+ });
2302
2007
  _a = __expectNonNull;
2303
2008
  _b = __expectObject;
2304
2009
  return [4, parseBody(output.body, context)];
2305
2010
  case 1:
2306
2011
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2307
- if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
2012
+ if (data.contentSummaries != null) {
2308
2013
  contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
2309
2014
  }
2310
- if (data.nextToken !== undefined && data.nextToken !== null) {
2015
+ if (data.nextToken != null) {
2311
2016
  contents.nextToken = __expectString(data.nextToken);
2312
2017
  }
2313
- return [2, Promise.resolve(contents)];
2018
+ return [2, contents];
2314
2019
  }
2315
2020
  });
2316
2021
  }); };
2317
2022
  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;
2023
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2319
2024
  var _c;
2320
2025
  return __generator(this, function (_d) {
2321
2026
  switch (_d.label) {
@@ -2344,14 +2049,14 @@ var deserializeAws_restJson1ListContentsCommandError = function (output, context
2344
2049
  case 7: throw _d.sent();
2345
2050
  case 8:
2346
2051
  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,
2052
+ throwDefaultError({
2053
+ output: output,
2054
+ parsedBody: parsedBody,
2055
+ exceptionCtor: __BaseException,
2056
+ errorCode: errorCode,
2353
2057
  });
2354
- throw __decorateServiceException(response, parsedBody);
2058
+ _d.label = 9;
2059
+ case 9: return [2];
2355
2060
  }
2356
2061
  });
2357
2062
  }); };
@@ -2363,28 +2068,26 @@ export var deserializeAws_restJson1ListKnowledgeBasesCommand = function (output,
2363
2068
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2364
2069
  return [2, deserializeAws_restJson1ListKnowledgeBasesCommandError(output, context)];
2365
2070
  }
2366
- contents = {
2071
+ contents = map({
2367
2072
  $metadata: deserializeMetadata(output),
2368
- knowledgeBaseSummaries: undefined,
2369
- nextToken: undefined,
2370
- };
2073
+ });
2371
2074
  _a = __expectNonNull;
2372
2075
  _b = __expectObject;
2373
2076
  return [4, parseBody(output.body, context)];
2374
2077
  case 1:
2375
2078
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2376
- if (data.knowledgeBaseSummaries !== undefined && data.knowledgeBaseSummaries !== null) {
2079
+ if (data.knowledgeBaseSummaries != null) {
2377
2080
  contents.knowledgeBaseSummaries = deserializeAws_restJson1KnowledgeBaseList(data.knowledgeBaseSummaries, context);
2378
2081
  }
2379
- if (data.nextToken !== undefined && data.nextToken !== null) {
2082
+ if (data.nextToken != null) {
2380
2083
  contents.nextToken = __expectString(data.nextToken);
2381
2084
  }
2382
- return [2, Promise.resolve(contents)];
2085
+ return [2, contents];
2383
2086
  }
2384
2087
  });
2385
2088
  }); };
2386
2089
  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;
2090
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2388
2091
  var _c;
2389
2092
  return __generator(this, function (_d) {
2390
2093
  switch (_d.label) {
@@ -2409,14 +2112,14 @@ var deserializeAws_restJson1ListKnowledgeBasesCommandError = function (output, c
2409
2112
  case 5: throw _d.sent();
2410
2113
  case 6:
2411
2114
  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,
2115
+ throwDefaultError({
2116
+ output: output,
2117
+ parsedBody: parsedBody,
2118
+ exceptionCtor: __BaseException,
2119
+ errorCode: errorCode,
2418
2120
  });
2419
- throw __decorateServiceException(response, parsedBody);
2121
+ _d.label = 7;
2122
+ case 7: return [2];
2420
2123
  }
2421
2124
  });
2422
2125
  }); };
@@ -2428,24 +2131,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2428
2131
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2429
2132
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2430
2133
  }
2431
- contents = {
2134
+ contents = map({
2432
2135
  $metadata: deserializeMetadata(output),
2433
- tags: undefined,
2434
- };
2136
+ });
2435
2137
  _a = __expectNonNull;
2436
2138
  _b = __expectObject;
2437
2139
  return [4, parseBody(output.body, context)];
2438
2140
  case 1:
2439
2141
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2440
- if (data.tags !== undefined && data.tags !== null) {
2142
+ if (data.tags != null) {
2441
2143
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
2442
2144
  }
2443
- return [2, Promise.resolve(contents)];
2145
+ return [2, contents];
2444
2146
  }
2445
2147
  });
2446
2148
  }); };
2447
2149
  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;
2150
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2449
2151
  var _c;
2450
2152
  return __generator(this, function (_d) {
2451
2153
  switch (_d.label) {
@@ -2466,14 +2168,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2466
2168
  case 3: throw _d.sent();
2467
2169
  case 4:
2468
2170
  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,
2171
+ throwDefaultError({
2172
+ output: output,
2173
+ parsedBody: parsedBody,
2174
+ exceptionCtor: __BaseException,
2175
+ errorCode: errorCode,
2475
2176
  });
2476
- throw __decorateServiceException(response, parsedBody);
2177
+ _d.label = 5;
2178
+ case 5: return [2];
2477
2179
  }
2478
2180
  });
2479
2181
  }); };
@@ -2485,28 +2187,26 @@ export var deserializeAws_restJson1NotifyRecommendationsReceivedCommand = functi
2485
2187
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2486
2188
  return [2, deserializeAws_restJson1NotifyRecommendationsReceivedCommandError(output, context)];
2487
2189
  }
2488
- contents = {
2190
+ contents = map({
2489
2191
  $metadata: deserializeMetadata(output),
2490
- errors: undefined,
2491
- recommendationIds: undefined,
2492
- };
2192
+ });
2493
2193
  _a = __expectNonNull;
2494
2194
  _b = __expectObject;
2495
2195
  return [4, parseBody(output.body, context)];
2496
2196
  case 1:
2497
2197
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2498
- if (data.errors !== undefined && data.errors !== null) {
2198
+ if (data.errors != null) {
2499
2199
  contents.errors = deserializeAws_restJson1NotifyRecommendationsReceivedErrorList(data.errors, context);
2500
2200
  }
2501
- if (data.recommendationIds !== undefined && data.recommendationIds !== null) {
2201
+ if (data.recommendationIds != null) {
2502
2202
  contents.recommendationIds = deserializeAws_restJson1RecommendationIdList(data.recommendationIds, context);
2503
2203
  }
2504
- return [2, Promise.resolve(contents)];
2204
+ return [2, contents];
2505
2205
  }
2506
2206
  });
2507
2207
  }); };
2508
2208
  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;
2209
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2510
2210
  var _c;
2511
2211
  return __generator(this, function (_d) {
2512
2212
  switch (_d.label) {
@@ -2535,14 +2235,90 @@ var deserializeAws_restJson1NotifyRecommendationsReceivedCommandError = function
2535
2235
  case 7: throw _d.sent();
2536
2236
  case 8:
2537
2237
  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,
2238
+ throwDefaultError({
2239
+ output: output,
2240
+ parsedBody: parsedBody,
2241
+ exceptionCtor: __BaseException,
2242
+ errorCode: errorCode,
2544
2243
  });
2545
- throw __decorateServiceException(response, parsedBody);
2244
+ _d.label = 9;
2245
+ case 9: return [2];
2246
+ }
2247
+ });
2248
+ }); };
2249
+ export var deserializeAws_restJson1PutFeedbackCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2250
+ var contents, data, _a, _b;
2251
+ return __generator(this, function (_c) {
2252
+ switch (_c.label) {
2253
+ case 0:
2254
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2255
+ return [2, deserializeAws_restJson1PutFeedbackCommandError(output, context)];
2256
+ }
2257
+ contents = map({
2258
+ $metadata: deserializeMetadata(output),
2259
+ });
2260
+ _a = __expectNonNull;
2261
+ _b = __expectObject;
2262
+ return [4, parseBody(output.body, context)];
2263
+ case 1:
2264
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2265
+ if (data.assistantArn != null) {
2266
+ contents.assistantArn = __expectString(data.assistantArn);
2267
+ }
2268
+ if (data.assistantId != null) {
2269
+ contents.assistantId = __expectString(data.assistantId);
2270
+ }
2271
+ if (data.feedback != null) {
2272
+ contents.feedback = deserializeAws_restJson1FeedbackData(data.feedback, context);
2273
+ }
2274
+ if (data.targetId != null) {
2275
+ contents.targetId = __expectString(data.targetId);
2276
+ }
2277
+ if (data.targetType != null) {
2278
+ contents.targetType = __expectString(data.targetType);
2279
+ }
2280
+ return [2, contents];
2281
+ }
2282
+ });
2283
+ }); };
2284
+ var deserializeAws_restJson1PutFeedbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2285
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2286
+ var _c;
2287
+ return __generator(this, function (_d) {
2288
+ switch (_d.label) {
2289
+ case 0:
2290
+ _a = [__assign({}, output)];
2291
+ _c = {};
2292
+ return [4, parseBody(output.body, context)];
2293
+ case 1:
2294
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2295
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2296
+ _b = errorCode;
2297
+ switch (_b) {
2298
+ case "AccessDeniedException": return [3, 2];
2299
+ case "com.amazonaws.wisdom#AccessDeniedException": return [3, 2];
2300
+ case "ResourceNotFoundException": return [3, 4];
2301
+ case "com.amazonaws.wisdom#ResourceNotFoundException": return [3, 4];
2302
+ case "ValidationException": return [3, 6];
2303
+ case "com.amazonaws.wisdom#ValidationException": return [3, 6];
2304
+ }
2305
+ return [3, 8];
2306
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2307
+ case 3: throw _d.sent();
2308
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2309
+ case 5: throw _d.sent();
2310
+ case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2311
+ case 7: throw _d.sent();
2312
+ case 8:
2313
+ parsedBody = parsedOutput.body;
2314
+ throwDefaultError({
2315
+ output: output,
2316
+ parsedBody: parsedBody,
2317
+ exceptionCtor: __BaseException,
2318
+ errorCode: errorCode,
2319
+ });
2320
+ _d.label = 9;
2321
+ case 9: return [2];
2546
2322
  }
2547
2323
  });
2548
2324
  }); };
@@ -2554,28 +2330,26 @@ export var deserializeAws_restJson1QueryAssistantCommand = function (output, con
2554
2330
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2555
2331
  return [2, deserializeAws_restJson1QueryAssistantCommandError(output, context)];
2556
2332
  }
2557
- contents = {
2333
+ contents = map({
2558
2334
  $metadata: deserializeMetadata(output),
2559
- nextToken: undefined,
2560
- results: undefined,
2561
- };
2335
+ });
2562
2336
  _a = __expectNonNull;
2563
2337
  _b = __expectObject;
2564
2338
  return [4, parseBody(output.body, context)];
2565
2339
  case 1:
2566
2340
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2567
- if (data.nextToken !== undefined && data.nextToken !== null) {
2341
+ if (data.nextToken != null) {
2568
2342
  contents.nextToken = __expectString(data.nextToken);
2569
2343
  }
2570
- if (data.results !== undefined && data.results !== null) {
2344
+ if (data.results != null) {
2571
2345
  contents.results = deserializeAws_restJson1QueryResultsList(data.results, context);
2572
2346
  }
2573
- return [2, Promise.resolve(contents)];
2347
+ return [2, contents];
2574
2348
  }
2575
2349
  });
2576
2350
  }); };
2577
2351
  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;
2352
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2579
2353
  var _c;
2580
2354
  return __generator(this, function (_d) {
2581
2355
  switch (_d.label) {
@@ -2604,14 +2378,14 @@ var deserializeAws_restJson1QueryAssistantCommandError = function (output, conte
2604
2378
  case 7: throw _d.sent();
2605
2379
  case 8:
2606
2380
  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,
2381
+ throwDefaultError({
2382
+ output: output,
2383
+ parsedBody: parsedBody,
2384
+ exceptionCtor: __BaseException,
2385
+ errorCode: errorCode,
2613
2386
  });
2614
- throw __decorateServiceException(response, parsedBody);
2387
+ _d.label = 9;
2388
+ case 9: return [2];
2615
2389
  }
2616
2390
  });
2617
2391
  }); };
@@ -2623,18 +2397,18 @@ export var deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand = funct
2623
2397
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2624
2398
  return [2, deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError(output, context)];
2625
2399
  }
2626
- contents = {
2400
+ contents = map({
2627
2401
  $metadata: deserializeMetadata(output),
2628
- };
2402
+ });
2629
2403
  return [4, collectBody(output.body, context)];
2630
2404
  case 1:
2631
2405
  _a.sent();
2632
- return [2, Promise.resolve(contents)];
2406
+ return [2, contents];
2633
2407
  }
2634
2408
  });
2635
2409
  }); };
2636
2410
  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;
2411
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2638
2412
  var _c;
2639
2413
  return __generator(this, function (_d) {
2640
2414
  switch (_d.label) {
@@ -2663,14 +2437,14 @@ var deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError = functio
2663
2437
  case 7: throw _d.sent();
2664
2438
  case 8:
2665
2439
  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,
2440
+ throwDefaultError({
2441
+ output: output,
2442
+ parsedBody: parsedBody,
2443
+ exceptionCtor: __BaseException,
2444
+ errorCode: errorCode,
2672
2445
  });
2673
- throw __decorateServiceException(response, parsedBody);
2446
+ _d.label = 9;
2447
+ case 9: return [2];
2674
2448
  }
2675
2449
  });
2676
2450
  }); };
@@ -2682,28 +2456,26 @@ export var deserializeAws_restJson1SearchContentCommand = function (output, cont
2682
2456
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2683
2457
  return [2, deserializeAws_restJson1SearchContentCommandError(output, context)];
2684
2458
  }
2685
- contents = {
2459
+ contents = map({
2686
2460
  $metadata: deserializeMetadata(output),
2687
- contentSummaries: undefined,
2688
- nextToken: undefined,
2689
- };
2461
+ });
2690
2462
  _a = __expectNonNull;
2691
2463
  _b = __expectObject;
2692
2464
  return [4, parseBody(output.body, context)];
2693
2465
  case 1:
2694
2466
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2695
- if (data.contentSummaries !== undefined && data.contentSummaries !== null) {
2467
+ if (data.contentSummaries != null) {
2696
2468
  contents.contentSummaries = deserializeAws_restJson1ContentSummaryList(data.contentSummaries, context);
2697
2469
  }
2698
- if (data.nextToken !== undefined && data.nextToken !== null) {
2470
+ if (data.nextToken != null) {
2699
2471
  contents.nextToken = __expectString(data.nextToken);
2700
2472
  }
2701
- return [2, Promise.resolve(contents)];
2473
+ return [2, contents];
2702
2474
  }
2703
2475
  });
2704
2476
  }); };
2705
2477
  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;
2478
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2707
2479
  var _c;
2708
2480
  return __generator(this, function (_d) {
2709
2481
  switch (_d.label) {
@@ -2732,14 +2504,14 @@ var deserializeAws_restJson1SearchContentCommandError = function (output, contex
2732
2504
  case 7: throw _d.sent();
2733
2505
  case 8:
2734
2506
  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,
2507
+ throwDefaultError({
2508
+ output: output,
2509
+ parsedBody: parsedBody,
2510
+ exceptionCtor: __BaseException,
2511
+ errorCode: errorCode,
2741
2512
  });
2742
- throw __decorateServiceException(response, parsedBody);
2513
+ _d.label = 9;
2514
+ case 9: return [2];
2743
2515
  }
2744
2516
  });
2745
2517
  }); };
@@ -2751,28 +2523,26 @@ export var deserializeAws_restJson1SearchSessionsCommand = function (output, con
2751
2523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2752
2524
  return [2, deserializeAws_restJson1SearchSessionsCommandError(output, context)];
2753
2525
  }
2754
- contents = {
2526
+ contents = map({
2755
2527
  $metadata: deserializeMetadata(output),
2756
- nextToken: undefined,
2757
- sessionSummaries: undefined,
2758
- };
2528
+ });
2759
2529
  _a = __expectNonNull;
2760
2530
  _b = __expectObject;
2761
2531
  return [4, parseBody(output.body, context)];
2762
2532
  case 1:
2763
2533
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2764
- if (data.nextToken !== undefined && data.nextToken !== null) {
2534
+ if (data.nextToken != null) {
2765
2535
  contents.nextToken = __expectString(data.nextToken);
2766
2536
  }
2767
- if (data.sessionSummaries !== undefined && data.sessionSummaries !== null) {
2537
+ if (data.sessionSummaries != null) {
2768
2538
  contents.sessionSummaries = deserializeAws_restJson1SessionSummaries(data.sessionSummaries, context);
2769
2539
  }
2770
- return [2, Promise.resolve(contents)];
2540
+ return [2, contents];
2771
2541
  }
2772
2542
  });
2773
2543
  }); };
2774
2544
  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;
2545
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2776
2546
  var _c;
2777
2547
  return __generator(this, function (_d) {
2778
2548
  switch (_d.label) {
@@ -2801,14 +2571,14 @@ var deserializeAws_restJson1SearchSessionsCommandError = function (output, conte
2801
2571
  case 7: throw _d.sent();
2802
2572
  case 8:
2803
2573
  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,
2574
+ throwDefaultError({
2575
+ output: output,
2576
+ parsedBody: parsedBody,
2577
+ exceptionCtor: __BaseException,
2578
+ errorCode: errorCode,
2810
2579
  });
2811
- throw __decorateServiceException(response, parsedBody);
2580
+ _d.label = 9;
2581
+ case 9: return [2];
2812
2582
  }
2813
2583
  });
2814
2584
  }); };
@@ -2820,36 +2590,32 @@ export var deserializeAws_restJson1StartContentUploadCommand = function (output,
2820
2590
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2821
2591
  return [2, deserializeAws_restJson1StartContentUploadCommandError(output, context)];
2822
2592
  }
2823
- contents = {
2593
+ contents = map({
2824
2594
  $metadata: deserializeMetadata(output),
2825
- headersToInclude: undefined,
2826
- uploadId: undefined,
2827
- url: undefined,
2828
- urlExpiry: undefined,
2829
- };
2595
+ });
2830
2596
  _a = __expectNonNull;
2831
2597
  _b = __expectObject;
2832
2598
  return [4, parseBody(output.body, context)];
2833
2599
  case 1:
2834
2600
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2835
- if (data.headersToInclude !== undefined && data.headersToInclude !== null) {
2601
+ if (data.headersToInclude != null) {
2836
2602
  contents.headersToInclude = deserializeAws_restJson1Headers(data.headersToInclude, context);
2837
2603
  }
2838
- if (data.uploadId !== undefined && data.uploadId !== null) {
2604
+ if (data.uploadId != null) {
2839
2605
  contents.uploadId = __expectString(data.uploadId);
2840
2606
  }
2841
- if (data.url !== undefined && data.url !== null) {
2607
+ if (data.url != null) {
2842
2608
  contents.url = __expectString(data.url);
2843
2609
  }
2844
- if (data.urlExpiry !== undefined && data.urlExpiry !== null) {
2610
+ if (data.urlExpiry != null) {
2845
2611
  contents.urlExpiry = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.urlExpiry)));
2846
2612
  }
2847
- return [2, Promise.resolve(contents)];
2613
+ return [2, contents];
2848
2614
  }
2849
2615
  });
2850
2616
  }); };
2851
2617
  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;
2618
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2853
2619
  var _c;
2854
2620
  return __generator(this, function (_d) {
2855
2621
  switch (_d.label) {
@@ -2878,14 +2644,14 @@ var deserializeAws_restJson1StartContentUploadCommandError = function (output, c
2878
2644
  case 7: throw _d.sent();
2879
2645
  case 8:
2880
2646
  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,
2647
+ throwDefaultError({
2648
+ output: output,
2649
+ parsedBody: parsedBody,
2650
+ exceptionCtor: __BaseException,
2651
+ errorCode: errorCode,
2887
2652
  });
2888
- throw __decorateServiceException(response, parsedBody);
2653
+ _d.label = 9;
2654
+ case 9: return [2];
2889
2655
  }
2890
2656
  });
2891
2657
  }); };
@@ -2897,18 +2663,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2897
2663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2898
2664
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2899
2665
  }
2900
- contents = {
2666
+ contents = map({
2901
2667
  $metadata: deserializeMetadata(output),
2902
- };
2668
+ });
2903
2669
  return [4, collectBody(output.body, context)];
2904
2670
  case 1:
2905
2671
  _a.sent();
2906
- return [2, Promise.resolve(contents)];
2672
+ return [2, contents];
2907
2673
  }
2908
2674
  });
2909
2675
  }); };
2910
2676
  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;
2677
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2912
2678
  var _c;
2913
2679
  return __generator(this, function (_d) {
2914
2680
  switch (_d.label) {
@@ -2933,14 +2699,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2933
2699
  case 5: throw _d.sent();
2934
2700
  case 6:
2935
2701
  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,
2702
+ throwDefaultError({
2703
+ output: output,
2704
+ parsedBody: parsedBody,
2705
+ exceptionCtor: __BaseException,
2706
+ errorCode: errorCode,
2942
2707
  });
2943
- throw __decorateServiceException(response, parsedBody);
2708
+ _d.label = 7;
2709
+ case 7: return [2];
2944
2710
  }
2945
2711
  });
2946
2712
  }); };
@@ -2952,18 +2718,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2952
2718
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2953
2719
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2954
2720
  }
2955
- contents = {
2721
+ contents = map({
2956
2722
  $metadata: deserializeMetadata(output),
2957
- };
2723
+ });
2958
2724
  return [4, collectBody(output.body, context)];
2959
2725
  case 1:
2960
2726
  _a.sent();
2961
- return [2, Promise.resolve(contents)];
2727
+ return [2, contents];
2962
2728
  }
2963
2729
  });
2964
2730
  }); };
2965
2731
  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;
2732
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2967
2733
  var _c;
2968
2734
  return __generator(this, function (_d) {
2969
2735
  switch (_d.label) {
@@ -2984,14 +2750,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2984
2750
  case 3: throw _d.sent();
2985
2751
  case 4:
2986
2752
  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,
2753
+ throwDefaultError({
2754
+ output: output,
2755
+ parsedBody: parsedBody,
2756
+ exceptionCtor: __BaseException,
2757
+ errorCode: errorCode,
2993
2758
  });
2994
- throw __decorateServiceException(response, parsedBody);
2759
+ _d.label = 5;
2760
+ case 5: return [2];
2995
2761
  }
2996
2762
  });
2997
2763
  }); };
@@ -3003,24 +2769,23 @@ export var deserializeAws_restJson1UpdateContentCommand = function (output, cont
3003
2769
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3004
2770
  return [2, deserializeAws_restJson1UpdateContentCommandError(output, context)];
3005
2771
  }
3006
- contents = {
2772
+ contents = map({
3007
2773
  $metadata: deserializeMetadata(output),
3008
- content: undefined,
3009
- };
2774
+ });
3010
2775
  _a = __expectNonNull;
3011
2776
  _b = __expectObject;
3012
2777
  return [4, parseBody(output.body, context)];
3013
2778
  case 1:
3014
2779
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3015
- if (data.content !== undefined && data.content !== null) {
2780
+ if (data.content != null) {
3016
2781
  contents.content = deserializeAws_restJson1ContentData(data.content, context);
3017
2782
  }
3018
- return [2, Promise.resolve(contents)];
2783
+ return [2, contents];
3019
2784
  }
3020
2785
  });
3021
2786
  }); };
3022
2787
  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;
2788
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3024
2789
  var _c;
3025
2790
  return __generator(this, function (_d) {
3026
2791
  switch (_d.label) {
@@ -3053,14 +2818,14 @@ var deserializeAws_restJson1UpdateContentCommandError = function (output, contex
3053
2818
  case 9: throw _d.sent();
3054
2819
  case 10:
3055
2820
  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,
2821
+ throwDefaultError({
2822
+ output: output,
2823
+ parsedBody: parsedBody,
2824
+ exceptionCtor: __BaseException,
2825
+ errorCode: errorCode,
3062
2826
  });
3063
- throw __decorateServiceException(response, parsedBody);
2827
+ _d.label = 11;
2828
+ case 11: return [2];
3064
2829
  }
3065
2830
  });
3066
2831
  }); };
@@ -3072,24 +2837,23 @@ export var deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand = funct
3072
2837
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3073
2838
  return [2, deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError(output, context)];
3074
2839
  }
3075
- contents = {
2840
+ contents = map({
3076
2841
  $metadata: deserializeMetadata(output),
3077
- knowledgeBase: undefined,
3078
- };
2842
+ });
3079
2843
  _a = __expectNonNull;
3080
2844
  _b = __expectObject;
3081
2845
  return [4, parseBody(output.body, context)];
3082
2846
  case 1:
3083
2847
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3084
- if (data.knowledgeBase !== undefined && data.knowledgeBase !== null) {
2848
+ if (data.knowledgeBase != null) {
3085
2849
  contents.knowledgeBase = deserializeAws_restJson1KnowledgeBaseData(data.knowledgeBase, context);
3086
2850
  }
3087
- return [2, Promise.resolve(contents)];
2851
+ return [2, contents];
3088
2852
  }
3089
2853
  });
3090
2854
  }); };
3091
2855
  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;
2856
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3093
2857
  var _c;
3094
2858
  return __generator(this, function (_d) {
3095
2859
  switch (_d.label) {
@@ -3118,23 +2882,24 @@ var deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError = functio
3118
2882
  case 7: throw _d.sent();
3119
2883
  case 8:
3120
2884
  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,
2885
+ throwDefaultError({
2886
+ output: output,
2887
+ parsedBody: parsedBody,
2888
+ exceptionCtor: __BaseException,
2889
+ errorCode: errorCode,
3127
2890
  });
3128
- throw __decorateServiceException(response, parsedBody);
2891
+ _d.label = 9;
2892
+ case 9: return [2];
3129
2893
  }
3130
2894
  });
3131
2895
  }); };
2896
+ var map = __map;
3132
2897
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3133
2898
  var contents, data, exception;
3134
2899
  return __generator(this, function (_a) {
3135
- contents = {};
2900
+ contents = map({});
3136
2901
  data = parsedOutput.body;
3137
- if (data.message !== undefined && data.message !== null) {
2902
+ if (data.message != null) {
3138
2903
  contents.message = __expectString(data.message);
3139
2904
  }
3140
2905
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3144,9 +2909,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3144
2909
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3145
2910
  var contents, data, exception;
3146
2911
  return __generator(this, function (_a) {
3147
- contents = {};
2912
+ contents = map({});
3148
2913
  data = parsedOutput.body;
3149
- if (data.message !== undefined && data.message !== null) {
2914
+ if (data.message != null) {
3150
2915
  contents.message = __expectString(data.message);
3151
2916
  }
3152
2917
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3156,9 +2921,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3156
2921
  var deserializeAws_restJson1PreconditionFailedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3157
2922
  var contents, data, exception;
3158
2923
  return __generator(this, function (_a) {
3159
- contents = {};
2924
+ contents = map({});
3160
2925
  data = parsedOutput.body;
3161
- if (data.message !== undefined && data.message !== null) {
2926
+ if (data.message != null) {
3162
2927
  contents.message = __expectString(data.message);
3163
2928
  }
3164
2929
  exception = new PreconditionFailedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3168,12 +2933,12 @@ var deserializeAws_restJson1PreconditionFailedExceptionResponse = function (pars
3168
2933
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3169
2934
  var contents, data, exception;
3170
2935
  return __generator(this, function (_a) {
3171
- contents = {};
2936
+ contents = map({});
3172
2937
  data = parsedOutput.body;
3173
- if (data.message !== undefined && data.message !== null) {
2938
+ if (data.message != null) {
3174
2939
  contents.message = __expectString(data.message);
3175
2940
  }
3176
- if (data.resourceName !== undefined && data.resourceName !== null) {
2941
+ if (data.resourceName != null) {
3177
2942
  contents.resourceName = __expectString(data.resourceName);
3178
2943
  }
3179
2944
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3183,9 +2948,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3183
2948
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3184
2949
  var contents, data, exception;
3185
2950
  return __generator(this, function (_a) {
3186
- contents = {};
2951
+ contents = map({});
3187
2952
  data = parsedOutput.body;
3188
- if (data.message !== undefined && data.message !== null) {
2953
+ if (data.message != null) {
3189
2954
  contents.message = __expectString(data.message);
3190
2955
  }
3191
2956
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3195,12 +2960,12 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
3195
2960
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3196
2961
  var contents, data, exception;
3197
2962
  return __generator(this, function (_a) {
3198
- contents = {};
2963
+ contents = map({});
3199
2964
  data = parsedOutput.body;
3200
- if (data.message !== undefined && data.message !== null) {
2965
+ if (data.message != null) {
3201
2966
  contents.message = __expectString(data.message);
3202
2967
  }
3203
- if (data.resourceName !== undefined && data.resourceName !== null) {
2968
+ if (data.resourceName != null) {
3204
2969
  contents.resourceName = __expectString(data.resourceName);
3205
2970
  }
3206
2971
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3210,9 +2975,9 @@ var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutpu
3210
2975
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3211
2976
  var contents, data, exception;
3212
2977
  return __generator(this, function (_a) {
3213
- contents = {};
2978
+ contents = map({});
3214
2979
  data = parsedOutput.body;
3215
- if (data.message !== undefined && data.message !== null) {
2980
+ if (data.message != null) {
3216
2981
  contents.message = __expectString(data.message);
3217
2982
  }
3218
2983
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3240,6 +3005,9 @@ var serializeAws_restJson1ContentMetadata = function (input, context) {
3240
3005
  return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
3241
3006
  }, {});
3242
3007
  };
3008
+ var serializeAws_restJson1FeedbackData = function (input, context) {
3009
+ return __assign({}, (input.relevance != null && { relevance: input.relevance }));
3010
+ };
3243
3011
  var serializeAws_restJson1Filter = function (input, context) {
3244
3012
  return __assign(__assign(__assign({}, (input.field != null && { field: input.field })), (input.operator != null && { operator: input.operator })), (input.value != null && { value: input.value }));
3245
3013
  };
@@ -3247,9 +3015,6 @@ var serializeAws_restJson1FilterList = function (input, context) {
3247
3015
  return input
3248
3016
  .filter(function (e) { return e != null; })
3249
3017
  .map(function (entry) {
3250
- if (entry === null) {
3251
- return null;
3252
- }
3253
3018
  return serializeAws_restJson1Filter(entry, context);
3254
3019
  });
3255
3020
  };
@@ -3257,9 +3022,6 @@ var serializeAws_restJson1ObjectFieldsList = function (input, context) {
3257
3022
  return input
3258
3023
  .filter(function (e) { return e != null; })
3259
3024
  .map(function (entry) {
3260
- if (entry === null) {
3261
- return null;
3262
- }
3263
3025
  return entry;
3264
3026
  });
3265
3027
  };
@@ -3267,9 +3029,6 @@ var serializeAws_restJson1RecommendationIdList = function (input, context) {
3267
3029
  return input
3268
3030
  .filter(function (e) { return e != null; })
3269
3031
  .map(function (entry) {
3270
- if (entry === null) {
3271
- return null;
3272
- }
3273
3032
  return entry;
3274
3033
  });
3275
3034
  };
@@ -3320,7 +3079,7 @@ var deserializeAws_restJson1AssistantAssociationData = function (output, context
3320
3079
  };
3321
3080
  };
3322
3081
  var deserializeAws_restJson1AssistantAssociationOutputData = function (output, context) {
3323
- if (output.knowledgeBaseAssociation !== undefined && output.knowledgeBaseAssociation !== null) {
3082
+ if (output.knowledgeBaseAssociation != null) {
3324
3083
  return {
3325
3084
  knowledgeBaseAssociation: deserializeAws_restJson1KnowledgeBaseAssociationData(output.knowledgeBaseAssociation, context),
3326
3085
  };
@@ -3467,6 +3226,11 @@ var deserializeAws_restJson1DocumentText = function (output, context) {
3467
3226
  text: __expectString(output.text),
3468
3227
  };
3469
3228
  };
3229
+ var deserializeAws_restJson1FeedbackData = function (output, context) {
3230
+ return {
3231
+ relevance: __expectString(output.relevance),
3232
+ };
3233
+ };
3470
3234
  var deserializeAws_restJson1Headers = function (output, context) {
3471
3235
  return Object.entries(output).reduce(function (acc, _a) {
3472
3236
  var _b;
@@ -3643,7 +3407,7 @@ var deserializeAws_restJson1RecommendationTrigger = function (output, context) {
3643
3407
  };
3644
3408
  };
3645
3409
  var deserializeAws_restJson1RecommendationTriggerData = function (output, context) {
3646
- if (output.query !== undefined && output.query !== null) {
3410
+ if (output.query != null) {
3647
3411
  return {
3648
3412
  query: deserializeAws_restJson1QueryRecommendationTriggerData(output.query, context),
3649
3413
  };
@@ -3707,7 +3471,7 @@ var deserializeAws_restJson1SessionSummary = function (output, context) {
3707
3471
  };
3708
3472
  };
3709
3473
  var deserializeAws_restJson1SourceConfiguration = function (output, context) {
3710
- if (output.appIntegrations !== undefined && output.appIntegrations !== null) {
3474
+ if (output.appIntegrations != null) {
3711
3475
  return {
3712
3476
  appIntegrations: deserializeAws_restJson1AppIntegrationsConfiguration(output.appIntegrations, context),
3713
3477
  };