@aws-sdk/client-service-catalog-appregistry 3.141.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
6
6
  import { ServiceCatalogAppRegistryServiceException as __BaseException } from "../models/ServiceCatalogAppRegistryServiceException";
7
7
  export var serializeAws_restJson1AssociateAttributeGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
9
  return __generator(this, function (_c) {
10
10
  switch (_c.label) {
11
11
  case 0: return [4, context.endpoint()];
@@ -14,26 +14,8 @@ export var serializeAws_restJson1AssociateAttributeGroupCommand = function (inpu
14
14
  headers = {};
15
15
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
16
16
  "/applications/{application}/attribute-groups/{attributeGroup}";
17
- if (input.application !== undefined) {
18
- labelValue = input.application;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: application.");
21
- }
22
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: application.");
26
- }
27
- if (input.attributeGroup !== undefined) {
28
- labelValue = input.attributeGroup;
29
- if (labelValue.length <= 0) {
30
- throw new Error("Empty value provided for input HTTP label: attributeGroup.");
31
- }
32
- resolvedPath = resolvedPath.replace("{attributeGroup}", __extendedEncodeURIComponent(labelValue));
33
- }
34
- else {
35
- throw new Error("No value provided for input HTTP label: attributeGroup.");
36
- }
17
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "attributeGroup", function () { return input.attributeGroup; }, "{attributeGroup}", false);
37
19
  return [2, new __HttpRequest({
38
20
  protocol: protocol,
39
21
  hostname: hostname,
@@ -47,7 +29,7 @@ export var serializeAws_restJson1AssociateAttributeGroupCommand = function (inpu
47
29
  });
48
30
  }); };
49
31
  export var serializeAws_restJson1AssociateResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
50
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
32
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
51
33
  return __generator(this, function (_c) {
52
34
  switch (_c.label) {
53
35
  case 0: return [4, context.endpoint()];
@@ -56,36 +38,9 @@ export var serializeAws_restJson1AssociateResourceCommand = function (input, con
56
38
  headers = {};
57
39
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
58
40
  "/applications/{application}/resources/{resourceType}/{resource}";
59
- if (input.application !== undefined) {
60
- labelValue = input.application;
61
- if (labelValue.length <= 0) {
62
- throw new Error("Empty value provided for input HTTP label: application.");
63
- }
64
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
65
- }
66
- else {
67
- throw new Error("No value provided for input HTTP label: application.");
68
- }
69
- if (input.resourceType !== undefined) {
70
- labelValue = input.resourceType;
71
- if (labelValue.length <= 0) {
72
- throw new Error("Empty value provided for input HTTP label: resourceType.");
73
- }
74
- resolvedPath = resolvedPath.replace("{resourceType}", __extendedEncodeURIComponent(labelValue));
75
- }
76
- else {
77
- throw new Error("No value provided for input HTTP label: resourceType.");
78
- }
79
- if (input.resource !== undefined) {
80
- labelValue = input.resource;
81
- if (labelValue.length <= 0) {
82
- throw new Error("Empty value provided for input HTTP label: resource.");
83
- }
84
- resolvedPath = resolvedPath.replace("{resource}", __extendedEncodeURIComponent(labelValue));
85
- }
86
- else {
87
- throw new Error("No value provided for input HTTP label: resource.");
88
- }
41
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
42
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", function () { return input.resourceType; }, "{resourceType}", false);
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "resource", function () { return input.resource; }, "{resource}", false);
89
44
  return [2, new __HttpRequest({
90
45
  protocol: protocol,
91
46
  hostname: hostname,
@@ -149,7 +104,7 @@ export var serializeAws_restJson1CreateAttributeGroupCommand = function (input,
149
104
  });
150
105
  }); };
151
106
  export var serializeAws_restJson1DeleteApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
152
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
107
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
153
108
  return __generator(this, function (_c) {
154
109
  switch (_c.label) {
155
110
  case 0: return [4, context.endpoint()];
@@ -157,16 +112,7 @@ export var serializeAws_restJson1DeleteApplicationCommand = function (input, con
157
112
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
158
113
  headers = {};
159
114
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{application}";
160
- if (input.application !== undefined) {
161
- labelValue = input.application;
162
- if (labelValue.length <= 0) {
163
- throw new Error("Empty value provided for input HTTP label: application.");
164
- }
165
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
166
- }
167
- else {
168
- throw new Error("No value provided for input HTTP label: application.");
169
- }
115
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
170
116
  return [2, new __HttpRequest({
171
117
  protocol: protocol,
172
118
  hostname: hostname,
@@ -180,7 +126,7 @@ export var serializeAws_restJson1DeleteApplicationCommand = function (input, con
180
126
  });
181
127
  }); };
182
128
  export var serializeAws_restJson1DeleteAttributeGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
183
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
129
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
184
130
  return __generator(this, function (_c) {
185
131
  switch (_c.label) {
186
132
  case 0: return [4, context.endpoint()];
@@ -188,16 +134,7 @@ export var serializeAws_restJson1DeleteAttributeGroupCommand = function (input,
188
134
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
189
135
  headers = {};
190
136
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/attribute-groups/{attributeGroup}";
191
- if (input.attributeGroup !== undefined) {
192
- labelValue = input.attributeGroup;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: attributeGroup.");
195
- }
196
- resolvedPath = resolvedPath.replace("{attributeGroup}", __extendedEncodeURIComponent(labelValue));
197
- }
198
- else {
199
- throw new Error("No value provided for input HTTP label: attributeGroup.");
200
- }
137
+ resolvedPath = __resolvedPath(resolvedPath, input, "attributeGroup", function () { return input.attributeGroup; }, "{attributeGroup}", false);
201
138
  return [2, new __HttpRequest({
202
139
  protocol: protocol,
203
140
  hostname: hostname,
@@ -211,7 +148,7 @@ export var serializeAws_restJson1DeleteAttributeGroupCommand = function (input,
211
148
  });
212
149
  }); };
213
150
  export var serializeAws_restJson1DisassociateAttributeGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
214
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
151
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
215
152
  return __generator(this, function (_c) {
216
153
  switch (_c.label) {
217
154
  case 0: return [4, context.endpoint()];
@@ -220,26 +157,8 @@ export var serializeAws_restJson1DisassociateAttributeGroupCommand = function (i
220
157
  headers = {};
221
158
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
222
159
  "/applications/{application}/attribute-groups/{attributeGroup}";
223
- if (input.application !== undefined) {
224
- labelValue = input.application;
225
- if (labelValue.length <= 0) {
226
- throw new Error("Empty value provided for input HTTP label: application.");
227
- }
228
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
229
- }
230
- else {
231
- throw new Error("No value provided for input HTTP label: application.");
232
- }
233
- if (input.attributeGroup !== undefined) {
234
- labelValue = input.attributeGroup;
235
- if (labelValue.length <= 0) {
236
- throw new Error("Empty value provided for input HTTP label: attributeGroup.");
237
- }
238
- resolvedPath = resolvedPath.replace("{attributeGroup}", __extendedEncodeURIComponent(labelValue));
239
- }
240
- else {
241
- throw new Error("No value provided for input HTTP label: attributeGroup.");
242
- }
160
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
161
+ resolvedPath = __resolvedPath(resolvedPath, input, "attributeGroup", function () { return input.attributeGroup; }, "{attributeGroup}", false);
243
162
  return [2, new __HttpRequest({
244
163
  protocol: protocol,
245
164
  hostname: hostname,
@@ -253,7 +172,7 @@ export var serializeAws_restJson1DisassociateAttributeGroupCommand = function (i
253
172
  });
254
173
  }); };
255
174
  export var serializeAws_restJson1DisassociateResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
256
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
175
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
257
176
  return __generator(this, function (_c) {
258
177
  switch (_c.label) {
259
178
  case 0: return [4, context.endpoint()];
@@ -262,36 +181,9 @@ export var serializeAws_restJson1DisassociateResourceCommand = function (input,
262
181
  headers = {};
263
182
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
264
183
  "/applications/{application}/resources/{resourceType}/{resource}";
265
- if (input.application !== undefined) {
266
- labelValue = input.application;
267
- if (labelValue.length <= 0) {
268
- throw new Error("Empty value provided for input HTTP label: application.");
269
- }
270
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
271
- }
272
- else {
273
- throw new Error("No value provided for input HTTP label: application.");
274
- }
275
- if (input.resourceType !== undefined) {
276
- labelValue = input.resourceType;
277
- if (labelValue.length <= 0) {
278
- throw new Error("Empty value provided for input HTTP label: resourceType.");
279
- }
280
- resolvedPath = resolvedPath.replace("{resourceType}", __extendedEncodeURIComponent(labelValue));
281
- }
282
- else {
283
- throw new Error("No value provided for input HTTP label: resourceType.");
284
- }
285
- if (input.resource !== undefined) {
286
- labelValue = input.resource;
287
- if (labelValue.length <= 0) {
288
- throw new Error("Empty value provided for input HTTP label: resource.");
289
- }
290
- resolvedPath = resolvedPath.replace("{resource}", __extendedEncodeURIComponent(labelValue));
291
- }
292
- else {
293
- throw new Error("No value provided for input HTTP label: resource.");
294
- }
184
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
185
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", function () { return input.resourceType; }, "{resourceType}", false);
186
+ resolvedPath = __resolvedPath(resolvedPath, input, "resource", function () { return input.resource; }, "{resource}", false);
295
187
  return [2, new __HttpRequest({
296
188
  protocol: protocol,
297
189
  hostname: hostname,
@@ -305,7 +197,7 @@ export var serializeAws_restJson1DisassociateResourceCommand = function (input,
305
197
  });
306
198
  }); };
307
199
  export var serializeAws_restJson1GetApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
308
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
200
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
309
201
  return __generator(this, function (_c) {
310
202
  switch (_c.label) {
311
203
  case 0: return [4, context.endpoint()];
@@ -313,16 +205,7 @@ export var serializeAws_restJson1GetApplicationCommand = function (input, contex
313
205
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
314
206
  headers = {};
315
207
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{application}";
316
- if (input.application !== undefined) {
317
- labelValue = input.application;
318
- if (labelValue.length <= 0) {
319
- throw new Error("Empty value provided for input HTTP label: application.");
320
- }
321
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
322
- }
323
- else {
324
- throw new Error("No value provided for input HTTP label: application.");
325
- }
208
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
326
209
  return [2, new __HttpRequest({
327
210
  protocol: protocol,
328
211
  hostname: hostname,
@@ -336,7 +219,7 @@ export var serializeAws_restJson1GetApplicationCommand = function (input, contex
336
219
  });
337
220
  }); };
338
221
  export var serializeAws_restJson1GetAssociatedResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
339
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, body;
222
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
340
223
  return __generator(this, function (_c) {
341
224
  switch (_c.label) {
342
225
  case 0: return [4, context.endpoint()];
@@ -345,36 +228,9 @@ export var serializeAws_restJson1GetAssociatedResourceCommand = function (input,
345
228
  headers = {};
346
229
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
347
230
  "/applications/{application}/resources/{resourceType}/{resource}";
348
- if (input.application !== undefined) {
349
- labelValue = input.application;
350
- if (labelValue.length <= 0) {
351
- throw new Error("Empty value provided for input HTTP label: application.");
352
- }
353
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
354
- }
355
- else {
356
- throw new Error("No value provided for input HTTP label: application.");
357
- }
358
- if (input.resourceType !== undefined) {
359
- labelValue = input.resourceType;
360
- if (labelValue.length <= 0) {
361
- throw new Error("Empty value provided for input HTTP label: resourceType.");
362
- }
363
- resolvedPath = resolvedPath.replace("{resourceType}", __extendedEncodeURIComponent(labelValue));
364
- }
365
- else {
366
- throw new Error("No value provided for input HTTP label: resourceType.");
367
- }
368
- if (input.resource !== undefined) {
369
- labelValue = input.resource;
370
- if (labelValue.length <= 0) {
371
- throw new Error("Empty value provided for input HTTP label: resource.");
372
- }
373
- resolvedPath = resolvedPath.replace("{resource}", __extendedEncodeURIComponent(labelValue));
374
- }
375
- else {
376
- throw new Error("No value provided for input HTTP label: resource.");
377
- }
231
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
232
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", function () { return input.resourceType; }, "{resourceType}", false);
233
+ resolvedPath = __resolvedPath(resolvedPath, input, "resource", function () { return input.resource; }, "{resource}", false);
378
234
  return [2, new __HttpRequest({
379
235
  protocol: protocol,
380
236
  hostname: hostname,
@@ -388,7 +244,7 @@ export var serializeAws_restJson1GetAssociatedResourceCommand = function (input,
388
244
  });
389
245
  }); };
390
246
  export var serializeAws_restJson1GetAttributeGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
391
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
247
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
392
248
  return __generator(this, function (_c) {
393
249
  switch (_c.label) {
394
250
  case 0: return [4, context.endpoint()];
@@ -396,16 +252,7 @@ export var serializeAws_restJson1GetAttributeGroupCommand = function (input, con
396
252
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
397
253
  headers = {};
398
254
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/attribute-groups/{attributeGroup}";
399
- if (input.attributeGroup !== undefined) {
400
- labelValue = input.attributeGroup;
401
- if (labelValue.length <= 0) {
402
- throw new Error("Empty value provided for input HTTP label: attributeGroup.");
403
- }
404
- resolvedPath = resolvedPath.replace("{attributeGroup}", __extendedEncodeURIComponent(labelValue));
405
- }
406
- else {
407
- throw new Error("No value provided for input HTTP label: attributeGroup.");
408
- }
255
+ resolvedPath = __resolvedPath(resolvedPath, input, "attributeGroup", function () { return input.attributeGroup; }, "{attributeGroup}", false);
409
256
  return [2, new __HttpRequest({
410
257
  protocol: protocol,
411
258
  hostname: hostname,
@@ -427,7 +274,10 @@ export var serializeAws_restJson1ListApplicationsCommand = function (input, cont
427
274
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
428
275
  headers = {};
429
276
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications";
430
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
277
+ query = map({
278
+ nextToken: [, input.nextToken],
279
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
280
+ });
431
281
  return [2, new __HttpRequest({
432
282
  protocol: protocol,
433
283
  hostname: hostname,
@@ -442,7 +292,7 @@ export var serializeAws_restJson1ListApplicationsCommand = function (input, cont
442
292
  });
443
293
  }); };
444
294
  export var serializeAws_restJson1ListAssociatedAttributeGroupsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
295
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
446
296
  return __generator(this, function (_c) {
447
297
  switch (_c.label) {
448
298
  case 0: return [4, context.endpoint()];
@@ -451,17 +301,11 @@ export var serializeAws_restJson1ListAssociatedAttributeGroupsCommand = function
451
301
  headers = {};
452
302
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
453
303
  "/applications/{application}/attribute-groups";
454
- if (input.application !== undefined) {
455
- labelValue = input.application;
456
- if (labelValue.length <= 0) {
457
- throw new Error("Empty value provided for input HTTP label: application.");
458
- }
459
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
460
- }
461
- else {
462
- throw new Error("No value provided for input HTTP label: application.");
463
- }
464
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
304
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
305
+ query = map({
306
+ nextToken: [, input.nextToken],
307
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
308
+ });
465
309
  return [2, new __HttpRequest({
466
310
  protocol: protocol,
467
311
  hostname: hostname,
@@ -476,7 +320,7 @@ export var serializeAws_restJson1ListAssociatedAttributeGroupsCommand = function
476
320
  });
477
321
  }); };
478
322
  export var serializeAws_restJson1ListAssociatedResourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
479
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
323
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
480
324
  return __generator(this, function (_c) {
481
325
  switch (_c.label) {
482
326
  case 0: return [4, context.endpoint()];
@@ -484,17 +328,11 @@ export var serializeAws_restJson1ListAssociatedResourcesCommand = function (inpu
484
328
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
485
329
  headers = {};
486
330
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{application}/resources";
487
- if (input.application !== undefined) {
488
- labelValue = input.application;
489
- if (labelValue.length <= 0) {
490
- throw new Error("Empty value provided for input HTTP label: application.");
491
- }
492
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
493
- }
494
- else {
495
- throw new Error("No value provided for input HTTP label: application.");
496
- }
497
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
331
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
332
+ query = map({
333
+ nextToken: [, input.nextToken],
334
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
335
+ });
498
336
  return [2, new __HttpRequest({
499
337
  protocol: protocol,
500
338
  hostname: hostname,
@@ -517,7 +355,10 @@ export var serializeAws_restJson1ListAttributeGroupsCommand = function (input, c
517
355
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
518
356
  headers = {};
519
357
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/attribute-groups";
520
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
358
+ query = map({
359
+ nextToken: [, input.nextToken],
360
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
361
+ });
521
362
  return [2, new __HttpRequest({
522
363
  protocol: protocol,
523
364
  hostname: hostname,
@@ -532,7 +373,7 @@ export var serializeAws_restJson1ListAttributeGroupsCommand = function (input, c
532
373
  });
533
374
  }); };
534
375
  export var serializeAws_restJson1ListAttributeGroupsForApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
535
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
376
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
536
377
  return __generator(this, function (_c) {
537
378
  switch (_c.label) {
538
379
  case 0: return [4, context.endpoint()];
@@ -541,17 +382,11 @@ export var serializeAws_restJson1ListAttributeGroupsForApplicationCommand = func
541
382
  headers = {};
542
383
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
543
384
  "/applications/{application}/attribute-group-details";
544
- if (input.application !== undefined) {
545
- labelValue = input.application;
546
- if (labelValue.length <= 0) {
547
- throw new Error("Empty value provided for input HTTP label: application.");
548
- }
549
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
550
- }
551
- else {
552
- throw new Error("No value provided for input HTTP label: application.");
553
- }
554
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
385
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
386
+ query = map({
387
+ nextToken: [, input.nextToken],
388
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
389
+ });
555
390
  return [2, new __HttpRequest({
556
391
  protocol: protocol,
557
392
  hostname: hostname,
@@ -566,7 +401,7 @@ export var serializeAws_restJson1ListAttributeGroupsForApplicationCommand = func
566
401
  });
567
402
  }); };
568
403
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
569
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
404
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
570
405
  return __generator(this, function (_c) {
571
406
  switch (_c.label) {
572
407
  case 0: return [4, context.endpoint()];
@@ -574,16 +409,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
574
409
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
575
410
  headers = {};
576
411
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
577
- if (input.resourceArn !== undefined) {
578
- labelValue = input.resourceArn;
579
- if (labelValue.length <= 0) {
580
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
581
- }
582
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
583
- }
584
- else {
585
- throw new Error("No value provided for input HTTP label: resourceArn.");
586
- }
412
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
587
413
  return [2, new __HttpRequest({
588
414
  protocol: protocol,
589
415
  hostname: hostname,
@@ -597,7 +423,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
597
423
  });
598
424
  }); };
599
425
  export var serializeAws_restJson1SyncResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
600
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
426
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
601
427
  return __generator(this, function (_c) {
602
428
  switch (_c.label) {
603
429
  case 0: return [4, context.endpoint()];
@@ -605,26 +431,8 @@ export var serializeAws_restJson1SyncResourceCommand = function (input, context)
605
431
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
606
432
  headers = {};
607
433
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sync/{resourceType}/{resource}";
608
- if (input.resourceType !== undefined) {
609
- labelValue = input.resourceType;
610
- if (labelValue.length <= 0) {
611
- throw new Error("Empty value provided for input HTTP label: resourceType.");
612
- }
613
- resolvedPath = resolvedPath.replace("{resourceType}", __extendedEncodeURIComponent(labelValue));
614
- }
615
- else {
616
- throw new Error("No value provided for input HTTP label: resourceType.");
617
- }
618
- if (input.resource !== undefined) {
619
- labelValue = input.resource;
620
- if (labelValue.length <= 0) {
621
- throw new Error("Empty value provided for input HTTP label: resource.");
622
- }
623
- resolvedPath = resolvedPath.replace("{resource}", __extendedEncodeURIComponent(labelValue));
624
- }
625
- else {
626
- throw new Error("No value provided for input HTTP label: resource.");
627
- }
434
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", function () { return input.resourceType; }, "{resourceType}", false);
435
+ resolvedPath = __resolvedPath(resolvedPath, input, "resource", function () { return input.resource; }, "{resource}", false);
628
436
  return [2, new __HttpRequest({
629
437
  protocol: protocol,
630
438
  hostname: hostname,
@@ -638,7 +446,7 @@ export var serializeAws_restJson1SyncResourceCommand = function (input, context)
638
446
  });
639
447
  }); };
640
448
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
641
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
449
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
642
450
  return __generator(this, function (_c) {
643
451
  switch (_c.label) {
644
452
  case 0: return [4, context.endpoint()];
@@ -648,16 +456,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
648
456
  "content-type": "application/json",
649
457
  };
650
458
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
651
- if (input.resourceArn !== undefined) {
652
- labelValue = input.resourceArn;
653
- if (labelValue.length <= 0) {
654
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
655
- }
656
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
657
- }
658
- else {
659
- throw new Error("No value provided for input HTTP label: resourceArn.");
660
- }
459
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
661
460
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) })));
662
461
  return [2, new __HttpRequest({
663
462
  protocol: protocol,
@@ -672,7 +471,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
672
471
  });
673
472
  }); };
674
473
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
675
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
474
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
676
475
  return __generator(this, function (_c) {
677
476
  switch (_c.label) {
678
477
  case 0: return [4, context.endpoint()];
@@ -680,17 +479,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
680
479
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
681
480
  headers = {};
682
481
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
683
- if (input.resourceArn !== undefined) {
684
- labelValue = input.resourceArn;
685
- if (labelValue.length <= 0) {
686
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
687
- }
688
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
689
- }
690
- else {
691
- throw new Error("No value provided for input HTTP label: resourceArn.");
692
- }
693
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
482
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
483
+ query = map({
484
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
485
+ });
694
486
  return [2, new __HttpRequest({
695
487
  protocol: protocol,
696
488
  hostname: hostname,
@@ -705,7 +497,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
705
497
  });
706
498
  }); };
707
499
  export var serializeAws_restJson1UpdateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
708
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
500
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
709
501
  return __generator(this, function (_c) {
710
502
  switch (_c.label) {
711
503
  case 0: return [4, context.endpoint()];
@@ -715,16 +507,7 @@ export var serializeAws_restJson1UpdateApplicationCommand = function (input, con
715
507
  "content-type": "application/json",
716
508
  };
717
509
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{application}";
718
- if (input.application !== undefined) {
719
- labelValue = input.application;
720
- if (labelValue.length <= 0) {
721
- throw new Error("Empty value provided for input HTTP label: application.");
722
- }
723
- resolvedPath = resolvedPath.replace("{application}", __extendedEncodeURIComponent(labelValue));
724
- }
725
- else {
726
- throw new Error("No value provided for input HTTP label: application.");
727
- }
510
+ resolvedPath = __resolvedPath(resolvedPath, input, "application", function () { return input.application; }, "{application}", false);
728
511
  body = JSON.stringify(__assign(__assign({}, (input.description != null && { description: input.description })), (input.name != null && { name: input.name })));
729
512
  return [2, new __HttpRequest({
730
513
  protocol: protocol,
@@ -739,7 +522,7 @@ export var serializeAws_restJson1UpdateApplicationCommand = function (input, con
739
522
  });
740
523
  }); };
741
524
  export var serializeAws_restJson1UpdateAttributeGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
742
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
525
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
743
526
  return __generator(this, function (_c) {
744
527
  switch (_c.label) {
745
528
  case 0: return [4, context.endpoint()];
@@ -749,16 +532,7 @@ export var serializeAws_restJson1UpdateAttributeGroupCommand = function (input,
749
532
  "content-type": "application/json",
750
533
  };
751
534
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/attribute-groups/{attributeGroup}";
752
- if (input.attributeGroup !== undefined) {
753
- labelValue = input.attributeGroup;
754
- if (labelValue.length <= 0) {
755
- throw new Error("Empty value provided for input HTTP label: attributeGroup.");
756
- }
757
- resolvedPath = resolvedPath.replace("{attributeGroup}", __extendedEncodeURIComponent(labelValue));
758
- }
759
- else {
760
- throw new Error("No value provided for input HTTP label: attributeGroup.");
761
- }
535
+ resolvedPath = __resolvedPath(resolvedPath, input, "attributeGroup", function () { return input.attributeGroup; }, "{attributeGroup}", false);
762
536
  body = JSON.stringify(__assign(__assign(__assign({}, (input.attributes != null && { attributes: input.attributes })), (input.description != null && { description: input.description })), (input.name != null && { name: input.name })));
763
537
  return [2, new __HttpRequest({
764
538
  protocol: protocol,
@@ -780,28 +554,26 @@ export var deserializeAws_restJson1AssociateAttributeGroupCommand = function (ou
780
554
  if (output.statusCode !== 200 && output.statusCode >= 300) {
781
555
  return [2, deserializeAws_restJson1AssociateAttributeGroupCommandError(output, context)];
782
556
  }
783
- contents = {
557
+ contents = map({
784
558
  $metadata: deserializeMetadata(output),
785
- applicationArn: undefined,
786
- attributeGroupArn: undefined,
787
- };
559
+ });
788
560
  _a = __expectNonNull;
789
561
  _b = __expectObject;
790
562
  return [4, parseBody(output.body, context)];
791
563
  case 1:
792
564
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
793
- if (data.applicationArn !== undefined && data.applicationArn !== null) {
565
+ if (data.applicationArn != null) {
794
566
  contents.applicationArn = __expectString(data.applicationArn);
795
567
  }
796
- if (data.attributeGroupArn !== undefined && data.attributeGroupArn !== null) {
568
+ if (data.attributeGroupArn != null) {
797
569
  contents.attributeGroupArn = __expectString(data.attributeGroupArn);
798
570
  }
799
- return [2, Promise.resolve(contents)];
571
+ return [2, contents];
800
572
  }
801
573
  });
802
574
  }); };
803
575
  var deserializeAws_restJson1AssociateAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
804
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
576
+ var parsedOutput, _a, errorCode, _b, parsedBody;
805
577
  var _c;
806
578
  return __generator(this, function (_d) {
807
579
  switch (_d.label) {
@@ -838,14 +610,14 @@ var deserializeAws_restJson1AssociateAttributeGroupCommandError = function (outp
838
610
  case 11: throw _d.sent();
839
611
  case 12:
840
612
  parsedBody = parsedOutput.body;
841
- $metadata = deserializeMetadata(output);
842
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
843
- response = new __BaseException({
844
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
845
- $fault: "client",
846
- $metadata: $metadata,
613
+ throwDefaultError({
614
+ output: output,
615
+ parsedBody: parsedBody,
616
+ exceptionCtor: __BaseException,
617
+ errorCode: errorCode,
847
618
  });
848
- throw __decorateServiceException(response, parsedBody);
619
+ _d.label = 13;
620
+ case 13: return [2];
849
621
  }
850
622
  });
851
623
  }); };
@@ -857,28 +629,26 @@ export var deserializeAws_restJson1AssociateResourceCommand = function (output,
857
629
  if (output.statusCode !== 200 && output.statusCode >= 300) {
858
630
  return [2, deserializeAws_restJson1AssociateResourceCommandError(output, context)];
859
631
  }
860
- contents = {
632
+ contents = map({
861
633
  $metadata: deserializeMetadata(output),
862
- applicationArn: undefined,
863
- resourceArn: undefined,
864
- };
634
+ });
865
635
  _a = __expectNonNull;
866
636
  _b = __expectObject;
867
637
  return [4, parseBody(output.body, context)];
868
638
  case 1:
869
639
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
870
- if (data.applicationArn !== undefined && data.applicationArn !== null) {
640
+ if (data.applicationArn != null) {
871
641
  contents.applicationArn = __expectString(data.applicationArn);
872
642
  }
873
- if (data.resourceArn !== undefined && data.resourceArn !== null) {
643
+ if (data.resourceArn != null) {
874
644
  contents.resourceArn = __expectString(data.resourceArn);
875
645
  }
876
- return [2, Promise.resolve(contents)];
646
+ return [2, contents];
877
647
  }
878
648
  });
879
649
  }); };
880
650
  var deserializeAws_restJson1AssociateResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
881
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
651
+ var parsedOutput, _a, errorCode, _b, parsedBody;
882
652
  var _c;
883
653
  return __generator(this, function (_d) {
884
654
  switch (_d.label) {
@@ -915,14 +685,14 @@ var deserializeAws_restJson1AssociateResourceCommandError = function (output, co
915
685
  case 11: throw _d.sent();
916
686
  case 12:
917
687
  parsedBody = parsedOutput.body;
918
- $metadata = deserializeMetadata(output);
919
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
920
- response = new __BaseException({
921
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
922
- $fault: "client",
923
- $metadata: $metadata,
688
+ throwDefaultError({
689
+ output: output,
690
+ parsedBody: parsedBody,
691
+ exceptionCtor: __BaseException,
692
+ errorCode: errorCode,
924
693
  });
925
- throw __decorateServiceException(response, parsedBody);
694
+ _d.label = 13;
695
+ case 13: return [2];
926
696
  }
927
697
  });
928
698
  }); };
@@ -934,24 +704,23 @@ export var deserializeAws_restJson1CreateApplicationCommand = function (output,
934
704
  if (output.statusCode !== 201 && output.statusCode >= 300) {
935
705
  return [2, deserializeAws_restJson1CreateApplicationCommandError(output, context)];
936
706
  }
937
- contents = {
707
+ contents = map({
938
708
  $metadata: deserializeMetadata(output),
939
- application: undefined,
940
- };
709
+ });
941
710
  _a = __expectNonNull;
942
711
  _b = __expectObject;
943
712
  return [4, parseBody(output.body, context)];
944
713
  case 1:
945
714
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
946
- if (data.application !== undefined && data.application !== null) {
715
+ if (data.application != null) {
947
716
  contents.application = deserializeAws_restJson1Application(data.application, context);
948
717
  }
949
- return [2, Promise.resolve(contents)];
718
+ return [2, contents];
950
719
  }
951
720
  });
952
721
  }); };
953
722
  var deserializeAws_restJson1CreateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
954
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
723
+ var parsedOutput, _a, errorCode, _b, parsedBody;
955
724
  var _c;
956
725
  return __generator(this, function (_d) {
957
726
  switch (_d.label) {
@@ -984,14 +753,14 @@ var deserializeAws_restJson1CreateApplicationCommandError = function (output, co
984
753
  case 9: throw _d.sent();
985
754
  case 10:
986
755
  parsedBody = parsedOutput.body;
987
- $metadata = deserializeMetadata(output);
988
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
989
- response = new __BaseException({
990
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
991
- $fault: "client",
992
- $metadata: $metadata,
756
+ throwDefaultError({
757
+ output: output,
758
+ parsedBody: parsedBody,
759
+ exceptionCtor: __BaseException,
760
+ errorCode: errorCode,
993
761
  });
994
- throw __decorateServiceException(response, parsedBody);
762
+ _d.label = 11;
763
+ case 11: return [2];
995
764
  }
996
765
  });
997
766
  }); };
@@ -1003,24 +772,23 @@ export var deserializeAws_restJson1CreateAttributeGroupCommand = function (outpu
1003
772
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1004
773
  return [2, deserializeAws_restJson1CreateAttributeGroupCommandError(output, context)];
1005
774
  }
1006
- contents = {
775
+ contents = map({
1007
776
  $metadata: deserializeMetadata(output),
1008
- attributeGroup: undefined,
1009
- };
777
+ });
1010
778
  _a = __expectNonNull;
1011
779
  _b = __expectObject;
1012
780
  return [4, parseBody(output.body, context)];
1013
781
  case 1:
1014
782
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1015
- if (data.attributeGroup !== undefined && data.attributeGroup !== null) {
783
+ if (data.attributeGroup != null) {
1016
784
  contents.attributeGroup = deserializeAws_restJson1AttributeGroup(data.attributeGroup, context);
1017
785
  }
1018
- return [2, Promise.resolve(contents)];
786
+ return [2, contents];
1019
787
  }
1020
788
  });
1021
789
  }); };
1022
790
  var deserializeAws_restJson1CreateAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1023
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
791
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1024
792
  var _c;
1025
793
  return __generator(this, function (_d) {
1026
794
  switch (_d.label) {
@@ -1053,14 +821,14 @@ var deserializeAws_restJson1CreateAttributeGroupCommandError = function (output,
1053
821
  case 9: throw _d.sent();
1054
822
  case 10:
1055
823
  parsedBody = parsedOutput.body;
1056
- $metadata = deserializeMetadata(output);
1057
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1058
- response = new __BaseException({
1059
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1060
- $fault: "client",
1061
- $metadata: $metadata,
824
+ throwDefaultError({
825
+ output: output,
826
+ parsedBody: parsedBody,
827
+ exceptionCtor: __BaseException,
828
+ errorCode: errorCode,
1062
829
  });
1063
- throw __decorateServiceException(response, parsedBody);
830
+ _d.label = 11;
831
+ case 11: return [2];
1064
832
  }
1065
833
  });
1066
834
  }); };
@@ -1072,24 +840,23 @@ export var deserializeAws_restJson1DeleteApplicationCommand = function (output,
1072
840
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1073
841
  return [2, deserializeAws_restJson1DeleteApplicationCommandError(output, context)];
1074
842
  }
1075
- contents = {
843
+ contents = map({
1076
844
  $metadata: deserializeMetadata(output),
1077
- application: undefined,
1078
- };
845
+ });
1079
846
  _a = __expectNonNull;
1080
847
  _b = __expectObject;
1081
848
  return [4, parseBody(output.body, context)];
1082
849
  case 1:
1083
850
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1084
- if (data.application !== undefined && data.application !== null) {
851
+ if (data.application != null) {
1085
852
  contents.application = deserializeAws_restJson1ApplicationSummary(data.application, context);
1086
853
  }
1087
- return [2, Promise.resolve(contents)];
854
+ return [2, contents];
1088
855
  }
1089
856
  });
1090
857
  }); };
1091
858
  var deserializeAws_restJson1DeleteApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1092
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
859
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1093
860
  var _c;
1094
861
  return __generator(this, function (_d) {
1095
862
  switch (_d.label) {
@@ -1118,14 +885,14 @@ var deserializeAws_restJson1DeleteApplicationCommandError = function (output, co
1118
885
  case 7: throw _d.sent();
1119
886
  case 8:
1120
887
  parsedBody = parsedOutput.body;
1121
- $metadata = deserializeMetadata(output);
1122
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1123
- response = new __BaseException({
1124
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1125
- $fault: "client",
1126
- $metadata: $metadata,
888
+ throwDefaultError({
889
+ output: output,
890
+ parsedBody: parsedBody,
891
+ exceptionCtor: __BaseException,
892
+ errorCode: errorCode,
1127
893
  });
1128
- throw __decorateServiceException(response, parsedBody);
894
+ _d.label = 9;
895
+ case 9: return [2];
1129
896
  }
1130
897
  });
1131
898
  }); };
@@ -1137,24 +904,23 @@ export var deserializeAws_restJson1DeleteAttributeGroupCommand = function (outpu
1137
904
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1138
905
  return [2, deserializeAws_restJson1DeleteAttributeGroupCommandError(output, context)];
1139
906
  }
1140
- contents = {
907
+ contents = map({
1141
908
  $metadata: deserializeMetadata(output),
1142
- attributeGroup: undefined,
1143
- };
909
+ });
1144
910
  _a = __expectNonNull;
1145
911
  _b = __expectObject;
1146
912
  return [4, parseBody(output.body, context)];
1147
913
  case 1:
1148
914
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1149
- if (data.attributeGroup !== undefined && data.attributeGroup !== null) {
915
+ if (data.attributeGroup != null) {
1150
916
  contents.attributeGroup = deserializeAws_restJson1AttributeGroupSummary(data.attributeGroup, context);
1151
917
  }
1152
- return [2, Promise.resolve(contents)];
918
+ return [2, contents];
1153
919
  }
1154
920
  });
1155
921
  }); };
1156
922
  var deserializeAws_restJson1DeleteAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1157
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
923
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1158
924
  var _c;
1159
925
  return __generator(this, function (_d) {
1160
926
  switch (_d.label) {
@@ -1183,14 +949,14 @@ var deserializeAws_restJson1DeleteAttributeGroupCommandError = function (output,
1183
949
  case 7: throw _d.sent();
1184
950
  case 8:
1185
951
  parsedBody = parsedOutput.body;
1186
- $metadata = deserializeMetadata(output);
1187
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1188
- response = new __BaseException({
1189
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1190
- $fault: "client",
1191
- $metadata: $metadata,
952
+ throwDefaultError({
953
+ output: output,
954
+ parsedBody: parsedBody,
955
+ exceptionCtor: __BaseException,
956
+ errorCode: errorCode,
1192
957
  });
1193
- throw __decorateServiceException(response, parsedBody);
958
+ _d.label = 9;
959
+ case 9: return [2];
1194
960
  }
1195
961
  });
1196
962
  }); };
@@ -1202,28 +968,26 @@ export var deserializeAws_restJson1DisassociateAttributeGroupCommand = function
1202
968
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1203
969
  return [2, deserializeAws_restJson1DisassociateAttributeGroupCommandError(output, context)];
1204
970
  }
1205
- contents = {
971
+ contents = map({
1206
972
  $metadata: deserializeMetadata(output),
1207
- applicationArn: undefined,
1208
- attributeGroupArn: undefined,
1209
- };
973
+ });
1210
974
  _a = __expectNonNull;
1211
975
  _b = __expectObject;
1212
976
  return [4, parseBody(output.body, context)];
1213
977
  case 1:
1214
978
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1215
- if (data.applicationArn !== undefined && data.applicationArn !== null) {
979
+ if (data.applicationArn != null) {
1216
980
  contents.applicationArn = __expectString(data.applicationArn);
1217
981
  }
1218
- if (data.attributeGroupArn !== undefined && data.attributeGroupArn !== null) {
982
+ if (data.attributeGroupArn != null) {
1219
983
  contents.attributeGroupArn = __expectString(data.attributeGroupArn);
1220
984
  }
1221
- return [2, Promise.resolve(contents)];
985
+ return [2, contents];
1222
986
  }
1223
987
  });
1224
988
  }); };
1225
989
  var deserializeAws_restJson1DisassociateAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1226
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
990
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1227
991
  var _c;
1228
992
  return __generator(this, function (_d) {
1229
993
  switch (_d.label) {
@@ -1252,14 +1016,14 @@ var deserializeAws_restJson1DisassociateAttributeGroupCommandError = function (o
1252
1016
  case 7: throw _d.sent();
1253
1017
  case 8:
1254
1018
  parsedBody = parsedOutput.body;
1255
- $metadata = deserializeMetadata(output);
1256
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1257
- response = new __BaseException({
1258
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1259
- $fault: "client",
1260
- $metadata: $metadata,
1019
+ throwDefaultError({
1020
+ output: output,
1021
+ parsedBody: parsedBody,
1022
+ exceptionCtor: __BaseException,
1023
+ errorCode: errorCode,
1261
1024
  });
1262
- throw __decorateServiceException(response, parsedBody);
1025
+ _d.label = 9;
1026
+ case 9: return [2];
1263
1027
  }
1264
1028
  });
1265
1029
  }); };
@@ -1271,28 +1035,26 @@ export var deserializeAws_restJson1DisassociateResourceCommand = function (outpu
1271
1035
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1272
1036
  return [2, deserializeAws_restJson1DisassociateResourceCommandError(output, context)];
1273
1037
  }
1274
- contents = {
1038
+ contents = map({
1275
1039
  $metadata: deserializeMetadata(output),
1276
- applicationArn: undefined,
1277
- resourceArn: undefined,
1278
- };
1040
+ });
1279
1041
  _a = __expectNonNull;
1280
1042
  _b = __expectObject;
1281
1043
  return [4, parseBody(output.body, context)];
1282
1044
  case 1:
1283
1045
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1284
- if (data.applicationArn !== undefined && data.applicationArn !== null) {
1046
+ if (data.applicationArn != null) {
1285
1047
  contents.applicationArn = __expectString(data.applicationArn);
1286
1048
  }
1287
- if (data.resourceArn !== undefined && data.resourceArn !== null) {
1049
+ if (data.resourceArn != null) {
1288
1050
  contents.resourceArn = __expectString(data.resourceArn);
1289
1051
  }
1290
- return [2, Promise.resolve(contents)];
1052
+ return [2, contents];
1291
1053
  }
1292
1054
  });
1293
1055
  }); };
1294
1056
  var deserializeAws_restJson1DisassociateResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1295
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1057
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1296
1058
  var _c;
1297
1059
  return __generator(this, function (_d) {
1298
1060
  switch (_d.label) {
@@ -1321,14 +1083,14 @@ var deserializeAws_restJson1DisassociateResourceCommandError = function (output,
1321
1083
  case 7: throw _d.sent();
1322
1084
  case 8:
1323
1085
  parsedBody = parsedOutput.body;
1324
- $metadata = deserializeMetadata(output);
1325
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1326
- response = new __BaseException({
1327
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1328
- $fault: "client",
1329
- $metadata: $metadata,
1086
+ throwDefaultError({
1087
+ output: output,
1088
+ parsedBody: parsedBody,
1089
+ exceptionCtor: __BaseException,
1090
+ errorCode: errorCode,
1330
1091
  });
1331
- throw __decorateServiceException(response, parsedBody);
1092
+ _d.label = 9;
1093
+ case 9: return [2];
1332
1094
  }
1333
1095
  });
1334
1096
  }); };
@@ -1340,56 +1102,47 @@ export var deserializeAws_restJson1GetApplicationCommand = function (output, con
1340
1102
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1341
1103
  return [2, deserializeAws_restJson1GetApplicationCommandError(output, context)];
1342
1104
  }
1343
- contents = {
1105
+ contents = map({
1344
1106
  $metadata: deserializeMetadata(output),
1345
- arn: undefined,
1346
- associatedResourceCount: undefined,
1347
- creationTime: undefined,
1348
- description: undefined,
1349
- id: undefined,
1350
- integrations: undefined,
1351
- lastUpdateTime: undefined,
1352
- name: undefined,
1353
- tags: undefined,
1354
- };
1107
+ });
1355
1108
  _a = __expectNonNull;
1356
1109
  _b = __expectObject;
1357
1110
  return [4, parseBody(output.body, context)];
1358
1111
  case 1:
1359
1112
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1360
- if (data.arn !== undefined && data.arn !== null) {
1113
+ if (data.arn != null) {
1361
1114
  contents.arn = __expectString(data.arn);
1362
1115
  }
1363
- if (data.associatedResourceCount !== undefined && data.associatedResourceCount !== null) {
1116
+ if (data.associatedResourceCount != null) {
1364
1117
  contents.associatedResourceCount = __expectInt32(data.associatedResourceCount);
1365
1118
  }
1366
- if (data.creationTime !== undefined && data.creationTime !== null) {
1119
+ if (data.creationTime != null) {
1367
1120
  contents.creationTime = __expectNonNull(__parseRfc3339DateTime(data.creationTime));
1368
1121
  }
1369
- if (data.description !== undefined && data.description !== null) {
1122
+ if (data.description != null) {
1370
1123
  contents.description = __expectString(data.description);
1371
1124
  }
1372
- if (data.id !== undefined && data.id !== null) {
1125
+ if (data.id != null) {
1373
1126
  contents.id = __expectString(data.id);
1374
1127
  }
1375
- if (data.integrations !== undefined && data.integrations !== null) {
1128
+ if (data.integrations != null) {
1376
1129
  contents.integrations = deserializeAws_restJson1Integrations(data.integrations, context);
1377
1130
  }
1378
- if (data.lastUpdateTime !== undefined && data.lastUpdateTime !== null) {
1131
+ if (data.lastUpdateTime != null) {
1379
1132
  contents.lastUpdateTime = __expectNonNull(__parseRfc3339DateTime(data.lastUpdateTime));
1380
1133
  }
1381
- if (data.name !== undefined && data.name !== null) {
1134
+ if (data.name != null) {
1382
1135
  contents.name = __expectString(data.name);
1383
1136
  }
1384
- if (data.tags !== undefined && data.tags !== null) {
1137
+ if (data.tags != null) {
1385
1138
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
1386
1139
  }
1387
- return [2, Promise.resolve(contents)];
1140
+ return [2, contents];
1388
1141
  }
1389
1142
  });
1390
1143
  }); };
1391
1144
  var deserializeAws_restJson1GetApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1392
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1145
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1393
1146
  var _c;
1394
1147
  return __generator(this, function (_d) {
1395
1148
  switch (_d.label) {
@@ -1422,14 +1175,14 @@ var deserializeAws_restJson1GetApplicationCommandError = function (output, conte
1422
1175
  case 9: throw _d.sent();
1423
1176
  case 10:
1424
1177
  parsedBody = parsedOutput.body;
1425
- $metadata = deserializeMetadata(output);
1426
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1427
- response = new __BaseException({
1428
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1429
- $fault: "client",
1430
- $metadata: $metadata,
1178
+ throwDefaultError({
1179
+ output: output,
1180
+ parsedBody: parsedBody,
1181
+ exceptionCtor: __BaseException,
1182
+ errorCode: errorCode,
1431
1183
  });
1432
- throw __decorateServiceException(response, parsedBody);
1184
+ _d.label = 11;
1185
+ case 11: return [2];
1433
1186
  }
1434
1187
  });
1435
1188
  }); };
@@ -1441,24 +1194,23 @@ export var deserializeAws_restJson1GetAssociatedResourceCommand = function (outp
1441
1194
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1442
1195
  return [2, deserializeAws_restJson1GetAssociatedResourceCommandError(output, context)];
1443
1196
  }
1444
- contents = {
1197
+ contents = map({
1445
1198
  $metadata: deserializeMetadata(output),
1446
- resource: undefined,
1447
- };
1199
+ });
1448
1200
  _a = __expectNonNull;
1449
1201
  _b = __expectObject;
1450
1202
  return [4, parseBody(output.body, context)];
1451
1203
  case 1:
1452
1204
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1453
- if (data.resource !== undefined && data.resource !== null) {
1205
+ if (data.resource != null) {
1454
1206
  contents.resource = deserializeAws_restJson1Resource(data.resource, context);
1455
1207
  }
1456
- return [2, Promise.resolve(contents)];
1208
+ return [2, contents];
1457
1209
  }
1458
1210
  });
1459
1211
  }); };
1460
1212
  var deserializeAws_restJson1GetAssociatedResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1461
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1213
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1462
1214
  var _c;
1463
1215
  return __generator(this, function (_d) {
1464
1216
  switch (_d.label) {
@@ -1487,14 +1239,14 @@ var deserializeAws_restJson1GetAssociatedResourceCommandError = function (output
1487
1239
  case 7: throw _d.sent();
1488
1240
  case 8:
1489
1241
  parsedBody = parsedOutput.body;
1490
- $metadata = deserializeMetadata(output);
1491
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1492
- response = new __BaseException({
1493
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1494
- $fault: "client",
1495
- $metadata: $metadata,
1242
+ throwDefaultError({
1243
+ output: output,
1244
+ parsedBody: parsedBody,
1245
+ exceptionCtor: __BaseException,
1246
+ errorCode: errorCode,
1496
1247
  });
1497
- throw __decorateServiceException(response, parsedBody);
1248
+ _d.label = 9;
1249
+ case 9: return [2];
1498
1250
  }
1499
1251
  });
1500
1252
  }); };
@@ -1506,52 +1258,44 @@ export var deserializeAws_restJson1GetAttributeGroupCommand = function (output,
1506
1258
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1507
1259
  return [2, deserializeAws_restJson1GetAttributeGroupCommandError(output, context)];
1508
1260
  }
1509
- contents = {
1261
+ contents = map({
1510
1262
  $metadata: deserializeMetadata(output),
1511
- arn: undefined,
1512
- attributes: undefined,
1513
- creationTime: undefined,
1514
- description: undefined,
1515
- id: undefined,
1516
- lastUpdateTime: undefined,
1517
- name: undefined,
1518
- tags: undefined,
1519
- };
1263
+ });
1520
1264
  _a = __expectNonNull;
1521
1265
  _b = __expectObject;
1522
1266
  return [4, parseBody(output.body, context)];
1523
1267
  case 1:
1524
1268
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1525
- if (data.arn !== undefined && data.arn !== null) {
1269
+ if (data.arn != null) {
1526
1270
  contents.arn = __expectString(data.arn);
1527
1271
  }
1528
- if (data.attributes !== undefined && data.attributes !== null) {
1272
+ if (data.attributes != null) {
1529
1273
  contents.attributes = __expectString(data.attributes);
1530
1274
  }
1531
- if (data.creationTime !== undefined && data.creationTime !== null) {
1275
+ if (data.creationTime != null) {
1532
1276
  contents.creationTime = __expectNonNull(__parseRfc3339DateTime(data.creationTime));
1533
1277
  }
1534
- if (data.description !== undefined && data.description !== null) {
1278
+ if (data.description != null) {
1535
1279
  contents.description = __expectString(data.description);
1536
1280
  }
1537
- if (data.id !== undefined && data.id !== null) {
1281
+ if (data.id != null) {
1538
1282
  contents.id = __expectString(data.id);
1539
1283
  }
1540
- if (data.lastUpdateTime !== undefined && data.lastUpdateTime !== null) {
1284
+ if (data.lastUpdateTime != null) {
1541
1285
  contents.lastUpdateTime = __expectNonNull(__parseRfc3339DateTime(data.lastUpdateTime));
1542
1286
  }
1543
- if (data.name !== undefined && data.name !== null) {
1287
+ if (data.name != null) {
1544
1288
  contents.name = __expectString(data.name);
1545
1289
  }
1546
- if (data.tags !== undefined && data.tags !== null) {
1290
+ if (data.tags != null) {
1547
1291
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
1548
1292
  }
1549
- return [2, Promise.resolve(contents)];
1293
+ return [2, contents];
1550
1294
  }
1551
1295
  });
1552
1296
  }); };
1553
1297
  var deserializeAws_restJson1GetAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1554
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1298
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1555
1299
  var _c;
1556
1300
  return __generator(this, function (_d) {
1557
1301
  switch (_d.label) {
@@ -1584,14 +1328,14 @@ var deserializeAws_restJson1GetAttributeGroupCommandError = function (output, co
1584
1328
  case 9: throw _d.sent();
1585
1329
  case 10:
1586
1330
  parsedBody = parsedOutput.body;
1587
- $metadata = deserializeMetadata(output);
1588
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1589
- response = new __BaseException({
1590
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1591
- $fault: "client",
1592
- $metadata: $metadata,
1331
+ throwDefaultError({
1332
+ output: output,
1333
+ parsedBody: parsedBody,
1334
+ exceptionCtor: __BaseException,
1335
+ errorCode: errorCode,
1593
1336
  });
1594
- throw __decorateServiceException(response, parsedBody);
1337
+ _d.label = 11;
1338
+ case 11: return [2];
1595
1339
  }
1596
1340
  });
1597
1341
  }); };
@@ -1603,28 +1347,26 @@ export var deserializeAws_restJson1ListApplicationsCommand = function (output, c
1603
1347
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1604
1348
  return [2, deserializeAws_restJson1ListApplicationsCommandError(output, context)];
1605
1349
  }
1606
- contents = {
1350
+ contents = map({
1607
1351
  $metadata: deserializeMetadata(output),
1608
- applications: undefined,
1609
- nextToken: undefined,
1610
- };
1352
+ });
1611
1353
  _a = __expectNonNull;
1612
1354
  _b = __expectObject;
1613
1355
  return [4, parseBody(output.body, context)];
1614
1356
  case 1:
1615
1357
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1616
- if (data.applications !== undefined && data.applications !== null) {
1358
+ if (data.applications != null) {
1617
1359
  contents.applications = deserializeAws_restJson1ApplicationSummaries(data.applications, context);
1618
1360
  }
1619
- if (data.nextToken !== undefined && data.nextToken !== null) {
1361
+ if (data.nextToken != null) {
1620
1362
  contents.nextToken = __expectString(data.nextToken);
1621
1363
  }
1622
- return [2, Promise.resolve(contents)];
1364
+ return [2, contents];
1623
1365
  }
1624
1366
  });
1625
1367
  }); };
1626
1368
  var deserializeAws_restJson1ListApplicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1627
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1369
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1628
1370
  var _c;
1629
1371
  return __generator(this, function (_d) {
1630
1372
  switch (_d.label) {
@@ -1649,14 +1391,14 @@ var deserializeAws_restJson1ListApplicationsCommandError = function (output, con
1649
1391
  case 5: throw _d.sent();
1650
1392
  case 6:
1651
1393
  parsedBody = parsedOutput.body;
1652
- $metadata = deserializeMetadata(output);
1653
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1654
- response = new __BaseException({
1655
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1656
- $fault: "client",
1657
- $metadata: $metadata,
1394
+ throwDefaultError({
1395
+ output: output,
1396
+ parsedBody: parsedBody,
1397
+ exceptionCtor: __BaseException,
1398
+ errorCode: errorCode,
1658
1399
  });
1659
- throw __decorateServiceException(response, parsedBody);
1400
+ _d.label = 7;
1401
+ case 7: return [2];
1660
1402
  }
1661
1403
  });
1662
1404
  }); };
@@ -1668,28 +1410,26 @@ export var deserializeAws_restJson1ListAssociatedAttributeGroupsCommand = functi
1668
1410
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1669
1411
  return [2, deserializeAws_restJson1ListAssociatedAttributeGroupsCommandError(output, context)];
1670
1412
  }
1671
- contents = {
1413
+ contents = map({
1672
1414
  $metadata: deserializeMetadata(output),
1673
- attributeGroups: undefined,
1674
- nextToken: undefined,
1675
- };
1415
+ });
1676
1416
  _a = __expectNonNull;
1677
1417
  _b = __expectObject;
1678
1418
  return [4, parseBody(output.body, context)];
1679
1419
  case 1:
1680
1420
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1681
- if (data.attributeGroups !== undefined && data.attributeGroups !== null) {
1421
+ if (data.attributeGroups != null) {
1682
1422
  contents.attributeGroups = deserializeAws_restJson1AttributeGroupIds(data.attributeGroups, context);
1683
1423
  }
1684
- if (data.nextToken !== undefined && data.nextToken !== null) {
1424
+ if (data.nextToken != null) {
1685
1425
  contents.nextToken = __expectString(data.nextToken);
1686
1426
  }
1687
- return [2, Promise.resolve(contents)];
1427
+ return [2, contents];
1688
1428
  }
1689
1429
  });
1690
1430
  }); };
1691
1431
  var deserializeAws_restJson1ListAssociatedAttributeGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1692
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1432
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1693
1433
  var _c;
1694
1434
  return __generator(this, function (_d) {
1695
1435
  switch (_d.label) {
@@ -1718,14 +1458,14 @@ var deserializeAws_restJson1ListAssociatedAttributeGroupsCommandError = function
1718
1458
  case 7: throw _d.sent();
1719
1459
  case 8:
1720
1460
  parsedBody = parsedOutput.body;
1721
- $metadata = deserializeMetadata(output);
1722
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1723
- response = new __BaseException({
1724
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1725
- $fault: "client",
1726
- $metadata: $metadata,
1461
+ throwDefaultError({
1462
+ output: output,
1463
+ parsedBody: parsedBody,
1464
+ exceptionCtor: __BaseException,
1465
+ errorCode: errorCode,
1727
1466
  });
1728
- throw __decorateServiceException(response, parsedBody);
1467
+ _d.label = 9;
1468
+ case 9: return [2];
1729
1469
  }
1730
1470
  });
1731
1471
  }); };
@@ -1737,28 +1477,26 @@ export var deserializeAws_restJson1ListAssociatedResourcesCommand = function (ou
1737
1477
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1738
1478
  return [2, deserializeAws_restJson1ListAssociatedResourcesCommandError(output, context)];
1739
1479
  }
1740
- contents = {
1480
+ contents = map({
1741
1481
  $metadata: deserializeMetadata(output),
1742
- nextToken: undefined,
1743
- resources: undefined,
1744
- };
1482
+ });
1745
1483
  _a = __expectNonNull;
1746
1484
  _b = __expectObject;
1747
1485
  return [4, parseBody(output.body, context)];
1748
1486
  case 1:
1749
1487
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1750
- if (data.nextToken !== undefined && data.nextToken !== null) {
1488
+ if (data.nextToken != null) {
1751
1489
  contents.nextToken = __expectString(data.nextToken);
1752
1490
  }
1753
- if (data.resources !== undefined && data.resources !== null) {
1491
+ if (data.resources != null) {
1754
1492
  contents.resources = deserializeAws_restJson1Resources(data.resources, context);
1755
1493
  }
1756
- return [2, Promise.resolve(contents)];
1494
+ return [2, contents];
1757
1495
  }
1758
1496
  });
1759
1497
  }); };
1760
1498
  var deserializeAws_restJson1ListAssociatedResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1761
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1499
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1762
1500
  var _c;
1763
1501
  return __generator(this, function (_d) {
1764
1502
  switch (_d.label) {
@@ -1787,14 +1525,14 @@ var deserializeAws_restJson1ListAssociatedResourcesCommandError = function (outp
1787
1525
  case 7: throw _d.sent();
1788
1526
  case 8:
1789
1527
  parsedBody = parsedOutput.body;
1790
- $metadata = deserializeMetadata(output);
1791
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1792
- response = new __BaseException({
1793
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1794
- $fault: "client",
1795
- $metadata: $metadata,
1528
+ throwDefaultError({
1529
+ output: output,
1530
+ parsedBody: parsedBody,
1531
+ exceptionCtor: __BaseException,
1532
+ errorCode: errorCode,
1796
1533
  });
1797
- throw __decorateServiceException(response, parsedBody);
1534
+ _d.label = 9;
1535
+ case 9: return [2];
1798
1536
  }
1799
1537
  });
1800
1538
  }); };
@@ -1806,28 +1544,26 @@ export var deserializeAws_restJson1ListAttributeGroupsCommand = function (output
1806
1544
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1807
1545
  return [2, deserializeAws_restJson1ListAttributeGroupsCommandError(output, context)];
1808
1546
  }
1809
- contents = {
1547
+ contents = map({
1810
1548
  $metadata: deserializeMetadata(output),
1811
- attributeGroups: undefined,
1812
- nextToken: undefined,
1813
- };
1549
+ });
1814
1550
  _a = __expectNonNull;
1815
1551
  _b = __expectObject;
1816
1552
  return [4, parseBody(output.body, context)];
1817
1553
  case 1:
1818
1554
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1819
- if (data.attributeGroups !== undefined && data.attributeGroups !== null) {
1555
+ if (data.attributeGroups != null) {
1820
1556
  contents.attributeGroups = deserializeAws_restJson1AttributeGroupSummaries(data.attributeGroups, context);
1821
1557
  }
1822
- if (data.nextToken !== undefined && data.nextToken !== null) {
1558
+ if (data.nextToken != null) {
1823
1559
  contents.nextToken = __expectString(data.nextToken);
1824
1560
  }
1825
- return [2, Promise.resolve(contents)];
1561
+ return [2, contents];
1826
1562
  }
1827
1563
  });
1828
1564
  }); };
1829
1565
  var deserializeAws_restJson1ListAttributeGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1830
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1566
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1831
1567
  var _c;
1832
1568
  return __generator(this, function (_d) {
1833
1569
  switch (_d.label) {
@@ -1852,14 +1588,14 @@ var deserializeAws_restJson1ListAttributeGroupsCommandError = function (output,
1852
1588
  case 5: throw _d.sent();
1853
1589
  case 6:
1854
1590
  parsedBody = parsedOutput.body;
1855
- $metadata = deserializeMetadata(output);
1856
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1857
- response = new __BaseException({
1858
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1859
- $fault: "client",
1860
- $metadata: $metadata,
1591
+ throwDefaultError({
1592
+ output: output,
1593
+ parsedBody: parsedBody,
1594
+ exceptionCtor: __BaseException,
1595
+ errorCode: errorCode,
1861
1596
  });
1862
- throw __decorateServiceException(response, parsedBody);
1597
+ _d.label = 7;
1598
+ case 7: return [2];
1863
1599
  }
1864
1600
  });
1865
1601
  }); };
@@ -1871,28 +1607,26 @@ export var deserializeAws_restJson1ListAttributeGroupsForApplicationCommand = fu
1871
1607
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1872
1608
  return [2, deserializeAws_restJson1ListAttributeGroupsForApplicationCommandError(output, context)];
1873
1609
  }
1874
- contents = {
1610
+ contents = map({
1875
1611
  $metadata: deserializeMetadata(output),
1876
- attributeGroupsDetails: undefined,
1877
- nextToken: undefined,
1878
- };
1612
+ });
1879
1613
  _a = __expectNonNull;
1880
1614
  _b = __expectObject;
1881
1615
  return [4, parseBody(output.body, context)];
1882
1616
  case 1:
1883
1617
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1884
- if (data.attributeGroupsDetails !== undefined && data.attributeGroupsDetails !== null) {
1618
+ if (data.attributeGroupsDetails != null) {
1885
1619
  contents.attributeGroupsDetails = deserializeAws_restJson1AttributeGroupDetailsList(data.attributeGroupsDetails, context);
1886
1620
  }
1887
- if (data.nextToken !== undefined && data.nextToken !== null) {
1621
+ if (data.nextToken != null) {
1888
1622
  contents.nextToken = __expectString(data.nextToken);
1889
1623
  }
1890
- return [2, Promise.resolve(contents)];
1624
+ return [2, contents];
1891
1625
  }
1892
1626
  });
1893
1627
  }); };
1894
1628
  var deserializeAws_restJson1ListAttributeGroupsForApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1895
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1629
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1896
1630
  var _c;
1897
1631
  return __generator(this, function (_d) {
1898
1632
  switch (_d.label) {
@@ -1921,14 +1655,14 @@ var deserializeAws_restJson1ListAttributeGroupsForApplicationCommandError = func
1921
1655
  case 7: throw _d.sent();
1922
1656
  case 8:
1923
1657
  parsedBody = parsedOutput.body;
1924
- $metadata = deserializeMetadata(output);
1925
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1926
- response = new __BaseException({
1927
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1928
- $fault: "client",
1929
- $metadata: $metadata,
1658
+ throwDefaultError({
1659
+ output: output,
1660
+ parsedBody: parsedBody,
1661
+ exceptionCtor: __BaseException,
1662
+ errorCode: errorCode,
1930
1663
  });
1931
- throw __decorateServiceException(response, parsedBody);
1664
+ _d.label = 9;
1665
+ case 9: return [2];
1932
1666
  }
1933
1667
  });
1934
1668
  }); };
@@ -1940,24 +1674,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1940
1674
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1941
1675
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1942
1676
  }
1943
- contents = {
1677
+ contents = map({
1944
1678
  $metadata: deserializeMetadata(output),
1945
- tags: undefined,
1946
- };
1679
+ });
1947
1680
  _a = __expectNonNull;
1948
1681
  _b = __expectObject;
1949
1682
  return [4, parseBody(output.body, context)];
1950
1683
  case 1:
1951
1684
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1952
- if (data.tags !== undefined && data.tags !== null) {
1685
+ if (data.tags != null) {
1953
1686
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
1954
1687
  }
1955
- return [2, Promise.resolve(contents)];
1688
+ return [2, contents];
1956
1689
  }
1957
1690
  });
1958
1691
  }); };
1959
1692
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1960
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1693
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1961
1694
  var _c;
1962
1695
  return __generator(this, function (_d) {
1963
1696
  switch (_d.label) {
@@ -1986,14 +1719,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1986
1719
  case 7: throw _d.sent();
1987
1720
  case 8:
1988
1721
  parsedBody = parsedOutput.body;
1989
- $metadata = deserializeMetadata(output);
1990
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1991
- response = new __BaseException({
1992
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1993
- $fault: "client",
1994
- $metadata: $metadata,
1722
+ throwDefaultError({
1723
+ output: output,
1724
+ parsedBody: parsedBody,
1725
+ exceptionCtor: __BaseException,
1726
+ errorCode: errorCode,
1995
1727
  });
1996
- throw __decorateServiceException(response, parsedBody);
1728
+ _d.label = 9;
1729
+ case 9: return [2];
1997
1730
  }
1998
1731
  });
1999
1732
  }); };
@@ -2005,32 +1738,29 @@ export var deserializeAws_restJson1SyncResourceCommand = function (output, conte
2005
1738
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2006
1739
  return [2, deserializeAws_restJson1SyncResourceCommandError(output, context)];
2007
1740
  }
2008
- contents = {
1741
+ contents = map({
2009
1742
  $metadata: deserializeMetadata(output),
2010
- actionTaken: undefined,
2011
- applicationArn: undefined,
2012
- resourceArn: undefined,
2013
- };
1743
+ });
2014
1744
  _a = __expectNonNull;
2015
1745
  _b = __expectObject;
2016
1746
  return [4, parseBody(output.body, context)];
2017
1747
  case 1:
2018
1748
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2019
- if (data.actionTaken !== undefined && data.actionTaken !== null) {
1749
+ if (data.actionTaken != null) {
2020
1750
  contents.actionTaken = __expectString(data.actionTaken);
2021
1751
  }
2022
- if (data.applicationArn !== undefined && data.applicationArn !== null) {
1752
+ if (data.applicationArn != null) {
2023
1753
  contents.applicationArn = __expectString(data.applicationArn);
2024
1754
  }
2025
- if (data.resourceArn !== undefined && data.resourceArn !== null) {
1755
+ if (data.resourceArn != null) {
2026
1756
  contents.resourceArn = __expectString(data.resourceArn);
2027
1757
  }
2028
- return [2, Promise.resolve(contents)];
1758
+ return [2, contents];
2029
1759
  }
2030
1760
  });
2031
1761
  }); };
2032
1762
  var deserializeAws_restJson1SyncResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2033
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1763
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2034
1764
  var _c;
2035
1765
  return __generator(this, function (_d) {
2036
1766
  switch (_d.label) {
@@ -2059,14 +1789,14 @@ var deserializeAws_restJson1SyncResourceCommandError = function (output, context
2059
1789
  case 7: throw _d.sent();
2060
1790
  case 8:
2061
1791
  parsedBody = parsedOutput.body;
2062
- $metadata = deserializeMetadata(output);
2063
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2064
- response = new __BaseException({
2065
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2066
- $fault: "client",
2067
- $metadata: $metadata,
1792
+ throwDefaultError({
1793
+ output: output,
1794
+ parsedBody: parsedBody,
1795
+ exceptionCtor: __BaseException,
1796
+ errorCode: errorCode,
2068
1797
  });
2069
- throw __decorateServiceException(response, parsedBody);
1798
+ _d.label = 9;
1799
+ case 9: return [2];
2070
1800
  }
2071
1801
  });
2072
1802
  }); };
@@ -2078,18 +1808,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2078
1808
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2079
1809
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2080
1810
  }
2081
- contents = {
1811
+ contents = map({
2082
1812
  $metadata: deserializeMetadata(output),
2083
- };
1813
+ });
2084
1814
  return [4, collectBody(output.body, context)];
2085
1815
  case 1:
2086
1816
  _a.sent();
2087
- return [2, Promise.resolve(contents)];
1817
+ return [2, contents];
2088
1818
  }
2089
1819
  });
2090
1820
  }); };
2091
1821
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2092
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1822
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2093
1823
  var _c;
2094
1824
  return __generator(this, function (_d) {
2095
1825
  switch (_d.label) {
@@ -2118,14 +1848,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2118
1848
  case 7: throw _d.sent();
2119
1849
  case 8:
2120
1850
  parsedBody = parsedOutput.body;
2121
- $metadata = deserializeMetadata(output);
2122
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2123
- response = new __BaseException({
2124
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2125
- $fault: "client",
2126
- $metadata: $metadata,
1851
+ throwDefaultError({
1852
+ output: output,
1853
+ parsedBody: parsedBody,
1854
+ exceptionCtor: __BaseException,
1855
+ errorCode: errorCode,
2127
1856
  });
2128
- throw __decorateServiceException(response, parsedBody);
1857
+ _d.label = 9;
1858
+ case 9: return [2];
2129
1859
  }
2130
1860
  });
2131
1861
  }); };
@@ -2137,18 +1867,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2137
1867
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2138
1868
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2139
1869
  }
2140
- contents = {
1870
+ contents = map({
2141
1871
  $metadata: deserializeMetadata(output),
2142
- };
1872
+ });
2143
1873
  return [4, collectBody(output.body, context)];
2144
1874
  case 1:
2145
1875
  _a.sent();
2146
- return [2, Promise.resolve(contents)];
1876
+ return [2, contents];
2147
1877
  }
2148
1878
  });
2149
1879
  }); };
2150
1880
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2151
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1881
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2152
1882
  var _c;
2153
1883
  return __generator(this, function (_d) {
2154
1884
  switch (_d.label) {
@@ -2177,14 +1907,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2177
1907
  case 7: throw _d.sent();
2178
1908
  case 8:
2179
1909
  parsedBody = parsedOutput.body;
2180
- $metadata = deserializeMetadata(output);
2181
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2182
- response = new __BaseException({
2183
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2184
- $fault: "client",
2185
- $metadata: $metadata,
1910
+ throwDefaultError({
1911
+ output: output,
1912
+ parsedBody: parsedBody,
1913
+ exceptionCtor: __BaseException,
1914
+ errorCode: errorCode,
2186
1915
  });
2187
- throw __decorateServiceException(response, parsedBody);
1916
+ _d.label = 9;
1917
+ case 9: return [2];
2188
1918
  }
2189
1919
  });
2190
1920
  }); };
@@ -2196,24 +1926,23 @@ export var deserializeAws_restJson1UpdateApplicationCommand = function (output,
2196
1926
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2197
1927
  return [2, deserializeAws_restJson1UpdateApplicationCommandError(output, context)];
2198
1928
  }
2199
- contents = {
1929
+ contents = map({
2200
1930
  $metadata: deserializeMetadata(output),
2201
- application: undefined,
2202
- };
1931
+ });
2203
1932
  _a = __expectNonNull;
2204
1933
  _b = __expectObject;
2205
1934
  return [4, parseBody(output.body, context)];
2206
1935
  case 1:
2207
1936
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2208
- if (data.application !== undefined && data.application !== null) {
1937
+ if (data.application != null) {
2209
1938
  contents.application = deserializeAws_restJson1Application(data.application, context);
2210
1939
  }
2211
- return [2, Promise.resolve(contents)];
1940
+ return [2, contents];
2212
1941
  }
2213
1942
  });
2214
1943
  }); };
2215
1944
  var deserializeAws_restJson1UpdateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2216
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1945
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2217
1946
  var _c;
2218
1947
  return __generator(this, function (_d) {
2219
1948
  switch (_d.label) {
@@ -2246,14 +1975,14 @@ var deserializeAws_restJson1UpdateApplicationCommandError = function (output, co
2246
1975
  case 9: throw _d.sent();
2247
1976
  case 10:
2248
1977
  parsedBody = parsedOutput.body;
2249
- $metadata = deserializeMetadata(output);
2250
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2251
- response = new __BaseException({
2252
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2253
- $fault: "client",
2254
- $metadata: $metadata,
1978
+ throwDefaultError({
1979
+ output: output,
1980
+ parsedBody: parsedBody,
1981
+ exceptionCtor: __BaseException,
1982
+ errorCode: errorCode,
2255
1983
  });
2256
- throw __decorateServiceException(response, parsedBody);
1984
+ _d.label = 11;
1985
+ case 11: return [2];
2257
1986
  }
2258
1987
  });
2259
1988
  }); };
@@ -2265,24 +1994,23 @@ export var deserializeAws_restJson1UpdateAttributeGroupCommand = function (outpu
2265
1994
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2266
1995
  return [2, deserializeAws_restJson1UpdateAttributeGroupCommandError(output, context)];
2267
1996
  }
2268
- contents = {
1997
+ contents = map({
2269
1998
  $metadata: deserializeMetadata(output),
2270
- attributeGroup: undefined,
2271
- };
1999
+ });
2272
2000
  _a = __expectNonNull;
2273
2001
  _b = __expectObject;
2274
2002
  return [4, parseBody(output.body, context)];
2275
2003
  case 1:
2276
2004
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2277
- if (data.attributeGroup !== undefined && data.attributeGroup !== null) {
2005
+ if (data.attributeGroup != null) {
2278
2006
  contents.attributeGroup = deserializeAws_restJson1AttributeGroup(data.attributeGroup, context);
2279
2007
  }
2280
- return [2, Promise.resolve(contents)];
2008
+ return [2, contents];
2281
2009
  }
2282
2010
  });
2283
2011
  }); };
2284
2012
  var deserializeAws_restJson1UpdateAttributeGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2285
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2013
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2286
2014
  var _c;
2287
2015
  return __generator(this, function (_d) {
2288
2016
  switch (_d.label) {
@@ -2315,23 +2043,24 @@ var deserializeAws_restJson1UpdateAttributeGroupCommandError = function (output,
2315
2043
  case 9: throw _d.sent();
2316
2044
  case 10:
2317
2045
  parsedBody = parsedOutput.body;
2318
- $metadata = deserializeMetadata(output);
2319
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2320
- response = new __BaseException({
2321
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2322
- $fault: "client",
2323
- $metadata: $metadata,
2046
+ throwDefaultError({
2047
+ output: output,
2048
+ parsedBody: parsedBody,
2049
+ exceptionCtor: __BaseException,
2050
+ errorCode: errorCode,
2324
2051
  });
2325
- throw __decorateServiceException(response, parsedBody);
2052
+ _d.label = 11;
2053
+ case 11: return [2];
2326
2054
  }
2327
2055
  });
2328
2056
  }); };
2057
+ var map = __map;
2329
2058
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2330
2059
  var contents, data, exception;
2331
2060
  return __generator(this, function (_a) {
2332
- contents = {};
2061
+ contents = map({});
2333
2062
  data = parsedOutput.body;
2334
- if (data.message !== undefined && data.message !== null) {
2063
+ if (data.message != null) {
2335
2064
  contents.message = __expectString(data.message);
2336
2065
  }
2337
2066
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2341,9 +2070,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
2341
2070
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2342
2071
  var contents, data, exception;
2343
2072
  return __generator(this, function (_a) {
2344
- contents = {};
2073
+ contents = map({});
2345
2074
  data = parsedOutput.body;
2346
- if (data.message !== undefined && data.message !== null) {
2075
+ if (data.message != null) {
2347
2076
  contents.message = __expectString(data.message);
2348
2077
  }
2349
2078
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2353,9 +2082,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
2353
2082
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2354
2083
  var contents, data, exception;
2355
2084
  return __generator(this, function (_a) {
2356
- contents = {};
2085
+ contents = map({});
2357
2086
  data = parsedOutput.body;
2358
- if (data.message !== undefined && data.message !== null) {
2087
+ if (data.message != null) {
2359
2088
  contents.message = __expectString(data.message);
2360
2089
  }
2361
2090
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2365,9 +2094,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
2365
2094
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2366
2095
  var contents, data, exception;
2367
2096
  return __generator(this, function (_a) {
2368
- contents = {};
2097
+ contents = map({});
2369
2098
  data = parsedOutput.body;
2370
- if (data.message !== undefined && data.message !== null) {
2099
+ if (data.message != null) {
2371
2100
  contents.message = __expectString(data.message);
2372
2101
  }
2373
2102
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2377,9 +2106,9 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
2377
2106
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2378
2107
  var contents, data, exception;
2379
2108
  return __generator(this, function (_a) {
2380
- contents = {};
2109
+ contents = map({});
2381
2110
  data = parsedOutput.body;
2382
- if (data.message !== undefined && data.message !== null) {
2111
+ if (data.message != null) {
2383
2112
  contents.message = __expectString(data.message);
2384
2113
  }
2385
2114
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));