@aws-sdk/client-serverlessapplicationrepository 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { BadRequestException, ConflictException, ForbiddenException, InternalServerErrorException, NotFoundException, TooManyRequestsException, } from "../models/models_0";
5
5
  import { ServerlessApplicationRepositoryServiceException as __BaseException } from "../models/ServerlessApplicationRepositoryServiceException";
6
6
  export var serializeAws_restJson1CreateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -28,7 +28,7 @@ export var serializeAws_restJson1CreateApplicationCommand = function (input, con
28
28
  });
29
29
  }); };
30
30
  export var serializeAws_restJson1CreateApplicationVersionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
31
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
31
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
32
32
  return __generator(this, function (_c) {
33
33
  switch (_c.label) {
34
34
  case 0: return [4, context.endpoint()];
@@ -39,26 +39,8 @@ export var serializeAws_restJson1CreateApplicationVersionCommand = function (inp
39
39
  };
40
40
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
41
41
  "/applications/{ApplicationId}/versions/{SemanticVersion}";
42
- if (input.ApplicationId !== undefined) {
43
- labelValue = input.ApplicationId;
44
- if (labelValue.length <= 0) {
45
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
46
- }
47
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
48
- }
49
- else {
50
- throw new Error("No value provided for input HTTP label: ApplicationId.");
51
- }
52
- if (input.SemanticVersion !== undefined) {
53
- labelValue = input.SemanticVersion;
54
- if (labelValue.length <= 0) {
55
- throw new Error("Empty value provided for input HTTP label: SemanticVersion.");
56
- }
57
- resolvedPath = resolvedPath.replace("{SemanticVersion}", __extendedEncodeURIComponent(labelValue));
58
- }
59
- else {
60
- throw new Error("No value provided for input HTTP label: SemanticVersion.");
61
- }
42
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "SemanticVersion", function () { return input.SemanticVersion; }, "{SemanticVersion}", false);
62
44
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.SourceCodeArchiveUrl != null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl })), (input.SourceCodeUrl != null && { sourceCodeUrl: input.SourceCodeUrl })), (input.TemplateBody != null && { templateBody: input.TemplateBody })), (input.TemplateUrl != null && { templateUrl: input.TemplateUrl })));
63
45
  return [2, new __HttpRequest({
64
46
  protocol: protocol,
@@ -73,7 +55,7 @@ export var serializeAws_restJson1CreateApplicationVersionCommand = function (inp
73
55
  });
74
56
  }); };
75
57
  export var serializeAws_restJson1CreateCloudFormationChangeSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
76
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
58
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
77
59
  return __generator(this, function (_c) {
78
60
  switch (_c.label) {
79
61
  case 0: return [4, context.endpoint()];
@@ -83,16 +65,7 @@ export var serializeAws_restJson1CreateCloudFormationChangeSetCommand = function
83
65
  "content-type": "application/json",
84
66
  };
85
67
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/changesets";
86
- if (input.ApplicationId !== undefined) {
87
- labelValue = input.ApplicationId;
88
- if (labelValue.length <= 0) {
89
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
90
- }
91
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
92
- }
93
- else {
94
- throw new Error("No value provided for input HTTP label: ApplicationId.");
95
- }
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
96
69
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Capabilities != null && {
97
70
  capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context),
98
71
  })), (input.ChangeSetName != null && { changeSetName: input.ChangeSetName })), (input.ClientToken != null && { clientToken: input.ClientToken })), (input.Description != null && { description: input.Description })), (input.NotificationArns != null && {
@@ -117,7 +90,7 @@ export var serializeAws_restJson1CreateCloudFormationChangeSetCommand = function
117
90
  });
118
91
  }); };
119
92
  export var serializeAws_restJson1CreateCloudFormationTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
120
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
93
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
121
94
  return __generator(this, function (_c) {
122
95
  switch (_c.label) {
123
96
  case 0: return [4, context.endpoint()];
@@ -127,16 +100,7 @@ export var serializeAws_restJson1CreateCloudFormationTemplateCommand = function
127
100
  "content-type": "application/json",
128
101
  };
129
102
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/templates";
130
- if (input.ApplicationId !== undefined) {
131
- labelValue = input.ApplicationId;
132
- if (labelValue.length <= 0) {
133
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
134
- }
135
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
136
- }
137
- else {
138
- throw new Error("No value provided for input HTTP label: ApplicationId.");
139
- }
103
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
140
104
  body = JSON.stringify(__assign({}, (input.SemanticVersion != null && { semanticVersion: input.SemanticVersion })));
141
105
  return [2, new __HttpRequest({
142
106
  protocol: protocol,
@@ -151,7 +115,7 @@ export var serializeAws_restJson1CreateCloudFormationTemplateCommand = function
151
115
  });
152
116
  }); };
153
117
  export var serializeAws_restJson1DeleteApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
154
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
118
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
155
119
  return __generator(this, function (_c) {
156
120
  switch (_c.label) {
157
121
  case 0: return [4, context.endpoint()];
@@ -159,16 +123,7 @@ export var serializeAws_restJson1DeleteApplicationCommand = function (input, con
159
123
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
160
124
  headers = {};
161
125
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
162
- if (input.ApplicationId !== undefined) {
163
- labelValue = input.ApplicationId;
164
- if (labelValue.length <= 0) {
165
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
166
- }
167
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
168
- }
169
- else {
170
- throw new Error("No value provided for input HTTP label: ApplicationId.");
171
- }
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
172
127
  return [2, new __HttpRequest({
173
128
  protocol: protocol,
174
129
  hostname: hostname,
@@ -182,7 +137,7 @@ export var serializeAws_restJson1DeleteApplicationCommand = function (input, con
182
137
  });
183
138
  }); };
184
139
  export var serializeAws_restJson1GetApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
185
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
140
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
186
141
  return __generator(this, function (_c) {
187
142
  switch (_c.label) {
188
143
  case 0: return [4, context.endpoint()];
@@ -190,17 +145,10 @@ export var serializeAws_restJson1GetApplicationCommand = function (input, contex
190
145
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
191
146
  headers = {};
192
147
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
193
- if (input.ApplicationId !== undefined) {
194
- labelValue = input.ApplicationId;
195
- if (labelValue.length <= 0) {
196
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
197
- }
198
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
199
- }
200
- else {
201
- throw new Error("No value provided for input HTTP label: ApplicationId.");
202
- }
203
- query = __assign({}, (input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }));
148
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
149
+ query = map({
150
+ semanticVersion: [, input.SemanticVersion],
151
+ });
204
152
  return [2, new __HttpRequest({
205
153
  protocol: protocol,
206
154
  hostname: hostname,
@@ -215,7 +163,7 @@ export var serializeAws_restJson1GetApplicationCommand = function (input, contex
215
163
  });
216
164
  }); };
217
165
  export var serializeAws_restJson1GetApplicationPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
218
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
166
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
219
167
  return __generator(this, function (_c) {
220
168
  switch (_c.label) {
221
169
  case 0: return [4, context.endpoint()];
@@ -223,16 +171,7 @@ export var serializeAws_restJson1GetApplicationPolicyCommand = function (input,
223
171
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
224
172
  headers = {};
225
173
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/policy";
226
- if (input.ApplicationId !== undefined) {
227
- labelValue = input.ApplicationId;
228
- if (labelValue.length <= 0) {
229
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
230
- }
231
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
232
- }
233
- else {
234
- throw new Error("No value provided for input HTTP label: ApplicationId.");
235
- }
174
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
236
175
  return [2, new __HttpRequest({
237
176
  protocol: protocol,
238
177
  hostname: hostname,
@@ -246,7 +185,7 @@ export var serializeAws_restJson1GetApplicationPolicyCommand = function (input,
246
185
  });
247
186
  }); };
248
187
  export var serializeAws_restJson1GetCloudFormationTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
249
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
188
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
250
189
  return __generator(this, function (_c) {
251
190
  switch (_c.label) {
252
191
  case 0: return [4, context.endpoint()];
@@ -255,26 +194,8 @@ export var serializeAws_restJson1GetCloudFormationTemplateCommand = function (in
255
194
  headers = {};
256
195
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
257
196
  "/applications/{ApplicationId}/templates/{TemplateId}";
258
- if (input.ApplicationId !== undefined) {
259
- labelValue = input.ApplicationId;
260
- if (labelValue.length <= 0) {
261
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
262
- }
263
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
264
- }
265
- else {
266
- throw new Error("No value provided for input HTTP label: ApplicationId.");
267
- }
268
- if (input.TemplateId !== undefined) {
269
- labelValue = input.TemplateId;
270
- if (labelValue.length <= 0) {
271
- throw new Error("Empty value provided for input HTTP label: TemplateId.");
272
- }
273
- resolvedPath = resolvedPath.replace("{TemplateId}", __extendedEncodeURIComponent(labelValue));
274
- }
275
- else {
276
- throw new Error("No value provided for input HTTP label: TemplateId.");
277
- }
197
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
198
+ resolvedPath = __resolvedPath(resolvedPath, input, "TemplateId", function () { return input.TemplateId; }, "{TemplateId}", false);
278
199
  return [2, new __HttpRequest({
279
200
  protocol: protocol,
280
201
  hostname: hostname,
@@ -288,7 +209,7 @@ export var serializeAws_restJson1GetCloudFormationTemplateCommand = function (in
288
209
  });
289
210
  }); };
290
211
  export var serializeAws_restJson1ListApplicationDependenciesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
291
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
212
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
292
213
  return __generator(this, function (_c) {
293
214
  switch (_c.label) {
294
215
  case 0: return [4, context.endpoint()];
@@ -297,17 +218,12 @@ export var serializeAws_restJson1ListApplicationDependenciesCommand = function (
297
218
  headers = {};
298
219
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
299
220
  "/applications/{ApplicationId}/dependencies";
300
- if (input.ApplicationId !== undefined) {
301
- labelValue = input.ApplicationId;
302
- if (labelValue.length <= 0) {
303
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
304
- }
305
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
306
- }
307
- else {
308
- throw new Error("No value provided for input HTTP label: ApplicationId.");
309
- }
310
- query = __assign(__assign(__assign({}, (input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }));
221
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
222
+ query = map({
223
+ maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
224
+ nextToken: [, input.NextToken],
225
+ semanticVersion: [, input.SemanticVersion],
226
+ });
311
227
  return [2, new __HttpRequest({
312
228
  protocol: protocol,
313
229
  hostname: hostname,
@@ -330,7 +246,10 @@ export var serializeAws_restJson1ListApplicationsCommand = function (input, cont
330
246
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
331
247
  headers = {};
332
248
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications";
333
- query = __assign(__assign({}, (input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
249
+ query = map({
250
+ maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
251
+ nextToken: [, input.NextToken],
252
+ });
334
253
  return [2, new __HttpRequest({
335
254
  protocol: protocol,
336
255
  hostname: hostname,
@@ -345,7 +264,7 @@ export var serializeAws_restJson1ListApplicationsCommand = function (input, cont
345
264
  });
346
265
  }); };
347
266
  export var serializeAws_restJson1ListApplicationVersionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
348
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
267
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
349
268
  return __generator(this, function (_c) {
350
269
  switch (_c.label) {
351
270
  case 0: return [4, context.endpoint()];
@@ -353,17 +272,11 @@ export var serializeAws_restJson1ListApplicationVersionsCommand = function (inpu
353
272
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
354
273
  headers = {};
355
274
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/versions";
356
- if (input.ApplicationId !== undefined) {
357
- labelValue = input.ApplicationId;
358
- if (labelValue.length <= 0) {
359
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
360
- }
361
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
362
- }
363
- else {
364
- throw new Error("No value provided for input HTTP label: ApplicationId.");
365
- }
366
- query = __assign(__assign({}, (input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
275
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
276
+ query = map({
277
+ maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
278
+ nextToken: [, input.NextToken],
279
+ });
367
280
  return [2, new __HttpRequest({
368
281
  protocol: protocol,
369
282
  hostname: hostname,
@@ -378,7 +291,7 @@ export var serializeAws_restJson1ListApplicationVersionsCommand = function (inpu
378
291
  });
379
292
  }); };
380
293
  export var serializeAws_restJson1PutApplicationPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
381
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
294
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
382
295
  return __generator(this, function (_c) {
383
296
  switch (_c.label) {
384
297
  case 0: return [4, context.endpoint()];
@@ -388,16 +301,7 @@ export var serializeAws_restJson1PutApplicationPolicyCommand = function (input,
388
301
  "content-type": "application/json",
389
302
  };
390
303
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/policy";
391
- if (input.ApplicationId !== undefined) {
392
- labelValue = input.ApplicationId;
393
- if (labelValue.length <= 0) {
394
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
395
- }
396
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
397
- }
398
- else {
399
- throw new Error("No value provided for input HTTP label: ApplicationId.");
400
- }
304
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
401
305
  body = JSON.stringify(__assign({}, (input.Statements != null && {
402
306
  statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context),
403
307
  })));
@@ -414,7 +318,7 @@ export var serializeAws_restJson1PutApplicationPolicyCommand = function (input,
414
318
  });
415
319
  }); };
416
320
  export var serializeAws_restJson1UnshareApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
417
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
321
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
418
322
  return __generator(this, function (_c) {
419
323
  switch (_c.label) {
420
324
  case 0: return [4, context.endpoint()];
@@ -424,16 +328,7 @@ export var serializeAws_restJson1UnshareApplicationCommand = function (input, co
424
328
  "content-type": "application/json",
425
329
  };
426
330
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/unshare";
427
- if (input.ApplicationId !== undefined) {
428
- labelValue = input.ApplicationId;
429
- if (labelValue.length <= 0) {
430
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
431
- }
432
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
433
- }
434
- else {
435
- throw new Error("No value provided for input HTTP label: ApplicationId.");
436
- }
331
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
437
332
  body = JSON.stringify(__assign({}, (input.OrganizationId != null && { organizationId: input.OrganizationId })));
438
333
  return [2, new __HttpRequest({
439
334
  protocol: protocol,
@@ -448,7 +343,7 @@ export var serializeAws_restJson1UnshareApplicationCommand = function (input, co
448
343
  });
449
344
  }); };
450
345
  export var serializeAws_restJson1UpdateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
451
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
346
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
452
347
  return __generator(this, function (_c) {
453
348
  switch (_c.label) {
454
349
  case 0: return [4, context.endpoint()];
@@ -458,16 +353,7 @@ export var serializeAws_restJson1UpdateApplicationCommand = function (input, con
458
353
  "content-type": "application/json",
459
354
  };
460
355
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
461
- if (input.ApplicationId !== undefined) {
462
- labelValue = input.ApplicationId;
463
- if (labelValue.length <= 0) {
464
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
465
- }
466
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
467
- }
468
- else {
469
- throw new Error("No value provided for input HTTP label: ApplicationId.");
470
- }
356
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
471
357
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Author != null && { author: input.Author })), (input.Description != null && { description: input.Description })), (input.HomePageUrl != null && { homePageUrl: input.HomePageUrl })), (input.Labels != null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) })), (input.ReadmeBody != null && { readmeBody: input.ReadmeBody })), (input.ReadmeUrl != null && { readmeUrl: input.ReadmeUrl })));
472
358
  return [2, new __HttpRequest({
473
359
  protocol: protocol,
@@ -489,72 +375,59 @@ export var deserializeAws_restJson1CreateApplicationCommand = function (output,
489
375
  if (output.statusCode !== 201 && output.statusCode >= 300) {
490
376
  return [2, deserializeAws_restJson1CreateApplicationCommandError(output, context)];
491
377
  }
492
- contents = {
378
+ contents = map({
493
379
  $metadata: deserializeMetadata(output),
494
- ApplicationId: undefined,
495
- Author: undefined,
496
- CreationTime: undefined,
497
- Description: undefined,
498
- HomePageUrl: undefined,
499
- IsVerifiedAuthor: undefined,
500
- Labels: undefined,
501
- LicenseUrl: undefined,
502
- Name: undefined,
503
- ReadmeUrl: undefined,
504
- SpdxLicenseId: undefined,
505
- VerifiedAuthorUrl: undefined,
506
- Version: undefined,
507
- };
380
+ });
508
381
  _a = __expectNonNull;
509
382
  _b = __expectObject;
510
383
  return [4, parseBody(output.body, context)];
511
384
  case 1:
512
385
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
513
- if (data.applicationId !== undefined && data.applicationId !== null) {
386
+ if (data.applicationId != null) {
514
387
  contents.ApplicationId = __expectString(data.applicationId);
515
388
  }
516
- if (data.author !== undefined && data.author !== null) {
389
+ if (data.author != null) {
517
390
  contents.Author = __expectString(data.author);
518
391
  }
519
- if (data.creationTime !== undefined && data.creationTime !== null) {
392
+ if (data.creationTime != null) {
520
393
  contents.CreationTime = __expectString(data.creationTime);
521
394
  }
522
- if (data.description !== undefined && data.description !== null) {
395
+ if (data.description != null) {
523
396
  contents.Description = __expectString(data.description);
524
397
  }
525
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
398
+ if (data.homePageUrl != null) {
526
399
  contents.HomePageUrl = __expectString(data.homePageUrl);
527
400
  }
528
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
401
+ if (data.isVerifiedAuthor != null) {
529
402
  contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
530
403
  }
531
- if (data.labels !== undefined && data.labels !== null) {
404
+ if (data.labels != null) {
532
405
  contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
533
406
  }
534
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
407
+ if (data.licenseUrl != null) {
535
408
  contents.LicenseUrl = __expectString(data.licenseUrl);
536
409
  }
537
- if (data.name !== undefined && data.name !== null) {
410
+ if (data.name != null) {
538
411
  contents.Name = __expectString(data.name);
539
412
  }
540
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
413
+ if (data.readmeUrl != null) {
541
414
  contents.ReadmeUrl = __expectString(data.readmeUrl);
542
415
  }
543
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
416
+ if (data.spdxLicenseId != null) {
544
417
  contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
545
418
  }
546
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
419
+ if (data.verifiedAuthorUrl != null) {
547
420
  contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
548
421
  }
549
- if (data.version !== undefined && data.version !== null) {
422
+ if (data.version != null) {
550
423
  contents.Version = deserializeAws_restJson1Version(data.version, context);
551
424
  }
552
- return [2, Promise.resolve(contents)];
425
+ return [2, contents];
553
426
  }
554
427
  });
555
428
  }); };
556
429
  var deserializeAws_restJson1CreateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
557
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
430
+ var parsedOutput, _a, errorCode, _b, parsedBody;
558
431
  var _c;
559
432
  return __generator(this, function (_d) {
560
433
  switch (_d.label) {
@@ -591,14 +464,14 @@ var deserializeAws_restJson1CreateApplicationCommandError = function (output, co
591
464
  case 11: throw _d.sent();
592
465
  case 12:
593
466
  parsedBody = parsedOutput.body;
594
- $metadata = deserializeMetadata(output);
595
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
596
- response = new __BaseException({
597
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
598
- $fault: "client",
599
- $metadata: $metadata,
467
+ throwDefaultError({
468
+ output: output,
469
+ parsedBody: parsedBody,
470
+ exceptionCtor: __BaseException,
471
+ errorCode: errorCode,
600
472
  });
601
- throw __decorateServiceException(response, parsedBody);
473
+ _d.label = 13;
474
+ case 13: return [2];
602
475
  }
603
476
  });
604
477
  }); };
@@ -610,56 +483,47 @@ export var deserializeAws_restJson1CreateApplicationVersionCommand = function (o
610
483
  if (output.statusCode !== 201 && output.statusCode >= 300) {
611
484
  return [2, deserializeAws_restJson1CreateApplicationVersionCommandError(output, context)];
612
485
  }
613
- contents = {
486
+ contents = map({
614
487
  $metadata: deserializeMetadata(output),
615
- ApplicationId: undefined,
616
- CreationTime: undefined,
617
- ParameterDefinitions: undefined,
618
- RequiredCapabilities: undefined,
619
- ResourcesSupported: undefined,
620
- SemanticVersion: undefined,
621
- SourceCodeArchiveUrl: undefined,
622
- SourceCodeUrl: undefined,
623
- TemplateUrl: undefined,
624
- };
488
+ });
625
489
  _a = __expectNonNull;
626
490
  _b = __expectObject;
627
491
  return [4, parseBody(output.body, context)];
628
492
  case 1:
629
493
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
630
- if (data.applicationId !== undefined && data.applicationId !== null) {
494
+ if (data.applicationId != null) {
631
495
  contents.ApplicationId = __expectString(data.applicationId);
632
496
  }
633
- if (data.creationTime !== undefined && data.creationTime !== null) {
497
+ if (data.creationTime != null) {
634
498
  contents.CreationTime = __expectString(data.creationTime);
635
499
  }
636
- if (data.parameterDefinitions !== undefined && data.parameterDefinitions !== null) {
500
+ if (data.parameterDefinitions != null) {
637
501
  contents.ParameterDefinitions = deserializeAws_restJson1__listOfParameterDefinition(data.parameterDefinitions, context);
638
502
  }
639
- if (data.requiredCapabilities !== undefined && data.requiredCapabilities !== null) {
503
+ if (data.requiredCapabilities != null) {
640
504
  contents.RequiredCapabilities = deserializeAws_restJson1__listOfCapability(data.requiredCapabilities, context);
641
505
  }
642
- if (data.resourcesSupported !== undefined && data.resourcesSupported !== null) {
506
+ if (data.resourcesSupported != null) {
643
507
  contents.ResourcesSupported = __expectBoolean(data.resourcesSupported);
644
508
  }
645
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
509
+ if (data.semanticVersion != null) {
646
510
  contents.SemanticVersion = __expectString(data.semanticVersion);
647
511
  }
648
- if (data.sourceCodeArchiveUrl !== undefined && data.sourceCodeArchiveUrl !== null) {
512
+ if (data.sourceCodeArchiveUrl != null) {
649
513
  contents.SourceCodeArchiveUrl = __expectString(data.sourceCodeArchiveUrl);
650
514
  }
651
- if (data.sourceCodeUrl !== undefined && data.sourceCodeUrl !== null) {
515
+ if (data.sourceCodeUrl != null) {
652
516
  contents.SourceCodeUrl = __expectString(data.sourceCodeUrl);
653
517
  }
654
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
518
+ if (data.templateUrl != null) {
655
519
  contents.TemplateUrl = __expectString(data.templateUrl);
656
520
  }
657
- return [2, Promise.resolve(contents)];
521
+ return [2, contents];
658
522
  }
659
523
  });
660
524
  }); };
661
525
  var deserializeAws_restJson1CreateApplicationVersionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
662
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
526
+ var parsedOutput, _a, errorCode, _b, parsedBody;
663
527
  var _c;
664
528
  return __generator(this, function (_d) {
665
529
  switch (_d.label) {
@@ -696,14 +560,14 @@ var deserializeAws_restJson1CreateApplicationVersionCommandError = function (out
696
560
  case 11: throw _d.sent();
697
561
  case 12:
698
562
  parsedBody = parsedOutput.body;
699
- $metadata = deserializeMetadata(output);
700
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
701
- response = new __BaseException({
702
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
703
- $fault: "client",
704
- $metadata: $metadata,
563
+ throwDefaultError({
564
+ output: output,
565
+ parsedBody: parsedBody,
566
+ exceptionCtor: __BaseException,
567
+ errorCode: errorCode,
705
568
  });
706
- throw __decorateServiceException(response, parsedBody);
569
+ _d.label = 13;
570
+ case 13: return [2];
707
571
  }
708
572
  });
709
573
  }); };
@@ -715,36 +579,32 @@ export var deserializeAws_restJson1CreateCloudFormationChangeSetCommand = functi
715
579
  if (output.statusCode !== 201 && output.statusCode >= 300) {
716
580
  return [2, deserializeAws_restJson1CreateCloudFormationChangeSetCommandError(output, context)];
717
581
  }
718
- contents = {
582
+ contents = map({
719
583
  $metadata: deserializeMetadata(output),
720
- ApplicationId: undefined,
721
- ChangeSetId: undefined,
722
- SemanticVersion: undefined,
723
- StackId: undefined,
724
- };
584
+ });
725
585
  _a = __expectNonNull;
726
586
  _b = __expectObject;
727
587
  return [4, parseBody(output.body, context)];
728
588
  case 1:
729
589
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
730
- if (data.applicationId !== undefined && data.applicationId !== null) {
590
+ if (data.applicationId != null) {
731
591
  contents.ApplicationId = __expectString(data.applicationId);
732
592
  }
733
- if (data.changeSetId !== undefined && data.changeSetId !== null) {
593
+ if (data.changeSetId != null) {
734
594
  contents.ChangeSetId = __expectString(data.changeSetId);
735
595
  }
736
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
596
+ if (data.semanticVersion != null) {
737
597
  contents.SemanticVersion = __expectString(data.semanticVersion);
738
598
  }
739
- if (data.stackId !== undefined && data.stackId !== null) {
599
+ if (data.stackId != null) {
740
600
  contents.StackId = __expectString(data.stackId);
741
601
  }
742
- return [2, Promise.resolve(contents)];
602
+ return [2, contents];
743
603
  }
744
604
  });
745
605
  }); };
746
606
  var deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
747
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
607
+ var parsedOutput, _a, errorCode, _b, parsedBody;
748
608
  var _c;
749
609
  return __generator(this, function (_d) {
750
610
  switch (_d.label) {
@@ -777,14 +637,14 @@ var deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = function
777
637
  case 9: throw _d.sent();
778
638
  case 10:
779
639
  parsedBody = parsedOutput.body;
780
- $metadata = deserializeMetadata(output);
781
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
782
- response = new __BaseException({
783
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
784
- $fault: "client",
785
- $metadata: $metadata,
640
+ throwDefaultError({
641
+ output: output,
642
+ parsedBody: parsedBody,
643
+ exceptionCtor: __BaseException,
644
+ errorCode: errorCode,
786
645
  });
787
- throw __decorateServiceException(response, parsedBody);
646
+ _d.label = 11;
647
+ case 11: return [2];
788
648
  }
789
649
  });
790
650
  }); };
@@ -796,48 +656,41 @@ export var deserializeAws_restJson1CreateCloudFormationTemplateCommand = functio
796
656
  if (output.statusCode !== 201 && output.statusCode >= 300) {
797
657
  return [2, deserializeAws_restJson1CreateCloudFormationTemplateCommandError(output, context)];
798
658
  }
799
- contents = {
659
+ contents = map({
800
660
  $metadata: deserializeMetadata(output),
801
- ApplicationId: undefined,
802
- CreationTime: undefined,
803
- ExpirationTime: undefined,
804
- SemanticVersion: undefined,
805
- Status: undefined,
806
- TemplateId: undefined,
807
- TemplateUrl: undefined,
808
- };
661
+ });
809
662
  _a = __expectNonNull;
810
663
  _b = __expectObject;
811
664
  return [4, parseBody(output.body, context)];
812
665
  case 1:
813
666
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
814
- if (data.applicationId !== undefined && data.applicationId !== null) {
667
+ if (data.applicationId != null) {
815
668
  contents.ApplicationId = __expectString(data.applicationId);
816
669
  }
817
- if (data.creationTime !== undefined && data.creationTime !== null) {
670
+ if (data.creationTime != null) {
818
671
  contents.CreationTime = __expectString(data.creationTime);
819
672
  }
820
- if (data.expirationTime !== undefined && data.expirationTime !== null) {
673
+ if (data.expirationTime != null) {
821
674
  contents.ExpirationTime = __expectString(data.expirationTime);
822
675
  }
823
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
676
+ if (data.semanticVersion != null) {
824
677
  contents.SemanticVersion = __expectString(data.semanticVersion);
825
678
  }
826
- if (data.status !== undefined && data.status !== null) {
679
+ if (data.status != null) {
827
680
  contents.Status = __expectString(data.status);
828
681
  }
829
- if (data.templateId !== undefined && data.templateId !== null) {
682
+ if (data.templateId != null) {
830
683
  contents.TemplateId = __expectString(data.templateId);
831
684
  }
832
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
685
+ if (data.templateUrl != null) {
833
686
  contents.TemplateUrl = __expectString(data.templateUrl);
834
687
  }
835
- return [2, Promise.resolve(contents)];
688
+ return [2, contents];
836
689
  }
837
690
  });
838
691
  }); };
839
692
  var deserializeAws_restJson1CreateCloudFormationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
840
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
693
+ var parsedOutput, _a, errorCode, _b, parsedBody;
841
694
  var _c;
842
695
  return __generator(this, function (_d) {
843
696
  switch (_d.label) {
@@ -874,14 +727,14 @@ var deserializeAws_restJson1CreateCloudFormationTemplateCommandError = function
874
727
  case 11: throw _d.sent();
875
728
  case 12:
876
729
  parsedBody = parsedOutput.body;
877
- $metadata = deserializeMetadata(output);
878
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
879
- response = new __BaseException({
880
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
881
- $fault: "client",
882
- $metadata: $metadata,
730
+ throwDefaultError({
731
+ output: output,
732
+ parsedBody: parsedBody,
733
+ exceptionCtor: __BaseException,
734
+ errorCode: errorCode,
883
735
  });
884
- throw __decorateServiceException(response, parsedBody);
736
+ _d.label = 13;
737
+ case 13: return [2];
885
738
  }
886
739
  });
887
740
  }); };
@@ -893,18 +746,18 @@ export var deserializeAws_restJson1DeleteApplicationCommand = function (output,
893
746
  if (output.statusCode !== 204 && output.statusCode >= 300) {
894
747
  return [2, deserializeAws_restJson1DeleteApplicationCommandError(output, context)];
895
748
  }
896
- contents = {
749
+ contents = map({
897
750
  $metadata: deserializeMetadata(output),
898
- };
751
+ });
899
752
  return [4, collectBody(output.body, context)];
900
753
  case 1:
901
754
  _a.sent();
902
- return [2, Promise.resolve(contents)];
755
+ return [2, contents];
903
756
  }
904
757
  });
905
758
  }); };
906
759
  var deserializeAws_restJson1DeleteApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
907
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
760
+ var parsedOutput, _a, errorCode, _b, parsedBody;
908
761
  var _c;
909
762
  return __generator(this, function (_d) {
910
763
  switch (_d.label) {
@@ -945,14 +798,14 @@ var deserializeAws_restJson1DeleteApplicationCommandError = function (output, co
945
798
  case 13: throw _d.sent();
946
799
  case 14:
947
800
  parsedBody = parsedOutput.body;
948
- $metadata = deserializeMetadata(output);
949
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
950
- response = new __BaseException({
951
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
952
- $fault: "client",
953
- $metadata: $metadata,
801
+ throwDefaultError({
802
+ output: output,
803
+ parsedBody: parsedBody,
804
+ exceptionCtor: __BaseException,
805
+ errorCode: errorCode,
954
806
  });
955
- throw __decorateServiceException(response, parsedBody);
807
+ _d.label = 15;
808
+ case 15: return [2];
956
809
  }
957
810
  });
958
811
  }); };
@@ -964,72 +817,59 @@ export var deserializeAws_restJson1GetApplicationCommand = function (output, con
964
817
  if (output.statusCode !== 200 && output.statusCode >= 300) {
965
818
  return [2, deserializeAws_restJson1GetApplicationCommandError(output, context)];
966
819
  }
967
- contents = {
820
+ contents = map({
968
821
  $metadata: deserializeMetadata(output),
969
- ApplicationId: undefined,
970
- Author: undefined,
971
- CreationTime: undefined,
972
- Description: undefined,
973
- HomePageUrl: undefined,
974
- IsVerifiedAuthor: undefined,
975
- Labels: undefined,
976
- LicenseUrl: undefined,
977
- Name: undefined,
978
- ReadmeUrl: undefined,
979
- SpdxLicenseId: undefined,
980
- VerifiedAuthorUrl: undefined,
981
- Version: undefined,
982
- };
822
+ });
983
823
  _a = __expectNonNull;
984
824
  _b = __expectObject;
985
825
  return [4, parseBody(output.body, context)];
986
826
  case 1:
987
827
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
988
- if (data.applicationId !== undefined && data.applicationId !== null) {
828
+ if (data.applicationId != null) {
989
829
  contents.ApplicationId = __expectString(data.applicationId);
990
830
  }
991
- if (data.author !== undefined && data.author !== null) {
831
+ if (data.author != null) {
992
832
  contents.Author = __expectString(data.author);
993
833
  }
994
- if (data.creationTime !== undefined && data.creationTime !== null) {
834
+ if (data.creationTime != null) {
995
835
  contents.CreationTime = __expectString(data.creationTime);
996
836
  }
997
- if (data.description !== undefined && data.description !== null) {
837
+ if (data.description != null) {
998
838
  contents.Description = __expectString(data.description);
999
839
  }
1000
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
840
+ if (data.homePageUrl != null) {
1001
841
  contents.HomePageUrl = __expectString(data.homePageUrl);
1002
842
  }
1003
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
843
+ if (data.isVerifiedAuthor != null) {
1004
844
  contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1005
845
  }
1006
- if (data.labels !== undefined && data.labels !== null) {
846
+ if (data.labels != null) {
1007
847
  contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1008
848
  }
1009
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
849
+ if (data.licenseUrl != null) {
1010
850
  contents.LicenseUrl = __expectString(data.licenseUrl);
1011
851
  }
1012
- if (data.name !== undefined && data.name !== null) {
852
+ if (data.name != null) {
1013
853
  contents.Name = __expectString(data.name);
1014
854
  }
1015
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
855
+ if (data.readmeUrl != null) {
1016
856
  contents.ReadmeUrl = __expectString(data.readmeUrl);
1017
857
  }
1018
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
858
+ if (data.spdxLicenseId != null) {
1019
859
  contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1020
860
  }
1021
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
861
+ if (data.verifiedAuthorUrl != null) {
1022
862
  contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1023
863
  }
1024
- if (data.version !== undefined && data.version !== null) {
864
+ if (data.version != null) {
1025
865
  contents.Version = deserializeAws_restJson1Version(data.version, context);
1026
866
  }
1027
- return [2, Promise.resolve(contents)];
867
+ return [2, contents];
1028
868
  }
1029
869
  });
1030
870
  }); };
1031
871
  var deserializeAws_restJson1GetApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1032
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
872
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1033
873
  var _c;
1034
874
  return __generator(this, function (_d) {
1035
875
  switch (_d.label) {
@@ -1066,14 +906,14 @@ var deserializeAws_restJson1GetApplicationCommandError = function (output, conte
1066
906
  case 11: throw _d.sent();
1067
907
  case 12:
1068
908
  parsedBody = parsedOutput.body;
1069
- $metadata = deserializeMetadata(output);
1070
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1071
- response = new __BaseException({
1072
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1073
- $fault: "client",
1074
- $metadata: $metadata,
909
+ throwDefaultError({
910
+ output: output,
911
+ parsedBody: parsedBody,
912
+ exceptionCtor: __BaseException,
913
+ errorCode: errorCode,
1075
914
  });
1076
- throw __decorateServiceException(response, parsedBody);
915
+ _d.label = 13;
916
+ case 13: return [2];
1077
917
  }
1078
918
  });
1079
919
  }); };
@@ -1085,24 +925,23 @@ export var deserializeAws_restJson1GetApplicationPolicyCommand = function (outpu
1085
925
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1086
926
  return [2, deserializeAws_restJson1GetApplicationPolicyCommandError(output, context)];
1087
927
  }
1088
- contents = {
928
+ contents = map({
1089
929
  $metadata: deserializeMetadata(output),
1090
- Statements: undefined,
1091
- };
930
+ });
1092
931
  _a = __expectNonNull;
1093
932
  _b = __expectObject;
1094
933
  return [4, parseBody(output.body, context)];
1095
934
  case 1:
1096
935
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1097
- if (data.statements !== undefined && data.statements !== null) {
936
+ if (data.statements != null) {
1098
937
  contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
1099
938
  }
1100
- return [2, Promise.resolve(contents)];
939
+ return [2, contents];
1101
940
  }
1102
941
  });
1103
942
  }); };
1104
943
  var deserializeAws_restJson1GetApplicationPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1105
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
944
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1106
945
  var _c;
1107
946
  return __generator(this, function (_d) {
1108
947
  switch (_d.label) {
@@ -1139,14 +978,14 @@ var deserializeAws_restJson1GetApplicationPolicyCommandError = function (output,
1139
978
  case 11: throw _d.sent();
1140
979
  case 12:
1141
980
  parsedBody = parsedOutput.body;
1142
- $metadata = deserializeMetadata(output);
1143
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1144
- response = new __BaseException({
1145
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1146
- $fault: "client",
1147
- $metadata: $metadata,
981
+ throwDefaultError({
982
+ output: output,
983
+ parsedBody: parsedBody,
984
+ exceptionCtor: __BaseException,
985
+ errorCode: errorCode,
1148
986
  });
1149
- throw __decorateServiceException(response, parsedBody);
987
+ _d.label = 13;
988
+ case 13: return [2];
1150
989
  }
1151
990
  });
1152
991
  }); };
@@ -1158,48 +997,41 @@ export var deserializeAws_restJson1GetCloudFormationTemplateCommand = function (
1158
997
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1159
998
  return [2, deserializeAws_restJson1GetCloudFormationTemplateCommandError(output, context)];
1160
999
  }
1161
- contents = {
1000
+ contents = map({
1162
1001
  $metadata: deserializeMetadata(output),
1163
- ApplicationId: undefined,
1164
- CreationTime: undefined,
1165
- ExpirationTime: undefined,
1166
- SemanticVersion: undefined,
1167
- Status: undefined,
1168
- TemplateId: undefined,
1169
- TemplateUrl: undefined,
1170
- };
1002
+ });
1171
1003
  _a = __expectNonNull;
1172
1004
  _b = __expectObject;
1173
1005
  return [4, parseBody(output.body, context)];
1174
1006
  case 1:
1175
1007
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1176
- if (data.applicationId !== undefined && data.applicationId !== null) {
1008
+ if (data.applicationId != null) {
1177
1009
  contents.ApplicationId = __expectString(data.applicationId);
1178
1010
  }
1179
- if (data.creationTime !== undefined && data.creationTime !== null) {
1011
+ if (data.creationTime != null) {
1180
1012
  contents.CreationTime = __expectString(data.creationTime);
1181
1013
  }
1182
- if (data.expirationTime !== undefined && data.expirationTime !== null) {
1014
+ if (data.expirationTime != null) {
1183
1015
  contents.ExpirationTime = __expectString(data.expirationTime);
1184
1016
  }
1185
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
1017
+ if (data.semanticVersion != null) {
1186
1018
  contents.SemanticVersion = __expectString(data.semanticVersion);
1187
1019
  }
1188
- if (data.status !== undefined && data.status !== null) {
1020
+ if (data.status != null) {
1189
1021
  contents.Status = __expectString(data.status);
1190
1022
  }
1191
- if (data.templateId !== undefined && data.templateId !== null) {
1023
+ if (data.templateId != null) {
1192
1024
  contents.TemplateId = __expectString(data.templateId);
1193
1025
  }
1194
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
1026
+ if (data.templateUrl != null) {
1195
1027
  contents.TemplateUrl = __expectString(data.templateUrl);
1196
1028
  }
1197
- return [2, Promise.resolve(contents)];
1029
+ return [2, contents];
1198
1030
  }
1199
1031
  });
1200
1032
  }); };
1201
1033
  var deserializeAws_restJson1GetCloudFormationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1202
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1034
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1203
1035
  var _c;
1204
1036
  return __generator(this, function (_d) {
1205
1037
  switch (_d.label) {
@@ -1236,14 +1068,14 @@ var deserializeAws_restJson1GetCloudFormationTemplateCommandError = function (ou
1236
1068
  case 11: throw _d.sent();
1237
1069
  case 12:
1238
1070
  parsedBody = parsedOutput.body;
1239
- $metadata = deserializeMetadata(output);
1240
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1241
- response = new __BaseException({
1242
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1243
- $fault: "client",
1244
- $metadata: $metadata,
1071
+ throwDefaultError({
1072
+ output: output,
1073
+ parsedBody: parsedBody,
1074
+ exceptionCtor: __BaseException,
1075
+ errorCode: errorCode,
1245
1076
  });
1246
- throw __decorateServiceException(response, parsedBody);
1077
+ _d.label = 13;
1078
+ case 13: return [2];
1247
1079
  }
1248
1080
  });
1249
1081
  }); };
@@ -1255,28 +1087,26 @@ export var deserializeAws_restJson1ListApplicationDependenciesCommand = function
1255
1087
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1256
1088
  return [2, deserializeAws_restJson1ListApplicationDependenciesCommandError(output, context)];
1257
1089
  }
1258
- contents = {
1090
+ contents = map({
1259
1091
  $metadata: deserializeMetadata(output),
1260
- Dependencies: undefined,
1261
- NextToken: undefined,
1262
- };
1092
+ });
1263
1093
  _a = __expectNonNull;
1264
1094
  _b = __expectObject;
1265
1095
  return [4, parseBody(output.body, context)];
1266
1096
  case 1:
1267
1097
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1268
- if (data.dependencies !== undefined && data.dependencies !== null) {
1098
+ if (data.dependencies != null) {
1269
1099
  contents.Dependencies = deserializeAws_restJson1__listOfApplicationDependencySummary(data.dependencies, context);
1270
1100
  }
1271
- if (data.nextToken !== undefined && data.nextToken !== null) {
1101
+ if (data.nextToken != null) {
1272
1102
  contents.NextToken = __expectString(data.nextToken);
1273
1103
  }
1274
- return [2, Promise.resolve(contents)];
1104
+ return [2, contents];
1275
1105
  }
1276
1106
  });
1277
1107
  }); };
1278
1108
  var deserializeAws_restJson1ListApplicationDependenciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1279
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1109
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1280
1110
  var _c;
1281
1111
  return __generator(this, function (_d) {
1282
1112
  switch (_d.label) {
@@ -1313,14 +1143,14 @@ var deserializeAws_restJson1ListApplicationDependenciesCommandError = function (
1313
1143
  case 11: throw _d.sent();
1314
1144
  case 12:
1315
1145
  parsedBody = parsedOutput.body;
1316
- $metadata = deserializeMetadata(output);
1317
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1318
- response = new __BaseException({
1319
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1320
- $fault: "client",
1321
- $metadata: $metadata,
1146
+ throwDefaultError({
1147
+ output: output,
1148
+ parsedBody: parsedBody,
1149
+ exceptionCtor: __BaseException,
1150
+ errorCode: errorCode,
1322
1151
  });
1323
- throw __decorateServiceException(response, parsedBody);
1152
+ _d.label = 13;
1153
+ case 13: return [2];
1324
1154
  }
1325
1155
  });
1326
1156
  }); };
@@ -1332,28 +1162,26 @@ export var deserializeAws_restJson1ListApplicationsCommand = function (output, c
1332
1162
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1333
1163
  return [2, deserializeAws_restJson1ListApplicationsCommandError(output, context)];
1334
1164
  }
1335
- contents = {
1165
+ contents = map({
1336
1166
  $metadata: deserializeMetadata(output),
1337
- Applications: undefined,
1338
- NextToken: undefined,
1339
- };
1167
+ });
1340
1168
  _a = __expectNonNull;
1341
1169
  _b = __expectObject;
1342
1170
  return [4, parseBody(output.body, context)];
1343
1171
  case 1:
1344
1172
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1345
- if (data.applications !== undefined && data.applications !== null) {
1173
+ if (data.applications != null) {
1346
1174
  contents.Applications = deserializeAws_restJson1__listOfApplicationSummary(data.applications, context);
1347
1175
  }
1348
- if (data.nextToken !== undefined && data.nextToken !== null) {
1176
+ if (data.nextToken != null) {
1349
1177
  contents.NextToken = __expectString(data.nextToken);
1350
1178
  }
1351
- return [2, Promise.resolve(contents)];
1179
+ return [2, contents];
1352
1180
  }
1353
1181
  });
1354
1182
  }); };
1355
1183
  var deserializeAws_restJson1ListApplicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1356
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1184
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1357
1185
  var _c;
1358
1186
  return __generator(this, function (_d) {
1359
1187
  switch (_d.label) {
@@ -1386,14 +1214,14 @@ var deserializeAws_restJson1ListApplicationsCommandError = function (output, con
1386
1214
  case 9: throw _d.sent();
1387
1215
  case 10:
1388
1216
  parsedBody = parsedOutput.body;
1389
- $metadata = deserializeMetadata(output);
1390
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1391
- response = new __BaseException({
1392
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1393
- $fault: "client",
1394
- $metadata: $metadata,
1217
+ throwDefaultError({
1218
+ output: output,
1219
+ parsedBody: parsedBody,
1220
+ exceptionCtor: __BaseException,
1221
+ errorCode: errorCode,
1395
1222
  });
1396
- throw __decorateServiceException(response, parsedBody);
1223
+ _d.label = 11;
1224
+ case 11: return [2];
1397
1225
  }
1398
1226
  });
1399
1227
  }); };
@@ -1405,28 +1233,26 @@ export var deserializeAws_restJson1ListApplicationVersionsCommand = function (ou
1405
1233
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1406
1234
  return [2, deserializeAws_restJson1ListApplicationVersionsCommandError(output, context)];
1407
1235
  }
1408
- contents = {
1236
+ contents = map({
1409
1237
  $metadata: deserializeMetadata(output),
1410
- NextToken: undefined,
1411
- Versions: undefined,
1412
- };
1238
+ });
1413
1239
  _a = __expectNonNull;
1414
1240
  _b = __expectObject;
1415
1241
  return [4, parseBody(output.body, context)];
1416
1242
  case 1:
1417
1243
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1418
- if (data.nextToken !== undefined && data.nextToken !== null) {
1244
+ if (data.nextToken != null) {
1419
1245
  contents.NextToken = __expectString(data.nextToken);
1420
1246
  }
1421
- if (data.versions !== undefined && data.versions !== null) {
1247
+ if (data.versions != null) {
1422
1248
  contents.Versions = deserializeAws_restJson1__listOfVersionSummary(data.versions, context);
1423
1249
  }
1424
- return [2, Promise.resolve(contents)];
1250
+ return [2, contents];
1425
1251
  }
1426
1252
  });
1427
1253
  }); };
1428
1254
  var deserializeAws_restJson1ListApplicationVersionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1429
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1255
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1430
1256
  var _c;
1431
1257
  return __generator(this, function (_d) {
1432
1258
  switch (_d.label) {
@@ -1463,14 +1289,14 @@ var deserializeAws_restJson1ListApplicationVersionsCommandError = function (outp
1463
1289
  case 11: throw _d.sent();
1464
1290
  case 12:
1465
1291
  parsedBody = parsedOutput.body;
1466
- $metadata = deserializeMetadata(output);
1467
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1468
- response = new __BaseException({
1469
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1470
- $fault: "client",
1471
- $metadata: $metadata,
1292
+ throwDefaultError({
1293
+ output: output,
1294
+ parsedBody: parsedBody,
1295
+ exceptionCtor: __BaseException,
1296
+ errorCode: errorCode,
1472
1297
  });
1473
- throw __decorateServiceException(response, parsedBody);
1298
+ _d.label = 13;
1299
+ case 13: return [2];
1474
1300
  }
1475
1301
  });
1476
1302
  }); };
@@ -1482,24 +1308,23 @@ export var deserializeAws_restJson1PutApplicationPolicyCommand = function (outpu
1482
1308
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1483
1309
  return [2, deserializeAws_restJson1PutApplicationPolicyCommandError(output, context)];
1484
1310
  }
1485
- contents = {
1311
+ contents = map({
1486
1312
  $metadata: deserializeMetadata(output),
1487
- Statements: undefined,
1488
- };
1313
+ });
1489
1314
  _a = __expectNonNull;
1490
1315
  _b = __expectObject;
1491
1316
  return [4, parseBody(output.body, context)];
1492
1317
  case 1:
1493
1318
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1494
- if (data.statements !== undefined && data.statements !== null) {
1319
+ if (data.statements != null) {
1495
1320
  contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
1496
1321
  }
1497
- return [2, Promise.resolve(contents)];
1322
+ return [2, contents];
1498
1323
  }
1499
1324
  });
1500
1325
  }); };
1501
1326
  var deserializeAws_restJson1PutApplicationPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1502
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1327
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1503
1328
  var _c;
1504
1329
  return __generator(this, function (_d) {
1505
1330
  switch (_d.label) {
@@ -1536,14 +1361,14 @@ var deserializeAws_restJson1PutApplicationPolicyCommandError = function (output,
1536
1361
  case 11: throw _d.sent();
1537
1362
  case 12:
1538
1363
  parsedBody = parsedOutput.body;
1539
- $metadata = deserializeMetadata(output);
1540
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1541
- response = new __BaseException({
1542
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1543
- $fault: "client",
1544
- $metadata: $metadata,
1364
+ throwDefaultError({
1365
+ output: output,
1366
+ parsedBody: parsedBody,
1367
+ exceptionCtor: __BaseException,
1368
+ errorCode: errorCode,
1545
1369
  });
1546
- throw __decorateServiceException(response, parsedBody);
1370
+ _d.label = 13;
1371
+ case 13: return [2];
1547
1372
  }
1548
1373
  });
1549
1374
  }); };
@@ -1555,18 +1380,18 @@ export var deserializeAws_restJson1UnshareApplicationCommand = function (output,
1555
1380
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1556
1381
  return [2, deserializeAws_restJson1UnshareApplicationCommandError(output, context)];
1557
1382
  }
1558
- contents = {
1383
+ contents = map({
1559
1384
  $metadata: deserializeMetadata(output),
1560
- };
1385
+ });
1561
1386
  return [4, collectBody(output.body, context)];
1562
1387
  case 1:
1563
1388
  _a.sent();
1564
- return [2, Promise.resolve(contents)];
1389
+ return [2, contents];
1565
1390
  }
1566
1391
  });
1567
1392
  }); };
1568
1393
  var deserializeAws_restJson1UnshareApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1569
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1394
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1570
1395
  var _c;
1571
1396
  return __generator(this, function (_d) {
1572
1397
  switch (_d.label) {
@@ -1603,14 +1428,14 @@ var deserializeAws_restJson1UnshareApplicationCommandError = function (output, c
1603
1428
  case 11: throw _d.sent();
1604
1429
  case 12:
1605
1430
  parsedBody = parsedOutput.body;
1606
- $metadata = deserializeMetadata(output);
1607
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1608
- response = new __BaseException({
1609
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1610
- $fault: "client",
1611
- $metadata: $metadata,
1431
+ throwDefaultError({
1432
+ output: output,
1433
+ parsedBody: parsedBody,
1434
+ exceptionCtor: __BaseException,
1435
+ errorCode: errorCode,
1612
1436
  });
1613
- throw __decorateServiceException(response, parsedBody);
1437
+ _d.label = 13;
1438
+ case 13: return [2];
1614
1439
  }
1615
1440
  });
1616
1441
  }); };
@@ -1622,72 +1447,59 @@ export var deserializeAws_restJson1UpdateApplicationCommand = function (output,
1622
1447
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1623
1448
  return [2, deserializeAws_restJson1UpdateApplicationCommandError(output, context)];
1624
1449
  }
1625
- contents = {
1450
+ contents = map({
1626
1451
  $metadata: deserializeMetadata(output),
1627
- ApplicationId: undefined,
1628
- Author: undefined,
1629
- CreationTime: undefined,
1630
- Description: undefined,
1631
- HomePageUrl: undefined,
1632
- IsVerifiedAuthor: undefined,
1633
- Labels: undefined,
1634
- LicenseUrl: undefined,
1635
- Name: undefined,
1636
- ReadmeUrl: undefined,
1637
- SpdxLicenseId: undefined,
1638
- VerifiedAuthorUrl: undefined,
1639
- Version: undefined,
1640
- };
1452
+ });
1641
1453
  _a = __expectNonNull;
1642
1454
  _b = __expectObject;
1643
1455
  return [4, parseBody(output.body, context)];
1644
1456
  case 1:
1645
1457
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1646
- if (data.applicationId !== undefined && data.applicationId !== null) {
1458
+ if (data.applicationId != null) {
1647
1459
  contents.ApplicationId = __expectString(data.applicationId);
1648
1460
  }
1649
- if (data.author !== undefined && data.author !== null) {
1461
+ if (data.author != null) {
1650
1462
  contents.Author = __expectString(data.author);
1651
1463
  }
1652
- if (data.creationTime !== undefined && data.creationTime !== null) {
1464
+ if (data.creationTime != null) {
1653
1465
  contents.CreationTime = __expectString(data.creationTime);
1654
1466
  }
1655
- if (data.description !== undefined && data.description !== null) {
1467
+ if (data.description != null) {
1656
1468
  contents.Description = __expectString(data.description);
1657
1469
  }
1658
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
1470
+ if (data.homePageUrl != null) {
1659
1471
  contents.HomePageUrl = __expectString(data.homePageUrl);
1660
1472
  }
1661
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
1473
+ if (data.isVerifiedAuthor != null) {
1662
1474
  contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1663
1475
  }
1664
- if (data.labels !== undefined && data.labels !== null) {
1476
+ if (data.labels != null) {
1665
1477
  contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1666
1478
  }
1667
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
1479
+ if (data.licenseUrl != null) {
1668
1480
  contents.LicenseUrl = __expectString(data.licenseUrl);
1669
1481
  }
1670
- if (data.name !== undefined && data.name !== null) {
1482
+ if (data.name != null) {
1671
1483
  contents.Name = __expectString(data.name);
1672
1484
  }
1673
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
1485
+ if (data.readmeUrl != null) {
1674
1486
  contents.ReadmeUrl = __expectString(data.readmeUrl);
1675
1487
  }
1676
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
1488
+ if (data.spdxLicenseId != null) {
1677
1489
  contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1678
1490
  }
1679
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
1491
+ if (data.verifiedAuthorUrl != null) {
1680
1492
  contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1681
1493
  }
1682
- if (data.version !== undefined && data.version !== null) {
1494
+ if (data.version != null) {
1683
1495
  contents.Version = deserializeAws_restJson1Version(data.version, context);
1684
1496
  }
1685
- return [2, Promise.resolve(contents)];
1497
+ return [2, contents];
1686
1498
  }
1687
1499
  });
1688
1500
  }); };
1689
1501
  var deserializeAws_restJson1UpdateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1690
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1502
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1691
1503
  var _c;
1692
1504
  return __generator(this, function (_d) {
1693
1505
  switch (_d.label) {
@@ -1728,26 +1540,27 @@ var deserializeAws_restJson1UpdateApplicationCommandError = function (output, co
1728
1540
  case 13: throw _d.sent();
1729
1541
  case 14:
1730
1542
  parsedBody = parsedOutput.body;
1731
- $metadata = deserializeMetadata(output);
1732
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1733
- response = new __BaseException({
1734
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1735
- $fault: "client",
1736
- $metadata: $metadata,
1543
+ throwDefaultError({
1544
+ output: output,
1545
+ parsedBody: parsedBody,
1546
+ exceptionCtor: __BaseException,
1547
+ errorCode: errorCode,
1737
1548
  });
1738
- throw __decorateServiceException(response, parsedBody);
1549
+ _d.label = 15;
1550
+ case 15: return [2];
1739
1551
  }
1740
1552
  });
1741
1553
  }); };
1554
+ var map = __map;
1742
1555
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1743
1556
  var contents, data, exception;
1744
1557
  return __generator(this, function (_a) {
1745
- contents = {};
1558
+ contents = map({});
1746
1559
  data = parsedOutput.body;
1747
- if (data.errorCode !== undefined && data.errorCode !== null) {
1560
+ if (data.errorCode != null) {
1748
1561
  contents.ErrorCode = __expectString(data.errorCode);
1749
1562
  }
1750
- if (data.message !== undefined && data.message !== null) {
1563
+ if (data.message != null) {
1751
1564
  contents.Message = __expectString(data.message);
1752
1565
  }
1753
1566
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1757,12 +1570,12 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
1757
1570
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1758
1571
  var contents, data, exception;
1759
1572
  return __generator(this, function (_a) {
1760
- contents = {};
1573
+ contents = map({});
1761
1574
  data = parsedOutput.body;
1762
- if (data.errorCode !== undefined && data.errorCode !== null) {
1575
+ if (data.errorCode != null) {
1763
1576
  contents.ErrorCode = __expectString(data.errorCode);
1764
1577
  }
1765
- if (data.message !== undefined && data.message !== null) {
1578
+ if (data.message != null) {
1766
1579
  contents.Message = __expectString(data.message);
1767
1580
  }
1768
1581
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1772,12 +1585,12 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1772
1585
  var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1773
1586
  var contents, data, exception;
1774
1587
  return __generator(this, function (_a) {
1775
- contents = {};
1588
+ contents = map({});
1776
1589
  data = parsedOutput.body;
1777
- if (data.errorCode !== undefined && data.errorCode !== null) {
1590
+ if (data.errorCode != null) {
1778
1591
  contents.ErrorCode = __expectString(data.errorCode);
1779
1592
  }
1780
- if (data.message !== undefined && data.message !== null) {
1593
+ if (data.message != null) {
1781
1594
  contents.Message = __expectString(data.message);
1782
1595
  }
1783
1596
  exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1787,12 +1600,12 @@ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput,
1787
1600
  var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1788
1601
  var contents, data, exception;
1789
1602
  return __generator(this, function (_a) {
1790
- contents = {};
1603
+ contents = map({});
1791
1604
  data = parsedOutput.body;
1792
- if (data.errorCode !== undefined && data.errorCode !== null) {
1605
+ if (data.errorCode != null) {
1793
1606
  contents.ErrorCode = __expectString(data.errorCode);
1794
1607
  }
1795
- if (data.message !== undefined && data.message !== null) {
1608
+ if (data.message != null) {
1796
1609
  contents.Message = __expectString(data.message);
1797
1610
  }
1798
1611
  exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1802,12 +1615,12 @@ var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (par
1802
1615
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1803
1616
  var contents, data, exception;
1804
1617
  return __generator(this, function (_a) {
1805
- contents = {};
1618
+ contents = map({});
1806
1619
  data = parsedOutput.body;
1807
- if (data.errorCode !== undefined && data.errorCode !== null) {
1620
+ if (data.errorCode != null) {
1808
1621
  contents.ErrorCode = __expectString(data.errorCode);
1809
1622
  }
1810
- if (data.message !== undefined && data.message !== null) {
1623
+ if (data.message != null) {
1811
1624
  contents.Message = __expectString(data.message);
1812
1625
  }
1813
1626
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1817,12 +1630,12 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
1817
1630
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1818
1631
  var contents, data, exception;
1819
1632
  return __generator(this, function (_a) {
1820
- contents = {};
1633
+ contents = map({});
1821
1634
  data = parsedOutput.body;
1822
- if (data.errorCode !== undefined && data.errorCode !== null) {
1635
+ if (data.errorCode != null) {
1823
1636
  contents.ErrorCode = __expectString(data.errorCode);
1824
1637
  }
1825
- if (data.message !== undefined && data.message !== null) {
1638
+ if (data.message != null) {
1826
1639
  contents.Message = __expectString(data.message);
1827
1640
  }
1828
1641
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1833,9 +1646,6 @@ var serializeAws_restJson1__listOf__string = function (input, context) {
1833
1646
  return input
1834
1647
  .filter(function (e) { return e != null; })
1835
1648
  .map(function (entry) {
1836
- if (entry === null) {
1837
- return null;
1838
- }
1839
1649
  return entry;
1840
1650
  });
1841
1651
  };
@@ -1843,9 +1653,6 @@ var serializeAws_restJson1__listOfApplicationPolicyStatement = function (input,
1843
1653
  return input
1844
1654
  .filter(function (e) { return e != null; })
1845
1655
  .map(function (entry) {
1846
- if (entry === null) {
1847
- return null;
1848
- }
1849
1656
  return serializeAws_restJson1ApplicationPolicyStatement(entry, context);
1850
1657
  });
1851
1658
  };
@@ -1853,9 +1660,6 @@ var serializeAws_restJson1__listOfParameterValue = function (input, context) {
1853
1660
  return input
1854
1661
  .filter(function (e) { return e != null; })
1855
1662
  .map(function (entry) {
1856
- if (entry === null) {
1857
- return null;
1858
- }
1859
1663
  return serializeAws_restJson1ParameterValue(entry, context);
1860
1664
  });
1861
1665
  };
@@ -1863,9 +1667,6 @@ var serializeAws_restJson1__listOfRollbackTrigger = function (input, context) {
1863
1667
  return input
1864
1668
  .filter(function (e) { return e != null; })
1865
1669
  .map(function (entry) {
1866
- if (entry === null) {
1867
- return null;
1868
- }
1869
1670
  return serializeAws_restJson1RollbackTrigger(entry, context);
1870
1671
  });
1871
1672
  };
@@ -1873,9 +1674,6 @@ var serializeAws_restJson1__listOfTag = function (input, context) {
1873
1674
  return input
1874
1675
  .filter(function (e) { return e != null; })
1875
1676
  .map(function (entry) {
1876
- if (entry === null) {
1877
- return null;
1878
- }
1879
1677
  return serializeAws_restJson1Tag(entry, context);
1880
1678
  });
1881
1679
  };