@aws-sdk/client-appconfig 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.
@@ -36,16 +36,7 @@ const serializeAws_restJson1CreateConfigurationProfileCommand = async (input, co
36
36
  };
37
37
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
38
38
  "/applications/{ApplicationId}/configurationprofiles";
39
- if (input.ApplicationId !== undefined) {
40
- const labelValue = input.ApplicationId;
41
- if (labelValue.length <= 0) {
42
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
43
- }
44
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
45
- }
46
- else {
47
- throw new Error("No value provided for input HTTP label: ApplicationId.");
48
- }
39
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
49
40
  let body;
50
41
  body = JSON.stringify({
51
42
  ...(input.Description != null && { Description: input.Description }),
@@ -104,16 +95,7 @@ const serializeAws_restJson1CreateEnvironmentCommand = async (input, context) =>
104
95
  };
105
96
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
106
97
  "/applications/{ApplicationId}/environments";
107
- if (input.ApplicationId !== undefined) {
108
- const labelValue = input.ApplicationId;
109
- if (labelValue.length <= 0) {
110
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
111
- }
112
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
113
- }
114
- else {
115
- throw new Error("No value provided for input HTTP label: ApplicationId.");
116
- }
98
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
117
99
  let body;
118
100
  body = JSON.stringify({
119
101
  ...(input.Description != null && { Description: input.Description }),
@@ -134,12 +116,13 @@ const serializeAws_restJson1CreateEnvironmentCommand = async (input, context) =>
134
116
  exports.serializeAws_restJson1CreateEnvironmentCommand = serializeAws_restJson1CreateEnvironmentCommand;
135
117
  const serializeAws_restJson1CreateExtensionCommand = async (input, context) => {
136
118
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
- const headers = {
119
+ const headers = map({}, isSerializableHeaderValue, {
138
120
  "content-type": "application/json",
139
- ...(isSerializableHeaderValue(input.LatestVersionNumber) && {
140
- "latest-version-number": input.LatestVersionNumber.toString(),
141
- }),
142
- };
121
+ "latest-version-number": [
122
+ () => isSerializableHeaderValue(input.LatestVersionNumber),
123
+ () => input.LatestVersionNumber.toString(),
124
+ ],
125
+ });
143
126
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensions";
144
127
  let body;
145
128
  body = JSON.stringify({
@@ -187,36 +170,18 @@ const serializeAws_restJson1CreateExtensionAssociationCommand = async (input, co
187
170
  exports.serializeAws_restJson1CreateExtensionAssociationCommand = serializeAws_restJson1CreateExtensionAssociationCommand;
188
171
  const serializeAws_restJson1CreateHostedConfigurationVersionCommand = async (input, context) => {
189
172
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
190
- const headers = {
191
- "content-type": "application/octet-stream",
192
- ...(isSerializableHeaderValue(input.Description) && { description: input.Description }),
193
- ...(isSerializableHeaderValue(input.ContentType) && { "content-type": input.ContentType }),
194
- ...(isSerializableHeaderValue(input.LatestVersionNumber) && {
195
- "latest-version-number": input.LatestVersionNumber.toString(),
196
- }),
197
- };
173
+ const headers = map({}, isSerializableHeaderValue, {
174
+ "content-type": input.ContentType || "application/octet-stream",
175
+ description: input.Description,
176
+ "latest-version-number": [
177
+ () => isSerializableHeaderValue(input.LatestVersionNumber),
178
+ () => input.LatestVersionNumber.toString(),
179
+ ],
180
+ });
198
181
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
199
182
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions";
200
- if (input.ApplicationId !== undefined) {
201
- const labelValue = input.ApplicationId;
202
- if (labelValue.length <= 0) {
203
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
204
- }
205
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
206
- }
207
- else {
208
- throw new Error("No value provided for input HTTP label: ApplicationId.");
209
- }
210
- if (input.ConfigurationProfileId !== undefined) {
211
- const labelValue = input.ConfigurationProfileId;
212
- if (labelValue.length <= 0) {
213
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
214
- }
215
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
216
- }
217
- else {
218
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
219
- }
183
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
184
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
220
185
  let body;
221
186
  if (input.Content !== undefined) {
222
187
  body = input.Content;
@@ -236,16 +201,7 @@ const serializeAws_restJson1DeleteApplicationCommand = async (input, context) =>
236
201
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
237
202
  const headers = {};
238
203
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
239
- if (input.ApplicationId !== undefined) {
240
- const labelValue = input.ApplicationId;
241
- if (labelValue.length <= 0) {
242
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
243
- }
244
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
245
- }
246
- else {
247
- throw new Error("No value provided for input HTTP label: ApplicationId.");
248
- }
204
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
249
205
  let body;
250
206
  return new protocol_http_1.HttpRequest({
251
207
  protocol,
@@ -263,26 +219,8 @@ const serializeAws_restJson1DeleteConfigurationProfileCommand = async (input, co
263
219
  const headers = {};
264
220
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
265
221
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}";
266
- if (input.ApplicationId !== undefined) {
267
- const labelValue = input.ApplicationId;
268
- if (labelValue.length <= 0) {
269
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
270
- }
271
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
272
- }
273
- else {
274
- throw new Error("No value provided for input HTTP label: ApplicationId.");
275
- }
276
- if (input.ConfigurationProfileId !== undefined) {
277
- const labelValue = input.ConfigurationProfileId;
278
- if (labelValue.length <= 0) {
279
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
280
- }
281
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
282
- }
283
- else {
284
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
285
- }
222
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
223
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
286
224
  let body;
287
225
  return new protocol_http_1.HttpRequest({
288
226
  protocol,
@@ -300,16 +238,7 @@ const serializeAws_restJson1DeleteDeploymentStrategyCommand = async (input, cont
300
238
  const headers = {};
301
239
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
302
240
  "/deployementstrategies/{DeploymentStrategyId}";
303
- if (input.DeploymentStrategyId !== undefined) {
304
- const labelValue = input.DeploymentStrategyId;
305
- if (labelValue.length <= 0) {
306
- throw new Error("Empty value provided for input HTTP label: DeploymentStrategyId.");
307
- }
308
- resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
309
- }
310
- else {
311
- throw new Error("No value provided for input HTTP label: DeploymentStrategyId.");
312
- }
241
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeploymentStrategyId", () => input.DeploymentStrategyId, "{DeploymentStrategyId}", false);
313
242
  let body;
314
243
  return new protocol_http_1.HttpRequest({
315
244
  protocol,
@@ -327,26 +256,8 @@ const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) =>
327
256
  const headers = {};
328
257
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
329
258
  "/applications/{ApplicationId}/environments/{EnvironmentId}";
330
- if (input.ApplicationId !== undefined) {
331
- const labelValue = input.ApplicationId;
332
- if (labelValue.length <= 0) {
333
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
334
- }
335
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
336
- }
337
- else {
338
- throw new Error("No value provided for input HTTP label: ApplicationId.");
339
- }
340
- if (input.EnvironmentId !== undefined) {
341
- const labelValue = input.EnvironmentId;
342
- if (labelValue.length <= 0) {
343
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
344
- }
345
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
346
- }
347
- else {
348
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
349
- }
259
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
260
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
350
261
  let body;
351
262
  return new protocol_http_1.HttpRequest({
352
263
  protocol,
@@ -363,19 +274,10 @@ const serializeAws_restJson1DeleteExtensionCommand = async (input, context) => {
363
274
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
364
275
  const headers = {};
365
276
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensions/{ExtensionIdentifier}";
366
- if (input.ExtensionIdentifier !== undefined) {
367
- const labelValue = input.ExtensionIdentifier;
368
- if (labelValue.length <= 0) {
369
- throw new Error("Empty value provided for input HTTP label: ExtensionIdentifier.");
370
- }
371
- resolvedPath = resolvedPath.replace("{ExtensionIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
372
- }
373
- else {
374
- throw new Error("No value provided for input HTTP label: ExtensionIdentifier.");
375
- }
376
- const query = {
377
- ...(input.VersionNumber !== undefined && { version: input.VersionNumber.toString() }),
378
- };
277
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionIdentifier", () => input.ExtensionIdentifier, "{ExtensionIdentifier}", false);
278
+ const query = map({
279
+ version: [() => input.VersionNumber !== void 0, () => input.VersionNumber.toString()],
280
+ });
379
281
  let body;
380
282
  return new protocol_http_1.HttpRequest({
381
283
  protocol,
@@ -394,16 +296,7 @@ const serializeAws_restJson1DeleteExtensionAssociationCommand = async (input, co
394
296
  const headers = {};
395
297
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
396
298
  "/extensionassociations/{ExtensionAssociationId}";
397
- if (input.ExtensionAssociationId !== undefined) {
398
- const labelValue = input.ExtensionAssociationId;
399
- if (labelValue.length <= 0) {
400
- throw new Error("Empty value provided for input HTTP label: ExtensionAssociationId.");
401
- }
402
- resolvedPath = resolvedPath.replace("{ExtensionAssociationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
403
- }
404
- else {
405
- throw new Error("No value provided for input HTTP label: ExtensionAssociationId.");
406
- }
299
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionAssociationId", () => input.ExtensionAssociationId, "{ExtensionAssociationId}", false);
407
300
  let body;
408
301
  return new protocol_http_1.HttpRequest({
409
302
  protocol,
@@ -421,36 +314,9 @@ const serializeAws_restJson1DeleteHostedConfigurationVersionCommand = async (inp
421
314
  const headers = {};
422
315
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
423
316
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}";
424
- if (input.ApplicationId !== undefined) {
425
- const labelValue = input.ApplicationId;
426
- if (labelValue.length <= 0) {
427
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
428
- }
429
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
430
- }
431
- else {
432
- throw new Error("No value provided for input HTTP label: ApplicationId.");
433
- }
434
- if (input.ConfigurationProfileId !== undefined) {
435
- const labelValue = input.ConfigurationProfileId;
436
- if (labelValue.length <= 0) {
437
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
438
- }
439
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
440
- }
441
- else {
442
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
443
- }
444
- if (input.VersionNumber !== undefined) {
445
- const labelValue = input.VersionNumber.toString();
446
- if (labelValue.length <= 0) {
447
- throw new Error("Empty value provided for input HTTP label: VersionNumber.");
448
- }
449
- resolvedPath = resolvedPath.replace("{VersionNumber}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
450
- }
451
- else {
452
- throw new Error("No value provided for input HTTP label: VersionNumber.");
453
- }
317
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
318
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
319
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "VersionNumber", () => input.VersionNumber.toString(), "{VersionNumber}", false);
454
320
  let body;
455
321
  return new protocol_http_1.HttpRequest({
456
322
  protocol,
@@ -467,16 +333,7 @@ const serializeAws_restJson1GetApplicationCommand = async (input, context) => {
467
333
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
468
334
  const headers = {};
469
335
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
470
- if (input.ApplicationId !== undefined) {
471
- const labelValue = input.ApplicationId;
472
- if (labelValue.length <= 0) {
473
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
474
- }
475
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
476
- }
477
- else {
478
- throw new Error("No value provided for input HTTP label: ApplicationId.");
479
- }
336
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
480
337
  let body;
481
338
  return new protocol_http_1.HttpRequest({
482
339
  protocol,
@@ -494,42 +351,13 @@ const serializeAws_restJson1GetConfigurationCommand = async (input, context) =>
494
351
  const headers = {};
495
352
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
496
353
  "/applications/{Application}/environments/{Environment}/configurations/{Configuration}";
497
- if (input.Application !== undefined) {
498
- const labelValue = input.Application;
499
- if (labelValue.length <= 0) {
500
- throw new Error("Empty value provided for input HTTP label: Application.");
501
- }
502
- resolvedPath = resolvedPath.replace("{Application}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
503
- }
504
- else {
505
- throw new Error("No value provided for input HTTP label: Application.");
506
- }
507
- if (input.Environment !== undefined) {
508
- const labelValue = input.Environment;
509
- if (labelValue.length <= 0) {
510
- throw new Error("Empty value provided for input HTTP label: Environment.");
511
- }
512
- resolvedPath = resolvedPath.replace("{Environment}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
513
- }
514
- else {
515
- throw new Error("No value provided for input HTTP label: Environment.");
516
- }
517
- if (input.Configuration !== undefined) {
518
- const labelValue = input.Configuration;
519
- if (labelValue.length <= 0) {
520
- throw new Error("Empty value provided for input HTTP label: Configuration.");
521
- }
522
- resolvedPath = resolvedPath.replace("{Configuration}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
523
- }
524
- else {
525
- throw new Error("No value provided for input HTTP label: Configuration.");
526
- }
527
- const query = {
528
- ...(input.ClientId !== undefined && { client_id: input.ClientId }),
529
- ...(input.ClientConfigurationVersion !== undefined && {
530
- client_configuration_version: input.ClientConfigurationVersion,
531
- }),
532
- };
354
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Application", () => input.Application, "{Application}", false);
355
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Environment", () => input.Environment, "{Environment}", false);
356
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Configuration", () => input.Configuration, "{Configuration}", false);
357
+ const query = map({
358
+ client_id: [, input.ClientId],
359
+ client_configuration_version: [, input.ClientConfigurationVersion],
360
+ });
533
361
  let body;
534
362
  return new protocol_http_1.HttpRequest({
535
363
  protocol,
@@ -548,26 +376,8 @@ const serializeAws_restJson1GetConfigurationProfileCommand = async (input, conte
548
376
  const headers = {};
549
377
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
550
378
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}";
551
- if (input.ApplicationId !== undefined) {
552
- const labelValue = input.ApplicationId;
553
- if (labelValue.length <= 0) {
554
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
555
- }
556
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
557
- }
558
- else {
559
- throw new Error("No value provided for input HTTP label: ApplicationId.");
560
- }
561
- if (input.ConfigurationProfileId !== undefined) {
562
- const labelValue = input.ConfigurationProfileId;
563
- if (labelValue.length <= 0) {
564
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
565
- }
566
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
567
- }
568
- else {
569
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
570
- }
379
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
380
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
571
381
  let body;
572
382
  return new protocol_http_1.HttpRequest({
573
383
  protocol,
@@ -585,36 +395,9 @@ const serializeAws_restJson1GetDeploymentCommand = async (input, context) => {
585
395
  const headers = {};
586
396
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
587
397
  "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}";
588
- if (input.ApplicationId !== undefined) {
589
- const labelValue = input.ApplicationId;
590
- if (labelValue.length <= 0) {
591
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
592
- }
593
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
594
- }
595
- else {
596
- throw new Error("No value provided for input HTTP label: ApplicationId.");
597
- }
598
- if (input.EnvironmentId !== undefined) {
599
- const labelValue = input.EnvironmentId;
600
- if (labelValue.length <= 0) {
601
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
602
- }
603
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
604
- }
605
- else {
606
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
607
- }
608
- if (input.DeploymentNumber !== undefined) {
609
- const labelValue = input.DeploymentNumber.toString();
610
- if (labelValue.length <= 0) {
611
- throw new Error("Empty value provided for input HTTP label: DeploymentNumber.");
612
- }
613
- resolvedPath = resolvedPath.replace("{DeploymentNumber}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
614
- }
615
- else {
616
- throw new Error("No value provided for input HTTP label: DeploymentNumber.");
617
- }
398
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
399
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
400
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeploymentNumber", () => input.DeploymentNumber.toString(), "{DeploymentNumber}", false);
618
401
  let body;
619
402
  return new protocol_http_1.HttpRequest({
620
403
  protocol,
@@ -632,16 +415,7 @@ const serializeAws_restJson1GetDeploymentStrategyCommand = async (input, context
632
415
  const headers = {};
633
416
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
634
417
  "/deploymentstrategies/{DeploymentStrategyId}";
635
- if (input.DeploymentStrategyId !== undefined) {
636
- const labelValue = input.DeploymentStrategyId;
637
- if (labelValue.length <= 0) {
638
- throw new Error("Empty value provided for input HTTP label: DeploymentStrategyId.");
639
- }
640
- resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
641
- }
642
- else {
643
- throw new Error("No value provided for input HTTP label: DeploymentStrategyId.");
644
- }
418
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeploymentStrategyId", () => input.DeploymentStrategyId, "{DeploymentStrategyId}", false);
645
419
  let body;
646
420
  return new protocol_http_1.HttpRequest({
647
421
  protocol,
@@ -659,26 +433,8 @@ const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
659
433
  const headers = {};
660
434
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
661
435
  "/applications/{ApplicationId}/environments/{EnvironmentId}";
662
- if (input.ApplicationId !== undefined) {
663
- const labelValue = input.ApplicationId;
664
- if (labelValue.length <= 0) {
665
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
666
- }
667
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
668
- }
669
- else {
670
- throw new Error("No value provided for input HTTP label: ApplicationId.");
671
- }
672
- if (input.EnvironmentId !== undefined) {
673
- const labelValue = input.EnvironmentId;
674
- if (labelValue.length <= 0) {
675
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
676
- }
677
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
678
- }
679
- else {
680
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
681
- }
436
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
437
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
682
438
  let body;
683
439
  return new protocol_http_1.HttpRequest({
684
440
  protocol,
@@ -695,19 +451,10 @@ const serializeAws_restJson1GetExtensionCommand = async (input, context) => {
695
451
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
696
452
  const headers = {};
697
453
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensions/{ExtensionIdentifier}";
698
- if (input.ExtensionIdentifier !== undefined) {
699
- const labelValue = input.ExtensionIdentifier;
700
- if (labelValue.length <= 0) {
701
- throw new Error("Empty value provided for input HTTP label: ExtensionIdentifier.");
702
- }
703
- resolvedPath = resolvedPath.replace("{ExtensionIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
704
- }
705
- else {
706
- throw new Error("No value provided for input HTTP label: ExtensionIdentifier.");
707
- }
708
- const query = {
709
- ...(input.VersionNumber !== undefined && { version_number: input.VersionNumber.toString() }),
710
- };
454
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionIdentifier", () => input.ExtensionIdentifier, "{ExtensionIdentifier}", false);
455
+ const query = map({
456
+ version_number: [() => input.VersionNumber !== void 0, () => input.VersionNumber.toString()],
457
+ });
711
458
  let body;
712
459
  return new protocol_http_1.HttpRequest({
713
460
  protocol,
@@ -726,16 +473,7 @@ const serializeAws_restJson1GetExtensionAssociationCommand = async (input, conte
726
473
  const headers = {};
727
474
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
728
475
  "/extensionassociations/{ExtensionAssociationId}";
729
- if (input.ExtensionAssociationId !== undefined) {
730
- const labelValue = input.ExtensionAssociationId;
731
- if (labelValue.length <= 0) {
732
- throw new Error("Empty value provided for input HTTP label: ExtensionAssociationId.");
733
- }
734
- resolvedPath = resolvedPath.replace("{ExtensionAssociationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
735
- }
736
- else {
737
- throw new Error("No value provided for input HTTP label: ExtensionAssociationId.");
738
- }
476
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionAssociationId", () => input.ExtensionAssociationId, "{ExtensionAssociationId}", false);
739
477
  let body;
740
478
  return new protocol_http_1.HttpRequest({
741
479
  protocol,
@@ -753,36 +491,9 @@ const serializeAws_restJson1GetHostedConfigurationVersionCommand = async (input,
753
491
  const headers = {};
754
492
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
755
493
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}";
756
- if (input.ApplicationId !== undefined) {
757
- const labelValue = input.ApplicationId;
758
- if (labelValue.length <= 0) {
759
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
760
- }
761
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
762
- }
763
- else {
764
- throw new Error("No value provided for input HTTP label: ApplicationId.");
765
- }
766
- if (input.ConfigurationProfileId !== undefined) {
767
- const labelValue = input.ConfigurationProfileId;
768
- if (labelValue.length <= 0) {
769
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
770
- }
771
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
772
- }
773
- else {
774
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
775
- }
776
- if (input.VersionNumber !== undefined) {
777
- const labelValue = input.VersionNumber.toString();
778
- if (labelValue.length <= 0) {
779
- throw new Error("Empty value provided for input HTTP label: VersionNumber.");
780
- }
781
- resolvedPath = resolvedPath.replace("{VersionNumber}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
782
- }
783
- else {
784
- throw new Error("No value provided for input HTTP label: VersionNumber.");
785
- }
494
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
495
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
496
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "VersionNumber", () => input.VersionNumber.toString(), "{VersionNumber}", false);
786
497
  let body;
787
498
  return new protocol_http_1.HttpRequest({
788
499
  protocol,
@@ -799,10 +510,10 @@ const serializeAws_restJson1ListApplicationsCommand = async (input, context) =>
799
510
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
800
511
  const headers = {};
801
512
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
802
- const query = {
803
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
804
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
805
- };
513
+ const query = map({
514
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
515
+ next_token: [, input.NextToken],
516
+ });
806
517
  let body;
807
518
  return new protocol_http_1.HttpRequest({
808
519
  protocol,
@@ -821,21 +532,12 @@ const serializeAws_restJson1ListConfigurationProfilesCommand = async (input, con
821
532
  const headers = {};
822
533
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
823
534
  "/applications/{ApplicationId}/configurationprofiles";
824
- if (input.ApplicationId !== undefined) {
825
- const labelValue = input.ApplicationId;
826
- if (labelValue.length <= 0) {
827
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
828
- }
829
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
830
- }
831
- else {
832
- throw new Error("No value provided for input HTTP label: ApplicationId.");
833
- }
834
- const query = {
835
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
836
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
837
- ...(input.Type !== undefined && { type: input.Type }),
838
- };
535
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
536
+ const query = map({
537
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
538
+ next_token: [, input.NextToken],
539
+ type: [, input.Type],
540
+ });
839
541
  let body;
840
542
  return new protocol_http_1.HttpRequest({
841
543
  protocol,
@@ -854,30 +556,12 @@ const serializeAws_restJson1ListDeploymentsCommand = async (input, context) => {
854
556
  const headers = {};
855
557
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
856
558
  "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments";
857
- if (input.ApplicationId !== undefined) {
858
- const labelValue = input.ApplicationId;
859
- if (labelValue.length <= 0) {
860
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
861
- }
862
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
863
- }
864
- else {
865
- throw new Error("No value provided for input HTTP label: ApplicationId.");
866
- }
867
- if (input.EnvironmentId !== undefined) {
868
- const labelValue = input.EnvironmentId;
869
- if (labelValue.length <= 0) {
870
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
871
- }
872
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
873
- }
874
- else {
875
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
876
- }
877
- const query = {
878
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
879
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
880
- };
559
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
560
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
561
+ const query = map({
562
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
563
+ next_token: [, input.NextToken],
564
+ });
881
565
  let body;
882
566
  return new protocol_http_1.HttpRequest({
883
567
  protocol,
@@ -895,10 +579,10 @@ const serializeAws_restJson1ListDeploymentStrategiesCommand = async (input, cont
895
579
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
896
580
  const headers = {};
897
581
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/deploymentstrategies";
898
- const query = {
899
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
900
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
901
- };
582
+ const query = map({
583
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
584
+ next_token: [, input.NextToken],
585
+ });
902
586
  let body;
903
587
  return new protocol_http_1.HttpRequest({
904
588
  protocol,
@@ -917,20 +601,11 @@ const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) =>
917
601
  const headers = {};
918
602
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
919
603
  "/applications/{ApplicationId}/environments";
920
- if (input.ApplicationId !== undefined) {
921
- const labelValue = input.ApplicationId;
922
- if (labelValue.length <= 0) {
923
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
924
- }
925
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
926
- }
927
- else {
928
- throw new Error("No value provided for input HTTP label: ApplicationId.");
929
- }
930
- const query = {
931
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
932
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
933
- };
604
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
605
+ const query = map({
606
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
607
+ next_token: [, input.NextToken],
608
+ });
934
609
  let body;
935
610
  return new protocol_http_1.HttpRequest({
936
611
  protocol,
@@ -948,15 +623,16 @@ const serializeAws_restJson1ListExtensionAssociationsCommand = async (input, con
948
623
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
949
624
  const headers = {};
950
625
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensionassociations";
951
- const query = {
952
- ...(input.ResourceIdentifier !== undefined && { resource_identifier: input.ResourceIdentifier }),
953
- ...(input.ExtensionIdentifier !== undefined && { extension_identifier: input.ExtensionIdentifier }),
954
- ...(input.ExtensionVersionNumber !== undefined && {
955
- extension_version_number: input.ExtensionVersionNumber.toString(),
956
- }),
957
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
958
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
959
- };
626
+ const query = map({
627
+ resource_identifier: [, input.ResourceIdentifier],
628
+ extension_identifier: [, input.ExtensionIdentifier],
629
+ extension_version_number: [
630
+ () => input.ExtensionVersionNumber !== void 0,
631
+ () => input.ExtensionVersionNumber.toString(),
632
+ ],
633
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
634
+ next_token: [, input.NextToken],
635
+ });
960
636
  let body;
961
637
  return new protocol_http_1.HttpRequest({
962
638
  protocol,
@@ -974,11 +650,11 @@ const serializeAws_restJson1ListExtensionsCommand = async (input, context) => {
974
650
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
975
651
  const headers = {};
976
652
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensions";
977
- const query = {
978
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
979
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
980
- ...(input.Name !== undefined && { name: input.Name }),
981
- };
653
+ const query = map({
654
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
655
+ next_token: [, input.NextToken],
656
+ name: [, input.Name],
657
+ });
982
658
  let body;
983
659
  return new protocol_http_1.HttpRequest({
984
660
  protocol,
@@ -997,30 +673,12 @@ const serializeAws_restJson1ListHostedConfigurationVersionsCommand = async (inpu
997
673
  const headers = {};
998
674
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
999
675
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions";
1000
- if (input.ApplicationId !== undefined) {
1001
- const labelValue = input.ApplicationId;
1002
- if (labelValue.length <= 0) {
1003
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1004
- }
1005
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1006
- }
1007
- else {
1008
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1009
- }
1010
- if (input.ConfigurationProfileId !== undefined) {
1011
- const labelValue = input.ConfigurationProfileId;
1012
- if (labelValue.length <= 0) {
1013
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
1014
- }
1015
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1016
- }
1017
- else {
1018
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
1019
- }
1020
- const query = {
1021
- ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }),
1022
- ...(input.NextToken !== undefined && { next_token: input.NextToken }),
1023
- };
676
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
677
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
678
+ const query = map({
679
+ max_results: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
680
+ next_token: [, input.NextToken],
681
+ });
1024
682
  let body;
1025
683
  return new protocol_http_1.HttpRequest({
1026
684
  protocol,
@@ -1038,16 +696,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
1038
696
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1039
697
  const headers = {};
1040
698
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1041
- if (input.ResourceArn !== undefined) {
1042
- const labelValue = input.ResourceArn;
1043
- if (labelValue.length <= 0) {
1044
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1045
- }
1046
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1047
- }
1048
- else {
1049
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1050
- }
699
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
1051
700
  let body;
1052
701
  return new protocol_http_1.HttpRequest({
1053
702
  protocol,
@@ -1067,26 +716,8 @@ const serializeAws_restJson1StartDeploymentCommand = async (input, context) => {
1067
716
  };
1068
717
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1069
718
  "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments";
1070
- if (input.ApplicationId !== undefined) {
1071
- const labelValue = input.ApplicationId;
1072
- if (labelValue.length <= 0) {
1073
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1074
- }
1075
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1076
- }
1077
- else {
1078
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1079
- }
1080
- if (input.EnvironmentId !== undefined) {
1081
- const labelValue = input.EnvironmentId;
1082
- if (labelValue.length <= 0) {
1083
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
1084
- }
1085
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1086
- }
1087
- else {
1088
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
1089
- }
719
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
720
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
1090
721
  let body;
1091
722
  body = JSON.stringify({
1092
723
  ...(input.ConfigurationProfileId != null && { ConfigurationProfileId: input.ConfigurationProfileId }),
@@ -1111,36 +742,9 @@ const serializeAws_restJson1StopDeploymentCommand = async (input, context) => {
1111
742
  const headers = {};
1112
743
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1113
744
  "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}";
1114
- if (input.ApplicationId !== undefined) {
1115
- const labelValue = input.ApplicationId;
1116
- if (labelValue.length <= 0) {
1117
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1118
- }
1119
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1120
- }
1121
- else {
1122
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1123
- }
1124
- if (input.EnvironmentId !== undefined) {
1125
- const labelValue = input.EnvironmentId;
1126
- if (labelValue.length <= 0) {
1127
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
1128
- }
1129
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1130
- }
1131
- else {
1132
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
1133
- }
1134
- if (input.DeploymentNumber !== undefined) {
1135
- const labelValue = input.DeploymentNumber.toString();
1136
- if (labelValue.length <= 0) {
1137
- throw new Error("Empty value provided for input HTTP label: DeploymentNumber.");
1138
- }
1139
- resolvedPath = resolvedPath.replace("{DeploymentNumber}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1140
- }
1141
- else {
1142
- throw new Error("No value provided for input HTTP label: DeploymentNumber.");
1143
- }
745
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
746
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
747
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeploymentNumber", () => input.DeploymentNumber.toString(), "{DeploymentNumber}", false);
1144
748
  let body;
1145
749
  return new protocol_http_1.HttpRequest({
1146
750
  protocol,
@@ -1159,16 +763,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
1159
763
  "content-type": "application/json",
1160
764
  };
1161
765
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1162
- if (input.ResourceArn !== undefined) {
1163
- const labelValue = input.ResourceArn;
1164
- if (labelValue.length <= 0) {
1165
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1166
- }
1167
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1168
- }
1169
- else {
1170
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1171
- }
766
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
1172
767
  let body;
1173
768
  body = JSON.stringify({
1174
769
  ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
@@ -1188,19 +783,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
1188
783
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1189
784
  const headers = {};
1190
785
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1191
- if (input.ResourceArn !== undefined) {
1192
- const labelValue = input.ResourceArn;
1193
- if (labelValue.length <= 0) {
1194
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1195
- }
1196
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1197
- }
1198
- else {
1199
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1200
- }
1201
- const query = {
1202
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
1203
- };
786
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
787
+ const query = map({
788
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
789
+ });
1204
790
  let body;
1205
791
  return new protocol_http_1.HttpRequest({
1206
792
  protocol,
@@ -1220,16 +806,7 @@ const serializeAws_restJson1UpdateApplicationCommand = async (input, context) =>
1220
806
  "content-type": "application/json",
1221
807
  };
1222
808
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
1223
- if (input.ApplicationId !== undefined) {
1224
- const labelValue = input.ApplicationId;
1225
- if (labelValue.length <= 0) {
1226
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1227
- }
1228
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1229
- }
1230
- else {
1231
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1232
- }
809
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
1233
810
  let body;
1234
811
  body = JSON.stringify({
1235
812
  ...(input.Description != null && { Description: input.Description }),
@@ -1253,26 +830,8 @@ const serializeAws_restJson1UpdateConfigurationProfileCommand = async (input, co
1253
830
  };
1254
831
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1255
832
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}";
1256
- if (input.ApplicationId !== undefined) {
1257
- const labelValue = input.ApplicationId;
1258
- if (labelValue.length <= 0) {
1259
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1260
- }
1261
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1262
- }
1263
- else {
1264
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1265
- }
1266
- if (input.ConfigurationProfileId !== undefined) {
1267
- const labelValue = input.ConfigurationProfileId;
1268
- if (labelValue.length <= 0) {
1269
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
1270
- }
1271
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1272
- }
1273
- else {
1274
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
1275
- }
833
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
834
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
1276
835
  let body;
1277
836
  body = JSON.stringify({
1278
837
  ...(input.Description != null && { Description: input.Description }),
@@ -1298,16 +857,7 @@ const serializeAws_restJson1UpdateDeploymentStrategyCommand = async (input, cont
1298
857
  };
1299
858
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1300
859
  "/deploymentstrategies/{DeploymentStrategyId}";
1301
- if (input.DeploymentStrategyId !== undefined) {
1302
- const labelValue = input.DeploymentStrategyId;
1303
- if (labelValue.length <= 0) {
1304
- throw new Error("Empty value provided for input HTTP label: DeploymentStrategyId.");
1305
- }
1306
- resolvedPath = resolvedPath.replace("{DeploymentStrategyId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1307
- }
1308
- else {
1309
- throw new Error("No value provided for input HTTP label: DeploymentStrategyId.");
1310
- }
860
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeploymentStrategyId", () => input.DeploymentStrategyId, "{DeploymentStrategyId}", false);
1311
861
  let body;
1312
862
  body = JSON.stringify({
1313
863
  ...(input.DeploymentDurationInMinutes != null && {
@@ -1336,26 +886,8 @@ const serializeAws_restJson1UpdateEnvironmentCommand = async (input, context) =>
1336
886
  };
1337
887
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1338
888
  "/applications/{ApplicationId}/environments/{EnvironmentId}";
1339
- if (input.ApplicationId !== undefined) {
1340
- const labelValue = input.ApplicationId;
1341
- if (labelValue.length <= 0) {
1342
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1343
- }
1344
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1345
- }
1346
- else {
1347
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1348
- }
1349
- if (input.EnvironmentId !== undefined) {
1350
- const labelValue = input.EnvironmentId;
1351
- if (labelValue.length <= 0) {
1352
- throw new Error("Empty value provided for input HTTP label: EnvironmentId.");
1353
- }
1354
- resolvedPath = resolvedPath.replace("{EnvironmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1355
- }
1356
- else {
1357
- throw new Error("No value provided for input HTTP label: EnvironmentId.");
1358
- }
889
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
890
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentId", () => input.EnvironmentId, "{EnvironmentId}", false);
1359
891
  let body;
1360
892
  body = JSON.stringify({
1361
893
  ...(input.Description != null && { Description: input.Description }),
@@ -1379,16 +911,7 @@ const serializeAws_restJson1UpdateExtensionCommand = async (input, context) => {
1379
911
  "content-type": "application/json",
1380
912
  };
1381
913
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/extensions/{ExtensionIdentifier}";
1382
- if (input.ExtensionIdentifier !== undefined) {
1383
- const labelValue = input.ExtensionIdentifier;
1384
- if (labelValue.length <= 0) {
1385
- throw new Error("Empty value provided for input HTTP label: ExtensionIdentifier.");
1386
- }
1387
- resolvedPath = resolvedPath.replace("{ExtensionIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1388
- }
1389
- else {
1390
- throw new Error("No value provided for input HTTP label: ExtensionIdentifier.");
1391
- }
914
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionIdentifier", () => input.ExtensionIdentifier, "{ExtensionIdentifier}", false);
1392
915
  let body;
1393
916
  body = JSON.stringify({
1394
917
  ...(input.Actions != null && { Actions: serializeAws_restJson1ActionsMap(input.Actions, context) }),
@@ -1414,16 +937,7 @@ const serializeAws_restJson1UpdateExtensionAssociationCommand = async (input, co
1414
937
  };
1415
938
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1416
939
  "/extensionassociations/{ExtensionAssociationId}";
1417
- if (input.ExtensionAssociationId !== undefined) {
1418
- const labelValue = input.ExtensionAssociationId;
1419
- if (labelValue.length <= 0) {
1420
- throw new Error("Empty value provided for input HTTP label: ExtensionAssociationId.");
1421
- }
1422
- resolvedPath = resolvedPath.replace("{ExtensionAssociationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1423
- }
1424
- else {
1425
- throw new Error("No value provided for input HTTP label: ExtensionAssociationId.");
1426
- }
940
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ExtensionAssociationId", () => input.ExtensionAssociationId, "{ExtensionAssociationId}", false);
1427
941
  let body;
1428
942
  body = JSON.stringify({
1429
943
  ...(input.Parameters != null && { Parameters: serializeAws_restJson1ParameterValueMap(input.Parameters, context) }),
@@ -1444,29 +958,11 @@ const serializeAws_restJson1ValidateConfigurationCommand = async (input, context
1444
958
  const headers = {};
1445
959
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1446
960
  "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/validators";
1447
- if (input.ApplicationId !== undefined) {
1448
- const labelValue = input.ApplicationId;
1449
- if (labelValue.length <= 0) {
1450
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
1451
- }
1452
- resolvedPath = resolvedPath.replace("{ApplicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1453
- }
1454
- else {
1455
- throw new Error("No value provided for input HTTP label: ApplicationId.");
1456
- }
1457
- if (input.ConfigurationProfileId !== undefined) {
1458
- const labelValue = input.ConfigurationProfileId;
1459
- if (labelValue.length <= 0) {
1460
- throw new Error("Empty value provided for input HTTP label: ConfigurationProfileId.");
1461
- }
1462
- resolvedPath = resolvedPath.replace("{ConfigurationProfileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1463
- }
1464
- else {
1465
- throw new Error("No value provided for input HTTP label: ConfigurationProfileId.");
1466
- }
1467
- const query = {
1468
- ...(input.ConfigurationVersion !== undefined && { configuration_version: input.ConfigurationVersion }),
1469
- };
961
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
962
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationProfileId", () => input.ConfigurationProfileId, "{ConfigurationProfileId}", false);
963
+ const query = map({
964
+ configuration_version: [, input.ConfigurationVersion],
965
+ });
1470
966
  let body;
1471
967
  return new protocol_http_1.HttpRequest({
1472
968
  protocol,
@@ -1484,23 +980,20 @@ const deserializeAws_restJson1CreateApplicationCommand = async (output, context)
1484
980
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1485
981
  return deserializeAws_restJson1CreateApplicationCommandError(output, context);
1486
982
  }
1487
- const contents = {
983
+ const contents = map({
1488
984
  $metadata: deserializeMetadata(output),
1489
- Description: undefined,
1490
- Id: undefined,
1491
- Name: undefined,
1492
- };
985
+ });
1493
986
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1494
- if (data.Description !== undefined && data.Description !== null) {
987
+ if (data.Description != null) {
1495
988
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1496
989
  }
1497
- if (data.Id !== undefined && data.Id !== null) {
990
+ if (data.Id != null) {
1498
991
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1499
992
  }
1500
- if (data.Name !== undefined && data.Name !== null) {
993
+ if (data.Name != null) {
1501
994
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1502
995
  }
1503
- return Promise.resolve(contents);
996
+ return contents;
1504
997
  };
1505
998
  exports.deserializeAws_restJson1CreateApplicationCommand = deserializeAws_restJson1CreateApplicationCommand;
1506
999
  const deserializeAws_restJson1CreateApplicationCommandError = async (output, context) => {
@@ -1508,7 +1001,6 @@ const deserializeAws_restJson1CreateApplicationCommandError = async (output, con
1508
1001
  ...output,
1509
1002
  body: await parseBody(output.body, context),
1510
1003
  };
1511
- let response;
1512
1004
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
1005
  switch (errorCode) {
1514
1006
  case "BadRequestException":
@@ -1519,57 +1011,47 @@ const deserializeAws_restJson1CreateApplicationCommandError = async (output, con
1519
1011
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1520
1012
  default:
1521
1013
  const parsedBody = parsedOutput.body;
1522
- const $metadata = deserializeMetadata(output);
1523
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1524
- response = new AppConfigServiceException_1.AppConfigServiceException({
1525
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1526
- $fault: "client",
1527
- $metadata,
1014
+ (0, smithy_client_1.throwDefaultError)({
1015
+ output,
1016
+ parsedBody,
1017
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1018
+ errorCode,
1528
1019
  });
1529
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1530
1020
  }
1531
1021
  };
1532
1022
  const deserializeAws_restJson1CreateConfigurationProfileCommand = async (output, context) => {
1533
1023
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1534
1024
  return deserializeAws_restJson1CreateConfigurationProfileCommandError(output, context);
1535
1025
  }
1536
- const contents = {
1026
+ const contents = map({
1537
1027
  $metadata: deserializeMetadata(output),
1538
- ApplicationId: undefined,
1539
- Description: undefined,
1540
- Id: undefined,
1541
- LocationUri: undefined,
1542
- Name: undefined,
1543
- RetrievalRoleArn: undefined,
1544
- Type: undefined,
1545
- Validators: undefined,
1546
- };
1028
+ });
1547
1029
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1548
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1030
+ if (data.ApplicationId != null) {
1549
1031
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1550
1032
  }
1551
- if (data.Description !== undefined && data.Description !== null) {
1033
+ if (data.Description != null) {
1552
1034
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1553
1035
  }
1554
- if (data.Id !== undefined && data.Id !== null) {
1036
+ if (data.Id != null) {
1555
1037
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1556
1038
  }
1557
- if (data.LocationUri !== undefined && data.LocationUri !== null) {
1039
+ if (data.LocationUri != null) {
1558
1040
  contents.LocationUri = (0, smithy_client_1.expectString)(data.LocationUri);
1559
1041
  }
1560
- if (data.Name !== undefined && data.Name !== null) {
1042
+ if (data.Name != null) {
1561
1043
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1562
1044
  }
1563
- if (data.RetrievalRoleArn !== undefined && data.RetrievalRoleArn !== null) {
1045
+ if (data.RetrievalRoleArn != null) {
1564
1046
  contents.RetrievalRoleArn = (0, smithy_client_1.expectString)(data.RetrievalRoleArn);
1565
1047
  }
1566
- if (data.Type !== undefined && data.Type !== null) {
1048
+ if (data.Type != null) {
1567
1049
  contents.Type = (0, smithy_client_1.expectString)(data.Type);
1568
1050
  }
1569
- if (data.Validators !== undefined && data.Validators !== null) {
1051
+ if (data.Validators != null) {
1570
1052
  contents.Validators = deserializeAws_restJson1ValidatorList(data.Validators, context);
1571
1053
  }
1572
- return Promise.resolve(contents);
1054
+ return contents;
1573
1055
  };
1574
1056
  exports.deserializeAws_restJson1CreateConfigurationProfileCommand = deserializeAws_restJson1CreateConfigurationProfileCommand;
1575
1057
  const deserializeAws_restJson1CreateConfigurationProfileCommandError = async (output, context) => {
@@ -1577,7 +1059,6 @@ const deserializeAws_restJson1CreateConfigurationProfileCommandError = async (ou
1577
1059
  ...output,
1578
1060
  body: await parseBody(output.body, context),
1579
1061
  };
1580
- let response;
1581
1062
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1582
1063
  switch (errorCode) {
1583
1064
  case "BadRequestException":
@@ -1591,57 +1072,47 @@ const deserializeAws_restJson1CreateConfigurationProfileCommandError = async (ou
1591
1072
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1592
1073
  default:
1593
1074
  const parsedBody = parsedOutput.body;
1594
- const $metadata = deserializeMetadata(output);
1595
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1596
- response = new AppConfigServiceException_1.AppConfigServiceException({
1597
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1598
- $fault: "client",
1599
- $metadata,
1075
+ (0, smithy_client_1.throwDefaultError)({
1076
+ output,
1077
+ parsedBody,
1078
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1079
+ errorCode,
1600
1080
  });
1601
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1602
1081
  }
1603
1082
  };
1604
1083
  const deserializeAws_restJson1CreateDeploymentStrategyCommand = async (output, context) => {
1605
1084
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1606
1085
  return deserializeAws_restJson1CreateDeploymentStrategyCommandError(output, context);
1607
1086
  }
1608
- const contents = {
1087
+ const contents = map({
1609
1088
  $metadata: deserializeMetadata(output),
1610
- DeploymentDurationInMinutes: undefined,
1611
- Description: undefined,
1612
- FinalBakeTimeInMinutes: undefined,
1613
- GrowthFactor: undefined,
1614
- GrowthType: undefined,
1615
- Id: undefined,
1616
- Name: undefined,
1617
- ReplicateTo: undefined,
1618
- };
1089
+ });
1619
1090
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1620
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
1091
+ if (data.DeploymentDurationInMinutes != null) {
1621
1092
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
1622
1093
  }
1623
- if (data.Description !== undefined && data.Description !== null) {
1094
+ if (data.Description != null) {
1624
1095
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1625
1096
  }
1626
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
1097
+ if (data.FinalBakeTimeInMinutes != null) {
1627
1098
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
1628
1099
  }
1629
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
1100
+ if (data.GrowthFactor != null) {
1630
1101
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
1631
1102
  }
1632
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
1103
+ if (data.GrowthType != null) {
1633
1104
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
1634
1105
  }
1635
- if (data.Id !== undefined && data.Id !== null) {
1106
+ if (data.Id != null) {
1636
1107
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1637
1108
  }
1638
- if (data.Name !== undefined && data.Name !== null) {
1109
+ if (data.Name != null) {
1639
1110
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1640
1111
  }
1641
- if (data.ReplicateTo !== undefined && data.ReplicateTo !== null) {
1112
+ if (data.ReplicateTo != null) {
1642
1113
  contents.ReplicateTo = (0, smithy_client_1.expectString)(data.ReplicateTo);
1643
1114
  }
1644
- return Promise.resolve(contents);
1115
+ return contents;
1645
1116
  };
1646
1117
  exports.deserializeAws_restJson1CreateDeploymentStrategyCommand = deserializeAws_restJson1CreateDeploymentStrategyCommand;
1647
1118
  const deserializeAws_restJson1CreateDeploymentStrategyCommandError = async (output, context) => {
@@ -1649,7 +1120,6 @@ const deserializeAws_restJson1CreateDeploymentStrategyCommandError = async (outp
1649
1120
  ...output,
1650
1121
  body: await parseBody(output.body, context),
1651
1122
  };
1652
- let response;
1653
1123
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1654
1124
  switch (errorCode) {
1655
1125
  case "BadRequestException":
@@ -1660,49 +1130,41 @@ const deserializeAws_restJson1CreateDeploymentStrategyCommandError = async (outp
1660
1130
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1661
1131
  default:
1662
1132
  const parsedBody = parsedOutput.body;
1663
- const $metadata = deserializeMetadata(output);
1664
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1665
- response = new AppConfigServiceException_1.AppConfigServiceException({
1666
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1667
- $fault: "client",
1668
- $metadata,
1133
+ (0, smithy_client_1.throwDefaultError)({
1134
+ output,
1135
+ parsedBody,
1136
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1137
+ errorCode,
1669
1138
  });
1670
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1671
1139
  }
1672
1140
  };
1673
1141
  const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
1674
1142
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1675
1143
  return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
1676
1144
  }
1677
- const contents = {
1145
+ const contents = map({
1678
1146
  $metadata: deserializeMetadata(output),
1679
- ApplicationId: undefined,
1680
- Description: undefined,
1681
- Id: undefined,
1682
- Monitors: undefined,
1683
- Name: undefined,
1684
- State: undefined,
1685
- };
1147
+ });
1686
1148
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1687
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1149
+ if (data.ApplicationId != null) {
1688
1150
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1689
1151
  }
1690
- if (data.Description !== undefined && data.Description !== null) {
1152
+ if (data.Description != null) {
1691
1153
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1692
1154
  }
1693
- if (data.Id !== undefined && data.Id !== null) {
1155
+ if (data.Id != null) {
1694
1156
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1695
1157
  }
1696
- if (data.Monitors !== undefined && data.Monitors !== null) {
1158
+ if (data.Monitors != null) {
1697
1159
  contents.Monitors = deserializeAws_restJson1MonitorList(data.Monitors, context);
1698
1160
  }
1699
- if (data.Name !== undefined && data.Name !== null) {
1161
+ if (data.Name != null) {
1700
1162
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1701
1163
  }
1702
- if (data.State !== undefined && data.State !== null) {
1164
+ if (data.State != null) {
1703
1165
  contents.State = (0, smithy_client_1.expectString)(data.State);
1704
1166
  }
1705
- return Promise.resolve(contents);
1167
+ return contents;
1706
1168
  };
1707
1169
  exports.deserializeAws_restJson1CreateEnvironmentCommand = deserializeAws_restJson1CreateEnvironmentCommand;
1708
1170
  const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
@@ -1710,7 +1172,6 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
1710
1172
  ...output,
1711
1173
  body: await parseBody(output.body, context),
1712
1174
  };
1713
- let response;
1714
1175
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1715
1176
  switch (errorCode) {
1716
1177
  case "BadRequestException":
@@ -1724,53 +1185,44 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
1724
1185
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1725
1186
  default:
1726
1187
  const parsedBody = parsedOutput.body;
1727
- const $metadata = deserializeMetadata(output);
1728
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1729
- response = new AppConfigServiceException_1.AppConfigServiceException({
1730
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1731
- $fault: "client",
1732
- $metadata,
1188
+ (0, smithy_client_1.throwDefaultError)({
1189
+ output,
1190
+ parsedBody,
1191
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1192
+ errorCode,
1733
1193
  });
1734
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1735
1194
  }
1736
1195
  };
1737
1196
  const deserializeAws_restJson1CreateExtensionCommand = async (output, context) => {
1738
1197
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1739
1198
  return deserializeAws_restJson1CreateExtensionCommandError(output, context);
1740
1199
  }
1741
- const contents = {
1200
+ const contents = map({
1742
1201
  $metadata: deserializeMetadata(output),
1743
- Actions: undefined,
1744
- Arn: undefined,
1745
- Description: undefined,
1746
- Id: undefined,
1747
- Name: undefined,
1748
- Parameters: undefined,
1749
- VersionNumber: undefined,
1750
- };
1202
+ });
1751
1203
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1752
- if (data.Actions !== undefined && data.Actions !== null) {
1204
+ if (data.Actions != null) {
1753
1205
  contents.Actions = deserializeAws_restJson1ActionsMap(data.Actions, context);
1754
1206
  }
1755
- if (data.Arn !== undefined && data.Arn !== null) {
1207
+ if (data.Arn != null) {
1756
1208
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1757
1209
  }
1758
- if (data.Description !== undefined && data.Description !== null) {
1210
+ if (data.Description != null) {
1759
1211
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1760
1212
  }
1761
- if (data.Id !== undefined && data.Id !== null) {
1213
+ if (data.Id != null) {
1762
1214
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1763
1215
  }
1764
- if (data.Name !== undefined && data.Name !== null) {
1216
+ if (data.Name != null) {
1765
1217
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1766
1218
  }
1767
- if (data.Parameters !== undefined && data.Parameters !== null) {
1219
+ if (data.Parameters != null) {
1768
1220
  contents.Parameters = deserializeAws_restJson1ParameterMap(data.Parameters, context);
1769
1221
  }
1770
- if (data.VersionNumber !== undefined && data.VersionNumber !== null) {
1222
+ if (data.VersionNumber != null) {
1771
1223
  contents.VersionNumber = (0, smithy_client_1.expectInt32)(data.VersionNumber);
1772
1224
  }
1773
- return Promise.resolve(contents);
1225
+ return contents;
1774
1226
  };
1775
1227
  exports.deserializeAws_restJson1CreateExtensionCommand = deserializeAws_restJson1CreateExtensionCommand;
1776
1228
  const deserializeAws_restJson1CreateExtensionCommandError = async (output, context) => {
@@ -1778,7 +1230,6 @@ const deserializeAws_restJson1CreateExtensionCommandError = async (output, conte
1778
1230
  ...output,
1779
1231
  body: await parseBody(output.body, context),
1780
1232
  };
1781
- let response;
1782
1233
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1783
1234
  switch (errorCode) {
1784
1235
  case "BadRequestException":
@@ -1795,49 +1246,41 @@ const deserializeAws_restJson1CreateExtensionCommandError = async (output, conte
1795
1246
  throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1796
1247
  default:
1797
1248
  const parsedBody = parsedOutput.body;
1798
- const $metadata = deserializeMetadata(output);
1799
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1800
- response = new AppConfigServiceException_1.AppConfigServiceException({
1801
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1802
- $fault: "client",
1803
- $metadata,
1249
+ (0, smithy_client_1.throwDefaultError)({
1250
+ output,
1251
+ parsedBody,
1252
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1253
+ errorCode,
1804
1254
  });
1805
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1806
1255
  }
1807
1256
  };
1808
1257
  const deserializeAws_restJson1CreateExtensionAssociationCommand = async (output, context) => {
1809
1258
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1810
1259
  return deserializeAws_restJson1CreateExtensionAssociationCommandError(output, context);
1811
1260
  }
1812
- const contents = {
1261
+ const contents = map({
1813
1262
  $metadata: deserializeMetadata(output),
1814
- Arn: undefined,
1815
- ExtensionArn: undefined,
1816
- ExtensionVersionNumber: undefined,
1817
- Id: undefined,
1818
- Parameters: undefined,
1819
- ResourceArn: undefined,
1820
- };
1263
+ });
1821
1264
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1822
- if (data.Arn !== undefined && data.Arn !== null) {
1265
+ if (data.Arn != null) {
1823
1266
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1824
1267
  }
1825
- if (data.ExtensionArn !== undefined && data.ExtensionArn !== null) {
1268
+ if (data.ExtensionArn != null) {
1826
1269
  contents.ExtensionArn = (0, smithy_client_1.expectString)(data.ExtensionArn);
1827
1270
  }
1828
- if (data.ExtensionVersionNumber !== undefined && data.ExtensionVersionNumber !== null) {
1271
+ if (data.ExtensionVersionNumber != null) {
1829
1272
  contents.ExtensionVersionNumber = (0, smithy_client_1.expectInt32)(data.ExtensionVersionNumber);
1830
1273
  }
1831
- if (data.Id !== undefined && data.Id !== null) {
1274
+ if (data.Id != null) {
1832
1275
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
1833
1276
  }
1834
- if (data.Parameters !== undefined && data.Parameters !== null) {
1277
+ if (data.Parameters != null) {
1835
1278
  contents.Parameters = deserializeAws_restJson1ParameterValueMap(data.Parameters, context);
1836
1279
  }
1837
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
1280
+ if (data.ResourceArn != null) {
1838
1281
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
1839
1282
  }
1840
- return Promise.resolve(contents);
1283
+ return contents;
1841
1284
  };
1842
1285
  exports.deserializeAws_restJson1CreateExtensionAssociationCommand = deserializeAws_restJson1CreateExtensionAssociationCommand;
1843
1286
  const deserializeAws_restJson1CreateExtensionAssociationCommandError = async (output, context) => {
@@ -1845,7 +1288,6 @@ const deserializeAws_restJson1CreateExtensionAssociationCommandError = async (ou
1845
1288
  ...output,
1846
1289
  body: await parseBody(output.body, context),
1847
1290
  };
1848
- let response;
1849
1291
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1850
1292
  switch (errorCode) {
1851
1293
  case "BadRequestException":
@@ -1862,47 +1304,32 @@ const deserializeAws_restJson1CreateExtensionAssociationCommandError = async (ou
1862
1304
  throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1863
1305
  default:
1864
1306
  const parsedBody = parsedOutput.body;
1865
- const $metadata = deserializeMetadata(output);
1866
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1867
- response = new AppConfigServiceException_1.AppConfigServiceException({
1868
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1869
- $fault: "client",
1870
- $metadata,
1307
+ (0, smithy_client_1.throwDefaultError)({
1308
+ output,
1309
+ parsedBody,
1310
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1311
+ errorCode,
1871
1312
  });
1872
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1873
1313
  }
1874
1314
  };
1875
1315
  const deserializeAws_restJson1CreateHostedConfigurationVersionCommand = async (output, context) => {
1876
1316
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1877
1317
  return deserializeAws_restJson1CreateHostedConfigurationVersionCommandError(output, context);
1878
1318
  }
1879
- const contents = {
1319
+ const contents = map({
1880
1320
  $metadata: deserializeMetadata(output),
1881
- ApplicationId: undefined,
1882
- ConfigurationProfileId: undefined,
1883
- Content: undefined,
1884
- ContentType: undefined,
1885
- Description: undefined,
1886
- VersionNumber: undefined,
1887
- };
1888
- if (output.headers["application-id"] !== undefined) {
1889
- contents.ApplicationId = output.headers["application-id"];
1890
- }
1891
- if (output.headers["configuration-profile-id"] !== undefined) {
1892
- contents.ConfigurationProfileId = output.headers["configuration-profile-id"];
1893
- }
1894
- if (output.headers["version-number"] !== undefined) {
1895
- contents.VersionNumber = (0, smithy_client_1.strictParseInt32)(output.headers["version-number"]);
1896
- }
1897
- if (output.headers["description"] !== undefined) {
1898
- contents.Description = output.headers["description"];
1899
- }
1900
- if (output.headers["content-type"] !== undefined) {
1901
- contents.ContentType = output.headers["content-type"];
1902
- }
1321
+ ApplicationId: [, output.headers["application-id"]],
1322
+ ConfigurationProfileId: [, output.headers["configuration-profile-id"]],
1323
+ VersionNumber: [
1324
+ () => void 0 !== output.headers["version-number"],
1325
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["version-number"]),
1326
+ ],
1327
+ Description: [, output.headers["description"]],
1328
+ ContentType: [, output.headers["content-type"]],
1329
+ });
1903
1330
  const data = await collectBody(output.body, context);
1904
1331
  contents.Content = data;
1905
- return Promise.resolve(contents);
1332
+ return contents;
1906
1333
  };
1907
1334
  exports.deserializeAws_restJson1CreateHostedConfigurationVersionCommand = deserializeAws_restJson1CreateHostedConfigurationVersionCommand;
1908
1335
  const deserializeAws_restJson1CreateHostedConfigurationVersionCommandError = async (output, context) => {
@@ -1910,7 +1337,6 @@ const deserializeAws_restJson1CreateHostedConfigurationVersionCommandError = asy
1910
1337
  ...output,
1911
1338
  body: await parseBody(output.body, context),
1912
1339
  };
1913
- let response;
1914
1340
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1915
1341
  switch (errorCode) {
1916
1342
  case "BadRequestException":
@@ -1933,25 +1359,23 @@ const deserializeAws_restJson1CreateHostedConfigurationVersionCommandError = asy
1933
1359
  throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1934
1360
  default:
1935
1361
  const parsedBody = parsedOutput.body;
1936
- const $metadata = deserializeMetadata(output);
1937
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1938
- response = new AppConfigServiceException_1.AppConfigServiceException({
1939
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1940
- $fault: "client",
1941
- $metadata,
1362
+ (0, smithy_client_1.throwDefaultError)({
1363
+ output,
1364
+ parsedBody,
1365
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1366
+ errorCode,
1942
1367
  });
1943
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1944
1368
  }
1945
1369
  };
1946
1370
  const deserializeAws_restJson1DeleteApplicationCommand = async (output, context) => {
1947
1371
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1948
1372
  return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
1949
1373
  }
1950
- const contents = {
1374
+ const contents = map({
1951
1375
  $metadata: deserializeMetadata(output),
1952
- };
1376
+ });
1953
1377
  await collectBody(output.body, context);
1954
- return Promise.resolve(contents);
1378
+ return contents;
1955
1379
  };
1956
1380
  exports.deserializeAws_restJson1DeleteApplicationCommand = deserializeAws_restJson1DeleteApplicationCommand;
1957
1381
  const deserializeAws_restJson1DeleteApplicationCommandError = async (output, context) => {
@@ -1959,7 +1383,6 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, con
1959
1383
  ...output,
1960
1384
  body: await parseBody(output.body, context),
1961
1385
  };
1962
- let response;
1963
1386
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1964
1387
  switch (errorCode) {
1965
1388
  case "BadRequestException":
@@ -1973,25 +1396,23 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, con
1973
1396
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1974
1397
  default:
1975
1398
  const parsedBody = parsedOutput.body;
1976
- const $metadata = deserializeMetadata(output);
1977
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1978
- response = new AppConfigServiceException_1.AppConfigServiceException({
1979
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1980
- $fault: "client",
1981
- $metadata,
1399
+ (0, smithy_client_1.throwDefaultError)({
1400
+ output,
1401
+ parsedBody,
1402
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1403
+ errorCode,
1982
1404
  });
1983
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1984
1405
  }
1985
1406
  };
1986
1407
  const deserializeAws_restJson1DeleteConfigurationProfileCommand = async (output, context) => {
1987
1408
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1988
1409
  return deserializeAws_restJson1DeleteConfigurationProfileCommandError(output, context);
1989
1410
  }
1990
- const contents = {
1411
+ const contents = map({
1991
1412
  $metadata: deserializeMetadata(output),
1992
- };
1413
+ });
1993
1414
  await collectBody(output.body, context);
1994
- return Promise.resolve(contents);
1415
+ return contents;
1995
1416
  };
1996
1417
  exports.deserializeAws_restJson1DeleteConfigurationProfileCommand = deserializeAws_restJson1DeleteConfigurationProfileCommand;
1997
1418
  const deserializeAws_restJson1DeleteConfigurationProfileCommandError = async (output, context) => {
@@ -1999,7 +1420,6 @@ const deserializeAws_restJson1DeleteConfigurationProfileCommandError = async (ou
1999
1420
  ...output,
2000
1421
  body: await parseBody(output.body, context),
2001
1422
  };
2002
- let response;
2003
1423
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2004
1424
  switch (errorCode) {
2005
1425
  case "BadRequestException":
@@ -2016,25 +1436,23 @@ const deserializeAws_restJson1DeleteConfigurationProfileCommandError = async (ou
2016
1436
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2017
1437
  default:
2018
1438
  const parsedBody = parsedOutput.body;
2019
- const $metadata = deserializeMetadata(output);
2020
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2021
- response = new AppConfigServiceException_1.AppConfigServiceException({
2022
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2023
- $fault: "client",
2024
- $metadata,
1439
+ (0, smithy_client_1.throwDefaultError)({
1440
+ output,
1441
+ parsedBody,
1442
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1443
+ errorCode,
2025
1444
  });
2026
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2027
1445
  }
2028
1446
  };
2029
1447
  const deserializeAws_restJson1DeleteDeploymentStrategyCommand = async (output, context) => {
2030
1448
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2031
1449
  return deserializeAws_restJson1DeleteDeploymentStrategyCommandError(output, context);
2032
1450
  }
2033
- const contents = {
1451
+ const contents = map({
2034
1452
  $metadata: deserializeMetadata(output),
2035
- };
1453
+ });
2036
1454
  await collectBody(output.body, context);
2037
- return Promise.resolve(contents);
1455
+ return contents;
2038
1456
  };
2039
1457
  exports.deserializeAws_restJson1DeleteDeploymentStrategyCommand = deserializeAws_restJson1DeleteDeploymentStrategyCommand;
2040
1458
  const deserializeAws_restJson1DeleteDeploymentStrategyCommandError = async (output, context) => {
@@ -2042,7 +1460,6 @@ const deserializeAws_restJson1DeleteDeploymentStrategyCommandError = async (outp
2042
1460
  ...output,
2043
1461
  body: await parseBody(output.body, context),
2044
1462
  };
2045
- let response;
2046
1463
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2047
1464
  switch (errorCode) {
2048
1465
  case "BadRequestException":
@@ -2056,25 +1473,23 @@ const deserializeAws_restJson1DeleteDeploymentStrategyCommandError = async (outp
2056
1473
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2057
1474
  default:
2058
1475
  const parsedBody = parsedOutput.body;
2059
- const $metadata = deserializeMetadata(output);
2060
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2061
- response = new AppConfigServiceException_1.AppConfigServiceException({
2062
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2063
- $fault: "client",
2064
- $metadata,
1476
+ (0, smithy_client_1.throwDefaultError)({
1477
+ output,
1478
+ parsedBody,
1479
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1480
+ errorCode,
2065
1481
  });
2066
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2067
1482
  }
2068
1483
  };
2069
1484
  const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
2070
1485
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2071
1486
  return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
2072
1487
  }
2073
- const contents = {
1488
+ const contents = map({
2074
1489
  $metadata: deserializeMetadata(output),
2075
- };
1490
+ });
2076
1491
  await collectBody(output.body, context);
2077
- return Promise.resolve(contents);
1492
+ return contents;
2078
1493
  };
2079
1494
  exports.deserializeAws_restJson1DeleteEnvironmentCommand = deserializeAws_restJson1DeleteEnvironmentCommand;
2080
1495
  const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
@@ -2082,7 +1497,6 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
2082
1497
  ...output,
2083
1498
  body: await parseBody(output.body, context),
2084
1499
  };
2085
- let response;
2086
1500
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2087
1501
  switch (errorCode) {
2088
1502
  case "BadRequestException":
@@ -2099,25 +1513,23 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
2099
1513
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2100
1514
  default:
2101
1515
  const parsedBody = parsedOutput.body;
2102
- const $metadata = deserializeMetadata(output);
2103
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2104
- response = new AppConfigServiceException_1.AppConfigServiceException({
2105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2106
- $fault: "client",
2107
- $metadata,
1516
+ (0, smithy_client_1.throwDefaultError)({
1517
+ output,
1518
+ parsedBody,
1519
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1520
+ errorCode,
2108
1521
  });
2109
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2110
1522
  }
2111
1523
  };
2112
1524
  const deserializeAws_restJson1DeleteExtensionCommand = async (output, context) => {
2113
1525
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2114
1526
  return deserializeAws_restJson1DeleteExtensionCommandError(output, context);
2115
1527
  }
2116
- const contents = {
1528
+ const contents = map({
2117
1529
  $metadata: deserializeMetadata(output),
2118
- };
1530
+ });
2119
1531
  await collectBody(output.body, context);
2120
- return Promise.resolve(contents);
1532
+ return contents;
2121
1533
  };
2122
1534
  exports.deserializeAws_restJson1DeleteExtensionCommand = deserializeAws_restJson1DeleteExtensionCommand;
2123
1535
  const deserializeAws_restJson1DeleteExtensionCommandError = async (output, context) => {
@@ -2125,7 +1537,6 @@ const deserializeAws_restJson1DeleteExtensionCommandError = async (output, conte
2125
1537
  ...output,
2126
1538
  body: await parseBody(output.body, context),
2127
1539
  };
2128
- let response;
2129
1540
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2130
1541
  switch (errorCode) {
2131
1542
  case "BadRequestException":
@@ -2139,25 +1550,23 @@ const deserializeAws_restJson1DeleteExtensionCommandError = async (output, conte
2139
1550
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2140
1551
  default:
2141
1552
  const parsedBody = parsedOutput.body;
2142
- const $metadata = deserializeMetadata(output);
2143
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2144
- response = new AppConfigServiceException_1.AppConfigServiceException({
2145
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2146
- $fault: "client",
2147
- $metadata,
1553
+ (0, smithy_client_1.throwDefaultError)({
1554
+ output,
1555
+ parsedBody,
1556
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1557
+ errorCode,
2148
1558
  });
2149
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2150
1559
  }
2151
1560
  };
2152
1561
  const deserializeAws_restJson1DeleteExtensionAssociationCommand = async (output, context) => {
2153
1562
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2154
1563
  return deserializeAws_restJson1DeleteExtensionAssociationCommandError(output, context);
2155
1564
  }
2156
- const contents = {
1565
+ const contents = map({
2157
1566
  $metadata: deserializeMetadata(output),
2158
- };
1567
+ });
2159
1568
  await collectBody(output.body, context);
2160
- return Promise.resolve(contents);
1569
+ return contents;
2161
1570
  };
2162
1571
  exports.deserializeAws_restJson1DeleteExtensionAssociationCommand = deserializeAws_restJson1DeleteExtensionAssociationCommand;
2163
1572
  const deserializeAws_restJson1DeleteExtensionAssociationCommandError = async (output, context) => {
@@ -2165,7 +1574,6 @@ const deserializeAws_restJson1DeleteExtensionAssociationCommandError = async (ou
2165
1574
  ...output,
2166
1575
  body: await parseBody(output.body, context),
2167
1576
  };
2168
- let response;
2169
1577
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2170
1578
  switch (errorCode) {
2171
1579
  case "BadRequestException":
@@ -2179,25 +1587,23 @@ const deserializeAws_restJson1DeleteExtensionAssociationCommandError = async (ou
2179
1587
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2180
1588
  default:
2181
1589
  const parsedBody = parsedOutput.body;
2182
- const $metadata = deserializeMetadata(output);
2183
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2184
- response = new AppConfigServiceException_1.AppConfigServiceException({
2185
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2186
- $fault: "client",
2187
- $metadata,
1590
+ (0, smithy_client_1.throwDefaultError)({
1591
+ output,
1592
+ parsedBody,
1593
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1594
+ errorCode,
2188
1595
  });
2189
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2190
1596
  }
2191
1597
  };
2192
1598
  const deserializeAws_restJson1DeleteHostedConfigurationVersionCommand = async (output, context) => {
2193
1599
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2194
1600
  return deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError(output, context);
2195
1601
  }
2196
- const contents = {
1602
+ const contents = map({
2197
1603
  $metadata: deserializeMetadata(output),
2198
- };
1604
+ });
2199
1605
  await collectBody(output.body, context);
2200
- return Promise.resolve(contents);
1606
+ return contents;
2201
1607
  };
2202
1608
  exports.deserializeAws_restJson1DeleteHostedConfigurationVersionCommand = deserializeAws_restJson1DeleteHostedConfigurationVersionCommand;
2203
1609
  const deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError = async (output, context) => {
@@ -2205,7 +1611,6 @@ const deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError = asy
2205
1611
  ...output,
2206
1612
  body: await parseBody(output.body, context),
2207
1613
  };
2208
- let response;
2209
1614
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2210
1615
  switch (errorCode) {
2211
1616
  case "BadRequestException":
@@ -2219,37 +1624,32 @@ const deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError = asy
2219
1624
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2220
1625
  default:
2221
1626
  const parsedBody = parsedOutput.body;
2222
- const $metadata = deserializeMetadata(output);
2223
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2224
- response = new AppConfigServiceException_1.AppConfigServiceException({
2225
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2226
- $fault: "client",
2227
- $metadata,
1627
+ (0, smithy_client_1.throwDefaultError)({
1628
+ output,
1629
+ parsedBody,
1630
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1631
+ errorCode,
2228
1632
  });
2229
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2230
1633
  }
2231
1634
  };
2232
1635
  const deserializeAws_restJson1GetApplicationCommand = async (output, context) => {
2233
1636
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2234
1637
  return deserializeAws_restJson1GetApplicationCommandError(output, context);
2235
1638
  }
2236
- const contents = {
1639
+ const contents = map({
2237
1640
  $metadata: deserializeMetadata(output),
2238
- Description: undefined,
2239
- Id: undefined,
2240
- Name: undefined,
2241
- };
1641
+ });
2242
1642
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2243
- if (data.Description !== undefined && data.Description !== null) {
1643
+ if (data.Description != null) {
2244
1644
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2245
1645
  }
2246
- if (data.Id !== undefined && data.Id !== null) {
1646
+ if (data.Id != null) {
2247
1647
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2248
1648
  }
2249
- if (data.Name !== undefined && data.Name !== null) {
1649
+ if (data.Name != null) {
2250
1650
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2251
1651
  }
2252
- return Promise.resolve(contents);
1652
+ return contents;
2253
1653
  };
2254
1654
  exports.deserializeAws_restJson1GetApplicationCommand = deserializeAws_restJson1GetApplicationCommand;
2255
1655
  const deserializeAws_restJson1GetApplicationCommandError = async (output, context) => {
@@ -2257,7 +1657,6 @@ const deserializeAws_restJson1GetApplicationCommandError = async (output, contex
2257
1657
  ...output,
2258
1658
  body: await parseBody(output.body, context),
2259
1659
  };
2260
- let response;
2261
1660
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2262
1661
  switch (errorCode) {
2263
1662
  case "BadRequestException":
@@ -2271,35 +1670,26 @@ const deserializeAws_restJson1GetApplicationCommandError = async (output, contex
2271
1670
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2272
1671
  default:
2273
1672
  const parsedBody = parsedOutput.body;
2274
- const $metadata = deserializeMetadata(output);
2275
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2276
- response = new AppConfigServiceException_1.AppConfigServiceException({
2277
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2278
- $fault: "client",
2279
- $metadata,
1673
+ (0, smithy_client_1.throwDefaultError)({
1674
+ output,
1675
+ parsedBody,
1676
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1677
+ errorCode,
2280
1678
  });
2281
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2282
1679
  }
2283
1680
  };
2284
1681
  const deserializeAws_restJson1GetConfigurationCommand = async (output, context) => {
2285
1682
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2286
1683
  return deserializeAws_restJson1GetConfigurationCommandError(output, context);
2287
1684
  }
2288
- const contents = {
1685
+ const contents = map({
2289
1686
  $metadata: deserializeMetadata(output),
2290
- ConfigurationVersion: undefined,
2291
- Content: undefined,
2292
- ContentType: undefined,
2293
- };
2294
- if (output.headers["configuration-version"] !== undefined) {
2295
- contents.ConfigurationVersion = output.headers["configuration-version"];
2296
- }
2297
- if (output.headers["content-type"] !== undefined) {
2298
- contents.ContentType = output.headers["content-type"];
2299
- }
1687
+ ConfigurationVersion: [, output.headers["configuration-version"]],
1688
+ ContentType: [, output.headers["content-type"]],
1689
+ });
2300
1690
  const data = await collectBody(output.body, context);
2301
1691
  contents.Content = data;
2302
- return Promise.resolve(contents);
1692
+ return contents;
2303
1693
  };
2304
1694
  exports.deserializeAws_restJson1GetConfigurationCommand = deserializeAws_restJson1GetConfigurationCommand;
2305
1695
  const deserializeAws_restJson1GetConfigurationCommandError = async (output, context) => {
@@ -2307,7 +1697,6 @@ const deserializeAws_restJson1GetConfigurationCommandError = async (output, cont
2307
1697
  ...output,
2308
1698
  body: await parseBody(output.body, context),
2309
1699
  };
2310
- let response;
2311
1700
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2312
1701
  switch (errorCode) {
2313
1702
  case "BadRequestException":
@@ -2321,57 +1710,47 @@ const deserializeAws_restJson1GetConfigurationCommandError = async (output, cont
2321
1710
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2322
1711
  default:
2323
1712
  const parsedBody = parsedOutput.body;
2324
- const $metadata = deserializeMetadata(output);
2325
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2326
- response = new AppConfigServiceException_1.AppConfigServiceException({
2327
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2328
- $fault: "client",
2329
- $metadata,
1713
+ (0, smithy_client_1.throwDefaultError)({
1714
+ output,
1715
+ parsedBody,
1716
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1717
+ errorCode,
2330
1718
  });
2331
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2332
1719
  }
2333
1720
  };
2334
1721
  const deserializeAws_restJson1GetConfigurationProfileCommand = async (output, context) => {
2335
1722
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2336
1723
  return deserializeAws_restJson1GetConfigurationProfileCommandError(output, context);
2337
1724
  }
2338
- const contents = {
1725
+ const contents = map({
2339
1726
  $metadata: deserializeMetadata(output),
2340
- ApplicationId: undefined,
2341
- Description: undefined,
2342
- Id: undefined,
2343
- LocationUri: undefined,
2344
- Name: undefined,
2345
- RetrievalRoleArn: undefined,
2346
- Type: undefined,
2347
- Validators: undefined,
2348
- };
1727
+ });
2349
1728
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2350
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1729
+ if (data.ApplicationId != null) {
2351
1730
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
2352
1731
  }
2353
- if (data.Description !== undefined && data.Description !== null) {
1732
+ if (data.Description != null) {
2354
1733
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2355
1734
  }
2356
- if (data.Id !== undefined && data.Id !== null) {
1735
+ if (data.Id != null) {
2357
1736
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2358
1737
  }
2359
- if (data.LocationUri !== undefined && data.LocationUri !== null) {
1738
+ if (data.LocationUri != null) {
2360
1739
  contents.LocationUri = (0, smithy_client_1.expectString)(data.LocationUri);
2361
1740
  }
2362
- if (data.Name !== undefined && data.Name !== null) {
1741
+ if (data.Name != null) {
2363
1742
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2364
1743
  }
2365
- if (data.RetrievalRoleArn !== undefined && data.RetrievalRoleArn !== null) {
1744
+ if (data.RetrievalRoleArn != null) {
2366
1745
  contents.RetrievalRoleArn = (0, smithy_client_1.expectString)(data.RetrievalRoleArn);
2367
1746
  }
2368
- if (data.Type !== undefined && data.Type !== null) {
1747
+ if (data.Type != null) {
2369
1748
  contents.Type = (0, smithy_client_1.expectString)(data.Type);
2370
1749
  }
2371
- if (data.Validators !== undefined && data.Validators !== null) {
1750
+ if (data.Validators != null) {
2372
1751
  contents.Validators = deserializeAws_restJson1ValidatorList(data.Validators, context);
2373
1752
  }
2374
- return Promise.resolve(contents);
1753
+ return contents;
2375
1754
  };
2376
1755
  exports.deserializeAws_restJson1GetConfigurationProfileCommand = deserializeAws_restJson1GetConfigurationProfileCommand;
2377
1756
  const deserializeAws_restJson1GetConfigurationProfileCommandError = async (output, context) => {
@@ -2379,7 +1758,6 @@ const deserializeAws_restJson1GetConfigurationProfileCommandError = async (outpu
2379
1758
  ...output,
2380
1759
  body: await parseBody(output.body, context),
2381
1760
  };
2382
- let response;
2383
1761
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2384
1762
  switch (errorCode) {
2385
1763
  case "BadRequestException":
@@ -2393,101 +1771,80 @@ const deserializeAws_restJson1GetConfigurationProfileCommandError = async (outpu
2393
1771
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2394
1772
  default:
2395
1773
  const parsedBody = parsedOutput.body;
2396
- const $metadata = deserializeMetadata(output);
2397
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2398
- response = new AppConfigServiceException_1.AppConfigServiceException({
2399
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2400
- $fault: "client",
2401
- $metadata,
1774
+ (0, smithy_client_1.throwDefaultError)({
1775
+ output,
1776
+ parsedBody,
1777
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1778
+ errorCode,
2402
1779
  });
2403
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2404
1780
  }
2405
1781
  };
2406
1782
  const deserializeAws_restJson1GetDeploymentCommand = async (output, context) => {
2407
1783
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2408
1784
  return deserializeAws_restJson1GetDeploymentCommandError(output, context);
2409
1785
  }
2410
- const contents = {
1786
+ const contents = map({
2411
1787
  $metadata: deserializeMetadata(output),
2412
- ApplicationId: undefined,
2413
- AppliedExtensions: undefined,
2414
- CompletedAt: undefined,
2415
- ConfigurationLocationUri: undefined,
2416
- ConfigurationName: undefined,
2417
- ConfigurationProfileId: undefined,
2418
- ConfigurationVersion: undefined,
2419
- DeploymentDurationInMinutes: undefined,
2420
- DeploymentNumber: undefined,
2421
- DeploymentStrategyId: undefined,
2422
- Description: undefined,
2423
- EnvironmentId: undefined,
2424
- EventLog: undefined,
2425
- FinalBakeTimeInMinutes: undefined,
2426
- GrowthFactor: undefined,
2427
- GrowthType: undefined,
2428
- PercentageComplete: undefined,
2429
- StartedAt: undefined,
2430
- State: undefined,
2431
- };
1788
+ });
2432
1789
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2433
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1790
+ if (data.ApplicationId != null) {
2434
1791
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
2435
1792
  }
2436
- if (data.AppliedExtensions !== undefined && data.AppliedExtensions !== null) {
1793
+ if (data.AppliedExtensions != null) {
2437
1794
  contents.AppliedExtensions = deserializeAws_restJson1AppliedExtensions(data.AppliedExtensions, context);
2438
1795
  }
2439
- if (data.CompletedAt !== undefined && data.CompletedAt !== null) {
1796
+ if (data.CompletedAt != null) {
2440
1797
  contents.CompletedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CompletedAt));
2441
1798
  }
2442
- if (data.ConfigurationLocationUri !== undefined && data.ConfigurationLocationUri !== null) {
1799
+ if (data.ConfigurationLocationUri != null) {
2443
1800
  contents.ConfigurationLocationUri = (0, smithy_client_1.expectString)(data.ConfigurationLocationUri);
2444
1801
  }
2445
- if (data.ConfigurationName !== undefined && data.ConfigurationName !== null) {
1802
+ if (data.ConfigurationName != null) {
2446
1803
  contents.ConfigurationName = (0, smithy_client_1.expectString)(data.ConfigurationName);
2447
1804
  }
2448
- if (data.ConfigurationProfileId !== undefined && data.ConfigurationProfileId !== null) {
1805
+ if (data.ConfigurationProfileId != null) {
2449
1806
  contents.ConfigurationProfileId = (0, smithy_client_1.expectString)(data.ConfigurationProfileId);
2450
1807
  }
2451
- if (data.ConfigurationVersion !== undefined && data.ConfigurationVersion !== null) {
1808
+ if (data.ConfigurationVersion != null) {
2452
1809
  contents.ConfigurationVersion = (0, smithy_client_1.expectString)(data.ConfigurationVersion);
2453
1810
  }
2454
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
1811
+ if (data.DeploymentDurationInMinutes != null) {
2455
1812
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
2456
1813
  }
2457
- if (data.DeploymentNumber !== undefined && data.DeploymentNumber !== null) {
1814
+ if (data.DeploymentNumber != null) {
2458
1815
  contents.DeploymentNumber = (0, smithy_client_1.expectInt32)(data.DeploymentNumber);
2459
1816
  }
2460
- if (data.DeploymentStrategyId !== undefined && data.DeploymentStrategyId !== null) {
1817
+ if (data.DeploymentStrategyId != null) {
2461
1818
  contents.DeploymentStrategyId = (0, smithy_client_1.expectString)(data.DeploymentStrategyId);
2462
1819
  }
2463
- if (data.Description !== undefined && data.Description !== null) {
1820
+ if (data.Description != null) {
2464
1821
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2465
1822
  }
2466
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1823
+ if (data.EnvironmentId != null) {
2467
1824
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
2468
1825
  }
2469
- if (data.EventLog !== undefined && data.EventLog !== null) {
1826
+ if (data.EventLog != null) {
2470
1827
  contents.EventLog = deserializeAws_restJson1DeploymentEvents(data.EventLog, context);
2471
1828
  }
2472
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
1829
+ if (data.FinalBakeTimeInMinutes != null) {
2473
1830
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
2474
1831
  }
2475
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
1832
+ if (data.GrowthFactor != null) {
2476
1833
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
2477
1834
  }
2478
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
1835
+ if (data.GrowthType != null) {
2479
1836
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
2480
1837
  }
2481
- if (data.PercentageComplete !== undefined && data.PercentageComplete !== null) {
1838
+ if (data.PercentageComplete != null) {
2482
1839
  contents.PercentageComplete = (0, smithy_client_1.limitedParseFloat32)(data.PercentageComplete);
2483
1840
  }
2484
- if (data.StartedAt !== undefined && data.StartedAt !== null) {
1841
+ if (data.StartedAt != null) {
2485
1842
  contents.StartedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.StartedAt));
2486
1843
  }
2487
- if (data.State !== undefined && data.State !== null) {
1844
+ if (data.State != null) {
2488
1845
  contents.State = (0, smithy_client_1.expectString)(data.State);
2489
1846
  }
2490
- return Promise.resolve(contents);
1847
+ return contents;
2491
1848
  };
2492
1849
  exports.deserializeAws_restJson1GetDeploymentCommand = deserializeAws_restJson1GetDeploymentCommand;
2493
1850
  const deserializeAws_restJson1GetDeploymentCommandError = async (output, context) => {
@@ -2495,7 +1852,6 @@ const deserializeAws_restJson1GetDeploymentCommandError = async (output, context
2495
1852
  ...output,
2496
1853
  body: await parseBody(output.body, context),
2497
1854
  };
2498
- let response;
2499
1855
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2500
1856
  switch (errorCode) {
2501
1857
  case "BadRequestException":
@@ -2509,57 +1865,47 @@ const deserializeAws_restJson1GetDeploymentCommandError = async (output, context
2509
1865
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2510
1866
  default:
2511
1867
  const parsedBody = parsedOutput.body;
2512
- const $metadata = deserializeMetadata(output);
2513
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2514
- response = new AppConfigServiceException_1.AppConfigServiceException({
2515
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2516
- $fault: "client",
2517
- $metadata,
1868
+ (0, smithy_client_1.throwDefaultError)({
1869
+ output,
1870
+ parsedBody,
1871
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1872
+ errorCode,
2518
1873
  });
2519
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2520
1874
  }
2521
1875
  };
2522
1876
  const deserializeAws_restJson1GetDeploymentStrategyCommand = async (output, context) => {
2523
1877
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2524
1878
  return deserializeAws_restJson1GetDeploymentStrategyCommandError(output, context);
2525
1879
  }
2526
- const contents = {
1880
+ const contents = map({
2527
1881
  $metadata: deserializeMetadata(output),
2528
- DeploymentDurationInMinutes: undefined,
2529
- Description: undefined,
2530
- FinalBakeTimeInMinutes: undefined,
2531
- GrowthFactor: undefined,
2532
- GrowthType: undefined,
2533
- Id: undefined,
2534
- Name: undefined,
2535
- ReplicateTo: undefined,
2536
- };
1882
+ });
2537
1883
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2538
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
1884
+ if (data.DeploymentDurationInMinutes != null) {
2539
1885
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
2540
1886
  }
2541
- if (data.Description !== undefined && data.Description !== null) {
1887
+ if (data.Description != null) {
2542
1888
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2543
1889
  }
2544
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
1890
+ if (data.FinalBakeTimeInMinutes != null) {
2545
1891
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
2546
1892
  }
2547
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
1893
+ if (data.GrowthFactor != null) {
2548
1894
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
2549
1895
  }
2550
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
1896
+ if (data.GrowthType != null) {
2551
1897
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
2552
1898
  }
2553
- if (data.Id !== undefined && data.Id !== null) {
1899
+ if (data.Id != null) {
2554
1900
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2555
1901
  }
2556
- if (data.Name !== undefined && data.Name !== null) {
1902
+ if (data.Name != null) {
2557
1903
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2558
1904
  }
2559
- if (data.ReplicateTo !== undefined && data.ReplicateTo !== null) {
1905
+ if (data.ReplicateTo != null) {
2560
1906
  contents.ReplicateTo = (0, smithy_client_1.expectString)(data.ReplicateTo);
2561
1907
  }
2562
- return Promise.resolve(contents);
1908
+ return contents;
2563
1909
  };
2564
1910
  exports.deserializeAws_restJson1GetDeploymentStrategyCommand = deserializeAws_restJson1GetDeploymentStrategyCommand;
2565
1911
  const deserializeAws_restJson1GetDeploymentStrategyCommandError = async (output, context) => {
@@ -2567,7 +1913,6 @@ const deserializeAws_restJson1GetDeploymentStrategyCommandError = async (output,
2567
1913
  ...output,
2568
1914
  body: await parseBody(output.body, context),
2569
1915
  };
2570
- let response;
2571
1916
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2572
1917
  switch (errorCode) {
2573
1918
  case "BadRequestException":
@@ -2581,49 +1926,41 @@ const deserializeAws_restJson1GetDeploymentStrategyCommandError = async (output,
2581
1926
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2582
1927
  default:
2583
1928
  const parsedBody = parsedOutput.body;
2584
- const $metadata = deserializeMetadata(output);
2585
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2586
- response = new AppConfigServiceException_1.AppConfigServiceException({
2587
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2588
- $fault: "client",
2589
- $metadata,
1929
+ (0, smithy_client_1.throwDefaultError)({
1930
+ output,
1931
+ parsedBody,
1932
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1933
+ errorCode,
2590
1934
  });
2591
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2592
1935
  }
2593
1936
  };
2594
1937
  const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
2595
1938
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2596
1939
  return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
2597
1940
  }
2598
- const contents = {
1941
+ const contents = map({
2599
1942
  $metadata: deserializeMetadata(output),
2600
- ApplicationId: undefined,
2601
- Description: undefined,
2602
- Id: undefined,
2603
- Monitors: undefined,
2604
- Name: undefined,
2605
- State: undefined,
2606
- };
1943
+ });
2607
1944
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2608
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1945
+ if (data.ApplicationId != null) {
2609
1946
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
2610
1947
  }
2611
- if (data.Description !== undefined && data.Description !== null) {
1948
+ if (data.Description != null) {
2612
1949
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2613
1950
  }
2614
- if (data.Id !== undefined && data.Id !== null) {
1951
+ if (data.Id != null) {
2615
1952
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2616
1953
  }
2617
- if (data.Monitors !== undefined && data.Monitors !== null) {
1954
+ if (data.Monitors != null) {
2618
1955
  contents.Monitors = deserializeAws_restJson1MonitorList(data.Monitors, context);
2619
1956
  }
2620
- if (data.Name !== undefined && data.Name !== null) {
1957
+ if (data.Name != null) {
2621
1958
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2622
1959
  }
2623
- if (data.State !== undefined && data.State !== null) {
1960
+ if (data.State != null) {
2624
1961
  contents.State = (0, smithy_client_1.expectString)(data.State);
2625
1962
  }
2626
- return Promise.resolve(contents);
1963
+ return contents;
2627
1964
  };
2628
1965
  exports.deserializeAws_restJson1GetEnvironmentCommand = deserializeAws_restJson1GetEnvironmentCommand;
2629
1966
  const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
@@ -2631,7 +1968,6 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
2631
1968
  ...output,
2632
1969
  body: await parseBody(output.body, context),
2633
1970
  };
2634
- let response;
2635
1971
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2636
1972
  switch (errorCode) {
2637
1973
  case "BadRequestException":
@@ -2645,53 +1981,44 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
2645
1981
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2646
1982
  default:
2647
1983
  const parsedBody = parsedOutput.body;
2648
- const $metadata = deserializeMetadata(output);
2649
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2650
- response = new AppConfigServiceException_1.AppConfigServiceException({
2651
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2652
- $fault: "client",
2653
- $metadata,
1984
+ (0, smithy_client_1.throwDefaultError)({
1985
+ output,
1986
+ parsedBody,
1987
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
1988
+ errorCode,
2654
1989
  });
2655
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2656
1990
  }
2657
1991
  };
2658
1992
  const deserializeAws_restJson1GetExtensionCommand = async (output, context) => {
2659
1993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2660
1994
  return deserializeAws_restJson1GetExtensionCommandError(output, context);
2661
1995
  }
2662
- const contents = {
1996
+ const contents = map({
2663
1997
  $metadata: deserializeMetadata(output),
2664
- Actions: undefined,
2665
- Arn: undefined,
2666
- Description: undefined,
2667
- Id: undefined,
2668
- Name: undefined,
2669
- Parameters: undefined,
2670
- VersionNumber: undefined,
2671
- };
1998
+ });
2672
1999
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2673
- if (data.Actions !== undefined && data.Actions !== null) {
2000
+ if (data.Actions != null) {
2674
2001
  contents.Actions = deserializeAws_restJson1ActionsMap(data.Actions, context);
2675
2002
  }
2676
- if (data.Arn !== undefined && data.Arn !== null) {
2003
+ if (data.Arn != null) {
2677
2004
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
2678
2005
  }
2679
- if (data.Description !== undefined && data.Description !== null) {
2006
+ if (data.Description != null) {
2680
2007
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2681
2008
  }
2682
- if (data.Id !== undefined && data.Id !== null) {
2009
+ if (data.Id != null) {
2683
2010
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2684
2011
  }
2685
- if (data.Name !== undefined && data.Name !== null) {
2012
+ if (data.Name != null) {
2686
2013
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2687
2014
  }
2688
- if (data.Parameters !== undefined && data.Parameters !== null) {
2015
+ if (data.Parameters != null) {
2689
2016
  contents.Parameters = deserializeAws_restJson1ParameterMap(data.Parameters, context);
2690
2017
  }
2691
- if (data.VersionNumber !== undefined && data.VersionNumber !== null) {
2018
+ if (data.VersionNumber != null) {
2692
2019
  contents.VersionNumber = (0, smithy_client_1.expectInt32)(data.VersionNumber);
2693
2020
  }
2694
- return Promise.resolve(contents);
2021
+ return contents;
2695
2022
  };
2696
2023
  exports.deserializeAws_restJson1GetExtensionCommand = deserializeAws_restJson1GetExtensionCommand;
2697
2024
  const deserializeAws_restJson1GetExtensionCommandError = async (output, context) => {
@@ -2699,7 +2026,6 @@ const deserializeAws_restJson1GetExtensionCommandError = async (output, context)
2699
2026
  ...output,
2700
2027
  body: await parseBody(output.body, context),
2701
2028
  };
2702
- let response;
2703
2029
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2704
2030
  switch (errorCode) {
2705
2031
  case "BadRequestException":
@@ -2713,49 +2039,41 @@ const deserializeAws_restJson1GetExtensionCommandError = async (output, context)
2713
2039
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2714
2040
  default:
2715
2041
  const parsedBody = parsedOutput.body;
2716
- const $metadata = deserializeMetadata(output);
2717
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2718
- response = new AppConfigServiceException_1.AppConfigServiceException({
2719
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2720
- $fault: "client",
2721
- $metadata,
2042
+ (0, smithy_client_1.throwDefaultError)({
2043
+ output,
2044
+ parsedBody,
2045
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2046
+ errorCode,
2722
2047
  });
2723
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2724
2048
  }
2725
2049
  };
2726
2050
  const deserializeAws_restJson1GetExtensionAssociationCommand = async (output, context) => {
2727
2051
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2728
2052
  return deserializeAws_restJson1GetExtensionAssociationCommandError(output, context);
2729
2053
  }
2730
- const contents = {
2054
+ const contents = map({
2731
2055
  $metadata: deserializeMetadata(output),
2732
- Arn: undefined,
2733
- ExtensionArn: undefined,
2734
- ExtensionVersionNumber: undefined,
2735
- Id: undefined,
2736
- Parameters: undefined,
2737
- ResourceArn: undefined,
2738
- };
2056
+ });
2739
2057
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2740
- if (data.Arn !== undefined && data.Arn !== null) {
2058
+ if (data.Arn != null) {
2741
2059
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
2742
2060
  }
2743
- if (data.ExtensionArn !== undefined && data.ExtensionArn !== null) {
2061
+ if (data.ExtensionArn != null) {
2744
2062
  contents.ExtensionArn = (0, smithy_client_1.expectString)(data.ExtensionArn);
2745
2063
  }
2746
- if (data.ExtensionVersionNumber !== undefined && data.ExtensionVersionNumber !== null) {
2064
+ if (data.ExtensionVersionNumber != null) {
2747
2065
  contents.ExtensionVersionNumber = (0, smithy_client_1.expectInt32)(data.ExtensionVersionNumber);
2748
2066
  }
2749
- if (data.Id !== undefined && data.Id !== null) {
2067
+ if (data.Id != null) {
2750
2068
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
2751
2069
  }
2752
- if (data.Parameters !== undefined && data.Parameters !== null) {
2070
+ if (data.Parameters != null) {
2753
2071
  contents.Parameters = deserializeAws_restJson1ParameterValueMap(data.Parameters, context);
2754
2072
  }
2755
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
2073
+ if (data.ResourceArn != null) {
2756
2074
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2757
2075
  }
2758
- return Promise.resolve(contents);
2076
+ return contents;
2759
2077
  };
2760
2078
  exports.deserializeAws_restJson1GetExtensionAssociationCommand = deserializeAws_restJson1GetExtensionAssociationCommand;
2761
2079
  const deserializeAws_restJson1GetExtensionAssociationCommandError = async (output, context) => {
@@ -2763,7 +2081,6 @@ const deserializeAws_restJson1GetExtensionAssociationCommandError = async (outpu
2763
2081
  ...output,
2764
2082
  body: await parseBody(output.body, context),
2765
2083
  };
2766
- let response;
2767
2084
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2768
2085
  switch (errorCode) {
2769
2086
  case "BadRequestException":
@@ -2777,47 +2094,32 @@ const deserializeAws_restJson1GetExtensionAssociationCommandError = async (outpu
2777
2094
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2778
2095
  default:
2779
2096
  const parsedBody = parsedOutput.body;
2780
- const $metadata = deserializeMetadata(output);
2781
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2782
- response = new AppConfigServiceException_1.AppConfigServiceException({
2783
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2784
- $fault: "client",
2785
- $metadata,
2097
+ (0, smithy_client_1.throwDefaultError)({
2098
+ output,
2099
+ parsedBody,
2100
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2101
+ errorCode,
2786
2102
  });
2787
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2788
2103
  }
2789
2104
  };
2790
2105
  const deserializeAws_restJson1GetHostedConfigurationVersionCommand = async (output, context) => {
2791
2106
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2792
2107
  return deserializeAws_restJson1GetHostedConfigurationVersionCommandError(output, context);
2793
2108
  }
2794
- const contents = {
2109
+ const contents = map({
2795
2110
  $metadata: deserializeMetadata(output),
2796
- ApplicationId: undefined,
2797
- ConfigurationProfileId: undefined,
2798
- Content: undefined,
2799
- ContentType: undefined,
2800
- Description: undefined,
2801
- VersionNumber: undefined,
2802
- };
2803
- if (output.headers["application-id"] !== undefined) {
2804
- contents.ApplicationId = output.headers["application-id"];
2805
- }
2806
- if (output.headers["configuration-profile-id"] !== undefined) {
2807
- contents.ConfigurationProfileId = output.headers["configuration-profile-id"];
2808
- }
2809
- if (output.headers["version-number"] !== undefined) {
2810
- contents.VersionNumber = (0, smithy_client_1.strictParseInt32)(output.headers["version-number"]);
2811
- }
2812
- if (output.headers["description"] !== undefined) {
2813
- contents.Description = output.headers["description"];
2814
- }
2815
- if (output.headers["content-type"] !== undefined) {
2816
- contents.ContentType = output.headers["content-type"];
2817
- }
2111
+ ApplicationId: [, output.headers["application-id"]],
2112
+ ConfigurationProfileId: [, output.headers["configuration-profile-id"]],
2113
+ VersionNumber: [
2114
+ () => void 0 !== output.headers["version-number"],
2115
+ () => (0, smithy_client_1.strictParseInt32)(output.headers["version-number"]),
2116
+ ],
2117
+ Description: [, output.headers["description"]],
2118
+ ContentType: [, output.headers["content-type"]],
2119
+ });
2818
2120
  const data = await collectBody(output.body, context);
2819
2121
  contents.Content = data;
2820
- return Promise.resolve(contents);
2122
+ return contents;
2821
2123
  };
2822
2124
  exports.deserializeAws_restJson1GetHostedConfigurationVersionCommand = deserializeAws_restJson1GetHostedConfigurationVersionCommand;
2823
2125
  const deserializeAws_restJson1GetHostedConfigurationVersionCommandError = async (output, context) => {
@@ -2825,7 +2127,6 @@ const deserializeAws_restJson1GetHostedConfigurationVersionCommandError = async
2825
2127
  ...output,
2826
2128
  body: await parseBody(output.body, context),
2827
2129
  };
2828
- let response;
2829
2130
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2830
2131
  switch (errorCode) {
2831
2132
  case "BadRequestException":
@@ -2839,33 +2140,29 @@ const deserializeAws_restJson1GetHostedConfigurationVersionCommandError = async
2839
2140
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2840
2141
  default:
2841
2142
  const parsedBody = parsedOutput.body;
2842
- const $metadata = deserializeMetadata(output);
2843
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2844
- response = new AppConfigServiceException_1.AppConfigServiceException({
2845
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2846
- $fault: "client",
2847
- $metadata,
2143
+ (0, smithy_client_1.throwDefaultError)({
2144
+ output,
2145
+ parsedBody,
2146
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2147
+ errorCode,
2848
2148
  });
2849
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2850
2149
  }
2851
2150
  };
2852
2151
  const deserializeAws_restJson1ListApplicationsCommand = async (output, context) => {
2853
2152
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2854
2153
  return deserializeAws_restJson1ListApplicationsCommandError(output, context);
2855
2154
  }
2856
- const contents = {
2155
+ const contents = map({
2857
2156
  $metadata: deserializeMetadata(output),
2858
- Items: undefined,
2859
- NextToken: undefined,
2860
- };
2157
+ });
2861
2158
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2862
- if (data.Items !== undefined && data.Items !== null) {
2159
+ if (data.Items != null) {
2863
2160
  contents.Items = deserializeAws_restJson1ApplicationList(data.Items, context);
2864
2161
  }
2865
- if (data.NextToken !== undefined && data.NextToken !== null) {
2162
+ if (data.NextToken != null) {
2866
2163
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2867
2164
  }
2868
- return Promise.resolve(contents);
2165
+ return contents;
2869
2166
  };
2870
2167
  exports.deserializeAws_restJson1ListApplicationsCommand = deserializeAws_restJson1ListApplicationsCommand;
2871
2168
  const deserializeAws_restJson1ListApplicationsCommandError = async (output, context) => {
@@ -2873,7 +2170,6 @@ const deserializeAws_restJson1ListApplicationsCommandError = async (output, cont
2873
2170
  ...output,
2874
2171
  body: await parseBody(output.body, context),
2875
2172
  };
2876
- let response;
2877
2173
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2878
2174
  switch (errorCode) {
2879
2175
  case "BadRequestException":
@@ -2884,33 +2180,29 @@ const deserializeAws_restJson1ListApplicationsCommandError = async (output, cont
2884
2180
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2885
2181
  default:
2886
2182
  const parsedBody = parsedOutput.body;
2887
- const $metadata = deserializeMetadata(output);
2888
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2889
- response = new AppConfigServiceException_1.AppConfigServiceException({
2890
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2891
- $fault: "client",
2892
- $metadata,
2183
+ (0, smithy_client_1.throwDefaultError)({
2184
+ output,
2185
+ parsedBody,
2186
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2187
+ errorCode,
2893
2188
  });
2894
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2895
2189
  }
2896
2190
  };
2897
2191
  const deserializeAws_restJson1ListConfigurationProfilesCommand = async (output, context) => {
2898
2192
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2899
2193
  return deserializeAws_restJson1ListConfigurationProfilesCommandError(output, context);
2900
2194
  }
2901
- const contents = {
2195
+ const contents = map({
2902
2196
  $metadata: deserializeMetadata(output),
2903
- Items: undefined,
2904
- NextToken: undefined,
2905
- };
2197
+ });
2906
2198
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2907
- if (data.Items !== undefined && data.Items !== null) {
2199
+ if (data.Items != null) {
2908
2200
  contents.Items = deserializeAws_restJson1ConfigurationProfileSummaryList(data.Items, context);
2909
2201
  }
2910
- if (data.NextToken !== undefined && data.NextToken !== null) {
2202
+ if (data.NextToken != null) {
2911
2203
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2912
2204
  }
2913
- return Promise.resolve(contents);
2205
+ return contents;
2914
2206
  };
2915
2207
  exports.deserializeAws_restJson1ListConfigurationProfilesCommand = deserializeAws_restJson1ListConfigurationProfilesCommand;
2916
2208
  const deserializeAws_restJson1ListConfigurationProfilesCommandError = async (output, context) => {
@@ -2918,7 +2210,6 @@ const deserializeAws_restJson1ListConfigurationProfilesCommandError = async (out
2918
2210
  ...output,
2919
2211
  body: await parseBody(output.body, context),
2920
2212
  };
2921
- let response;
2922
2213
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2923
2214
  switch (errorCode) {
2924
2215
  case "BadRequestException":
@@ -2932,33 +2223,29 @@ const deserializeAws_restJson1ListConfigurationProfilesCommandError = async (out
2932
2223
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2933
2224
  default:
2934
2225
  const parsedBody = parsedOutput.body;
2935
- const $metadata = deserializeMetadata(output);
2936
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2937
- response = new AppConfigServiceException_1.AppConfigServiceException({
2938
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2939
- $fault: "client",
2940
- $metadata,
2226
+ (0, smithy_client_1.throwDefaultError)({
2227
+ output,
2228
+ parsedBody,
2229
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2230
+ errorCode,
2941
2231
  });
2942
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2943
2232
  }
2944
2233
  };
2945
2234
  const deserializeAws_restJson1ListDeploymentsCommand = async (output, context) => {
2946
2235
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2947
2236
  return deserializeAws_restJson1ListDeploymentsCommandError(output, context);
2948
2237
  }
2949
- const contents = {
2238
+ const contents = map({
2950
2239
  $metadata: deserializeMetadata(output),
2951
- Items: undefined,
2952
- NextToken: undefined,
2953
- };
2240
+ });
2954
2241
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2955
- if (data.Items !== undefined && data.Items !== null) {
2242
+ if (data.Items != null) {
2956
2243
  contents.Items = deserializeAws_restJson1DeploymentList(data.Items, context);
2957
2244
  }
2958
- if (data.NextToken !== undefined && data.NextToken !== null) {
2245
+ if (data.NextToken != null) {
2959
2246
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2960
2247
  }
2961
- return Promise.resolve(contents);
2248
+ return contents;
2962
2249
  };
2963
2250
  exports.deserializeAws_restJson1ListDeploymentsCommand = deserializeAws_restJson1ListDeploymentsCommand;
2964
2251
  const deserializeAws_restJson1ListDeploymentsCommandError = async (output, context) => {
@@ -2966,7 +2253,6 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async (output, conte
2966
2253
  ...output,
2967
2254
  body: await parseBody(output.body, context),
2968
2255
  };
2969
- let response;
2970
2256
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2971
2257
  switch (errorCode) {
2972
2258
  case "BadRequestException":
@@ -2980,33 +2266,29 @@ const deserializeAws_restJson1ListDeploymentsCommandError = async (output, conte
2980
2266
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2981
2267
  default:
2982
2268
  const parsedBody = parsedOutput.body;
2983
- const $metadata = deserializeMetadata(output);
2984
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2985
- response = new AppConfigServiceException_1.AppConfigServiceException({
2986
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2987
- $fault: "client",
2988
- $metadata,
2269
+ (0, smithy_client_1.throwDefaultError)({
2270
+ output,
2271
+ parsedBody,
2272
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2273
+ errorCode,
2989
2274
  });
2990
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2991
2275
  }
2992
2276
  };
2993
2277
  const deserializeAws_restJson1ListDeploymentStrategiesCommand = async (output, context) => {
2994
2278
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2995
2279
  return deserializeAws_restJson1ListDeploymentStrategiesCommandError(output, context);
2996
2280
  }
2997
- const contents = {
2281
+ const contents = map({
2998
2282
  $metadata: deserializeMetadata(output),
2999
- Items: undefined,
3000
- NextToken: undefined,
3001
- };
2283
+ });
3002
2284
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3003
- if (data.Items !== undefined && data.Items !== null) {
2285
+ if (data.Items != null) {
3004
2286
  contents.Items = deserializeAws_restJson1DeploymentStrategyList(data.Items, context);
3005
2287
  }
3006
- if (data.NextToken !== undefined && data.NextToken !== null) {
2288
+ if (data.NextToken != null) {
3007
2289
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3008
2290
  }
3009
- return Promise.resolve(contents);
2291
+ return contents;
3010
2292
  };
3011
2293
  exports.deserializeAws_restJson1ListDeploymentStrategiesCommand = deserializeAws_restJson1ListDeploymentStrategiesCommand;
3012
2294
  const deserializeAws_restJson1ListDeploymentStrategiesCommandError = async (output, context) => {
@@ -3014,7 +2296,6 @@ const deserializeAws_restJson1ListDeploymentStrategiesCommandError = async (outp
3014
2296
  ...output,
3015
2297
  body: await parseBody(output.body, context),
3016
2298
  };
3017
- let response;
3018
2299
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3019
2300
  switch (errorCode) {
3020
2301
  case "BadRequestException":
@@ -3025,33 +2306,29 @@ const deserializeAws_restJson1ListDeploymentStrategiesCommandError = async (outp
3025
2306
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3026
2307
  default:
3027
2308
  const parsedBody = parsedOutput.body;
3028
- const $metadata = deserializeMetadata(output);
3029
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3030
- response = new AppConfigServiceException_1.AppConfigServiceException({
3031
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3032
- $fault: "client",
3033
- $metadata,
2309
+ (0, smithy_client_1.throwDefaultError)({
2310
+ output,
2311
+ parsedBody,
2312
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2313
+ errorCode,
3034
2314
  });
3035
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3036
2315
  }
3037
2316
  };
3038
2317
  const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
3039
2318
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3040
2319
  return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
3041
2320
  }
3042
- const contents = {
2321
+ const contents = map({
3043
2322
  $metadata: deserializeMetadata(output),
3044
- Items: undefined,
3045
- NextToken: undefined,
3046
- };
2323
+ });
3047
2324
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3048
- if (data.Items !== undefined && data.Items !== null) {
2325
+ if (data.Items != null) {
3049
2326
  contents.Items = deserializeAws_restJson1EnvironmentList(data.Items, context);
3050
2327
  }
3051
- if (data.NextToken !== undefined && data.NextToken !== null) {
2328
+ if (data.NextToken != null) {
3052
2329
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3053
2330
  }
3054
- return Promise.resolve(contents);
2331
+ return contents;
3055
2332
  };
3056
2333
  exports.deserializeAws_restJson1ListEnvironmentsCommand = deserializeAws_restJson1ListEnvironmentsCommand;
3057
2334
  const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
@@ -3059,7 +2336,6 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
3059
2336
  ...output,
3060
2337
  body: await parseBody(output.body, context),
3061
2338
  };
3062
- let response;
3063
2339
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3064
2340
  switch (errorCode) {
3065
2341
  case "BadRequestException":
@@ -3073,33 +2349,29 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
3073
2349
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3074
2350
  default:
3075
2351
  const parsedBody = parsedOutput.body;
3076
- const $metadata = deserializeMetadata(output);
3077
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3078
- response = new AppConfigServiceException_1.AppConfigServiceException({
3079
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3080
- $fault: "client",
3081
- $metadata,
2352
+ (0, smithy_client_1.throwDefaultError)({
2353
+ output,
2354
+ parsedBody,
2355
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2356
+ errorCode,
3082
2357
  });
3083
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3084
2358
  }
3085
2359
  };
3086
2360
  const deserializeAws_restJson1ListExtensionAssociationsCommand = async (output, context) => {
3087
2361
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3088
2362
  return deserializeAws_restJson1ListExtensionAssociationsCommandError(output, context);
3089
2363
  }
3090
- const contents = {
2364
+ const contents = map({
3091
2365
  $metadata: deserializeMetadata(output),
3092
- Items: undefined,
3093
- NextToken: undefined,
3094
- };
2366
+ });
3095
2367
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3096
- if (data.Items !== undefined && data.Items !== null) {
2368
+ if (data.Items != null) {
3097
2369
  contents.Items = deserializeAws_restJson1ExtensionAssociationSummaries(data.Items, context);
3098
2370
  }
3099
- if (data.NextToken !== undefined && data.NextToken !== null) {
2371
+ if (data.NextToken != null) {
3100
2372
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3101
2373
  }
3102
- return Promise.resolve(contents);
2374
+ return contents;
3103
2375
  };
3104
2376
  exports.deserializeAws_restJson1ListExtensionAssociationsCommand = deserializeAws_restJson1ListExtensionAssociationsCommand;
3105
2377
  const deserializeAws_restJson1ListExtensionAssociationsCommandError = async (output, context) => {
@@ -3107,7 +2379,6 @@ const deserializeAws_restJson1ListExtensionAssociationsCommandError = async (out
3107
2379
  ...output,
3108
2380
  body: await parseBody(output.body, context),
3109
2381
  };
3110
- let response;
3111
2382
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3112
2383
  switch (errorCode) {
3113
2384
  case "BadRequestException":
@@ -3118,33 +2389,29 @@ const deserializeAws_restJson1ListExtensionAssociationsCommandError = async (out
3118
2389
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3119
2390
  default:
3120
2391
  const parsedBody = parsedOutput.body;
3121
- const $metadata = deserializeMetadata(output);
3122
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3123
- response = new AppConfigServiceException_1.AppConfigServiceException({
3124
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3125
- $fault: "client",
3126
- $metadata,
2392
+ (0, smithy_client_1.throwDefaultError)({
2393
+ output,
2394
+ parsedBody,
2395
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2396
+ errorCode,
3127
2397
  });
3128
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3129
2398
  }
3130
2399
  };
3131
2400
  const deserializeAws_restJson1ListExtensionsCommand = async (output, context) => {
3132
2401
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3133
2402
  return deserializeAws_restJson1ListExtensionsCommandError(output, context);
3134
2403
  }
3135
- const contents = {
2404
+ const contents = map({
3136
2405
  $metadata: deserializeMetadata(output),
3137
- Items: undefined,
3138
- NextToken: undefined,
3139
- };
2406
+ });
3140
2407
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3141
- if (data.Items !== undefined && data.Items !== null) {
2408
+ if (data.Items != null) {
3142
2409
  contents.Items = deserializeAws_restJson1ExtensionSummaries(data.Items, context);
3143
2410
  }
3144
- if (data.NextToken !== undefined && data.NextToken !== null) {
2411
+ if (data.NextToken != null) {
3145
2412
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3146
2413
  }
3147
- return Promise.resolve(contents);
2414
+ return contents;
3148
2415
  };
3149
2416
  exports.deserializeAws_restJson1ListExtensionsCommand = deserializeAws_restJson1ListExtensionsCommand;
3150
2417
  const deserializeAws_restJson1ListExtensionsCommandError = async (output, context) => {
@@ -3152,7 +2419,6 @@ const deserializeAws_restJson1ListExtensionsCommandError = async (output, contex
3152
2419
  ...output,
3153
2420
  body: await parseBody(output.body, context),
3154
2421
  };
3155
- let response;
3156
2422
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3157
2423
  switch (errorCode) {
3158
2424
  case "BadRequestException":
@@ -3163,33 +2429,29 @@ const deserializeAws_restJson1ListExtensionsCommandError = async (output, contex
3163
2429
  throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3164
2430
  default:
3165
2431
  const parsedBody = parsedOutput.body;
3166
- const $metadata = deserializeMetadata(output);
3167
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3168
- response = new AppConfigServiceException_1.AppConfigServiceException({
3169
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3170
- $fault: "client",
3171
- $metadata,
2432
+ (0, smithy_client_1.throwDefaultError)({
2433
+ output,
2434
+ parsedBody,
2435
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2436
+ errorCode,
3172
2437
  });
3173
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3174
2438
  }
3175
2439
  };
3176
2440
  const deserializeAws_restJson1ListHostedConfigurationVersionsCommand = async (output, context) => {
3177
2441
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3178
2442
  return deserializeAws_restJson1ListHostedConfigurationVersionsCommandError(output, context);
3179
2443
  }
3180
- const contents = {
2444
+ const contents = map({
3181
2445
  $metadata: deserializeMetadata(output),
3182
- Items: undefined,
3183
- NextToken: undefined,
3184
- };
2446
+ });
3185
2447
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3186
- if (data.Items !== undefined && data.Items !== null) {
2448
+ if (data.Items != null) {
3187
2449
  contents.Items = deserializeAws_restJson1HostedConfigurationVersionSummaryList(data.Items, context);
3188
2450
  }
3189
- if (data.NextToken !== undefined && data.NextToken !== null) {
2451
+ if (data.NextToken != null) {
3190
2452
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3191
2453
  }
3192
- return Promise.resolve(contents);
2454
+ return contents;
3193
2455
  };
3194
2456
  exports.deserializeAws_restJson1ListHostedConfigurationVersionsCommand = deserializeAws_restJson1ListHostedConfigurationVersionsCommand;
3195
2457
  const deserializeAws_restJson1ListHostedConfigurationVersionsCommandError = async (output, context) => {
@@ -3197,7 +2459,6 @@ const deserializeAws_restJson1ListHostedConfigurationVersionsCommandError = asyn
3197
2459
  ...output,
3198
2460
  body: await parseBody(output.body, context),
3199
2461
  };
3200
- let response;
3201
2462
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3202
2463
  switch (errorCode) {
3203
2464
  case "BadRequestException":
@@ -3211,29 +2472,26 @@ const deserializeAws_restJson1ListHostedConfigurationVersionsCommandError = asyn
3211
2472
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3212
2473
  default:
3213
2474
  const parsedBody = parsedOutput.body;
3214
- const $metadata = deserializeMetadata(output);
3215
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3216
- response = new AppConfigServiceException_1.AppConfigServiceException({
3217
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3218
- $fault: "client",
3219
- $metadata,
2475
+ (0, smithy_client_1.throwDefaultError)({
2476
+ output,
2477
+ parsedBody,
2478
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2479
+ errorCode,
3220
2480
  });
3221
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3222
2481
  }
3223
2482
  };
3224
2483
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
3225
2484
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3226
2485
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
3227
2486
  }
3228
- const contents = {
2487
+ const contents = map({
3229
2488
  $metadata: deserializeMetadata(output),
3230
- Tags: undefined,
3231
- };
2489
+ });
3232
2490
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3233
- if (data.Tags !== undefined && data.Tags !== null) {
2491
+ if (data.Tags != null) {
3234
2492
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3235
2493
  }
3236
- return Promise.resolve(contents);
2494
+ return contents;
3237
2495
  };
3238
2496
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
3239
2497
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -3241,7 +2499,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3241
2499
  ...output,
3242
2500
  body: await parseBody(output.body, context),
3243
2501
  };
3244
- let response;
3245
2502
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3246
2503
  switch (errorCode) {
3247
2504
  case "BadRequestException":
@@ -3255,101 +2512,80 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3255
2512
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3256
2513
  default:
3257
2514
  const parsedBody = parsedOutput.body;
3258
- const $metadata = deserializeMetadata(output);
3259
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3260
- response = new AppConfigServiceException_1.AppConfigServiceException({
3261
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3262
- $fault: "client",
3263
- $metadata,
2515
+ (0, smithy_client_1.throwDefaultError)({
2516
+ output,
2517
+ parsedBody,
2518
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2519
+ errorCode,
3264
2520
  });
3265
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3266
2521
  }
3267
2522
  };
3268
2523
  const deserializeAws_restJson1StartDeploymentCommand = async (output, context) => {
3269
2524
  if (output.statusCode !== 201 && output.statusCode >= 300) {
3270
2525
  return deserializeAws_restJson1StartDeploymentCommandError(output, context);
3271
2526
  }
3272
- const contents = {
2527
+ const contents = map({
3273
2528
  $metadata: deserializeMetadata(output),
3274
- ApplicationId: undefined,
3275
- AppliedExtensions: undefined,
3276
- CompletedAt: undefined,
3277
- ConfigurationLocationUri: undefined,
3278
- ConfigurationName: undefined,
3279
- ConfigurationProfileId: undefined,
3280
- ConfigurationVersion: undefined,
3281
- DeploymentDurationInMinutes: undefined,
3282
- DeploymentNumber: undefined,
3283
- DeploymentStrategyId: undefined,
3284
- Description: undefined,
3285
- EnvironmentId: undefined,
3286
- EventLog: undefined,
3287
- FinalBakeTimeInMinutes: undefined,
3288
- GrowthFactor: undefined,
3289
- GrowthType: undefined,
3290
- PercentageComplete: undefined,
3291
- StartedAt: undefined,
3292
- State: undefined,
3293
- };
2529
+ });
3294
2530
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3295
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2531
+ if (data.ApplicationId != null) {
3296
2532
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
3297
2533
  }
3298
- if (data.AppliedExtensions !== undefined && data.AppliedExtensions !== null) {
2534
+ if (data.AppliedExtensions != null) {
3299
2535
  contents.AppliedExtensions = deserializeAws_restJson1AppliedExtensions(data.AppliedExtensions, context);
3300
2536
  }
3301
- if (data.CompletedAt !== undefined && data.CompletedAt !== null) {
2537
+ if (data.CompletedAt != null) {
3302
2538
  contents.CompletedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CompletedAt));
3303
2539
  }
3304
- if (data.ConfigurationLocationUri !== undefined && data.ConfigurationLocationUri !== null) {
2540
+ if (data.ConfigurationLocationUri != null) {
3305
2541
  contents.ConfigurationLocationUri = (0, smithy_client_1.expectString)(data.ConfigurationLocationUri);
3306
2542
  }
3307
- if (data.ConfigurationName !== undefined && data.ConfigurationName !== null) {
2543
+ if (data.ConfigurationName != null) {
3308
2544
  contents.ConfigurationName = (0, smithy_client_1.expectString)(data.ConfigurationName);
3309
2545
  }
3310
- if (data.ConfigurationProfileId !== undefined && data.ConfigurationProfileId !== null) {
2546
+ if (data.ConfigurationProfileId != null) {
3311
2547
  contents.ConfigurationProfileId = (0, smithy_client_1.expectString)(data.ConfigurationProfileId);
3312
2548
  }
3313
- if (data.ConfigurationVersion !== undefined && data.ConfigurationVersion !== null) {
2549
+ if (data.ConfigurationVersion != null) {
3314
2550
  contents.ConfigurationVersion = (0, smithy_client_1.expectString)(data.ConfigurationVersion);
3315
2551
  }
3316
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
2552
+ if (data.DeploymentDurationInMinutes != null) {
3317
2553
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
3318
2554
  }
3319
- if (data.DeploymentNumber !== undefined && data.DeploymentNumber !== null) {
2555
+ if (data.DeploymentNumber != null) {
3320
2556
  contents.DeploymentNumber = (0, smithy_client_1.expectInt32)(data.DeploymentNumber);
3321
2557
  }
3322
- if (data.DeploymentStrategyId !== undefined && data.DeploymentStrategyId !== null) {
2558
+ if (data.DeploymentStrategyId != null) {
3323
2559
  contents.DeploymentStrategyId = (0, smithy_client_1.expectString)(data.DeploymentStrategyId);
3324
2560
  }
3325
- if (data.Description !== undefined && data.Description !== null) {
2561
+ if (data.Description != null) {
3326
2562
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3327
2563
  }
3328
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2564
+ if (data.EnvironmentId != null) {
3329
2565
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
3330
2566
  }
3331
- if (data.EventLog !== undefined && data.EventLog !== null) {
2567
+ if (data.EventLog != null) {
3332
2568
  contents.EventLog = deserializeAws_restJson1DeploymentEvents(data.EventLog, context);
3333
2569
  }
3334
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
2570
+ if (data.FinalBakeTimeInMinutes != null) {
3335
2571
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
3336
2572
  }
3337
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
2573
+ if (data.GrowthFactor != null) {
3338
2574
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
3339
2575
  }
3340
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
2576
+ if (data.GrowthType != null) {
3341
2577
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
3342
2578
  }
3343
- if (data.PercentageComplete !== undefined && data.PercentageComplete !== null) {
2579
+ if (data.PercentageComplete != null) {
3344
2580
  contents.PercentageComplete = (0, smithy_client_1.limitedParseFloat32)(data.PercentageComplete);
3345
2581
  }
3346
- if (data.StartedAt !== undefined && data.StartedAt !== null) {
2582
+ if (data.StartedAt != null) {
3347
2583
  contents.StartedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.StartedAt));
3348
2584
  }
3349
- if (data.State !== undefined && data.State !== null) {
2585
+ if (data.State != null) {
3350
2586
  contents.State = (0, smithy_client_1.expectString)(data.State);
3351
2587
  }
3352
- return Promise.resolve(contents);
2588
+ return contents;
3353
2589
  };
3354
2590
  exports.deserializeAws_restJson1StartDeploymentCommand = deserializeAws_restJson1StartDeploymentCommand;
3355
2591
  const deserializeAws_restJson1StartDeploymentCommandError = async (output, context) => {
@@ -3357,7 +2593,6 @@ const deserializeAws_restJson1StartDeploymentCommandError = async (output, conte
3357
2593
  ...output,
3358
2594
  body: await parseBody(output.body, context),
3359
2595
  };
3360
- let response;
3361
2596
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3362
2597
  switch (errorCode) {
3363
2598
  case "BadRequestException":
@@ -3374,101 +2609,80 @@ const deserializeAws_restJson1StartDeploymentCommandError = async (output, conte
3374
2609
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3375
2610
  default:
3376
2611
  const parsedBody = parsedOutput.body;
3377
- const $metadata = deserializeMetadata(output);
3378
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3379
- response = new AppConfigServiceException_1.AppConfigServiceException({
3380
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3381
- $fault: "client",
3382
- $metadata,
2612
+ (0, smithy_client_1.throwDefaultError)({
2613
+ output,
2614
+ parsedBody,
2615
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2616
+ errorCode,
3383
2617
  });
3384
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3385
2618
  }
3386
2619
  };
3387
2620
  const deserializeAws_restJson1StopDeploymentCommand = async (output, context) => {
3388
2621
  if (output.statusCode !== 202 && output.statusCode >= 300) {
3389
2622
  return deserializeAws_restJson1StopDeploymentCommandError(output, context);
3390
2623
  }
3391
- const contents = {
2624
+ const contents = map({
3392
2625
  $metadata: deserializeMetadata(output),
3393
- ApplicationId: undefined,
3394
- AppliedExtensions: undefined,
3395
- CompletedAt: undefined,
3396
- ConfigurationLocationUri: undefined,
3397
- ConfigurationName: undefined,
3398
- ConfigurationProfileId: undefined,
3399
- ConfigurationVersion: undefined,
3400
- DeploymentDurationInMinutes: undefined,
3401
- DeploymentNumber: undefined,
3402
- DeploymentStrategyId: undefined,
3403
- Description: undefined,
3404
- EnvironmentId: undefined,
3405
- EventLog: undefined,
3406
- FinalBakeTimeInMinutes: undefined,
3407
- GrowthFactor: undefined,
3408
- GrowthType: undefined,
3409
- PercentageComplete: undefined,
3410
- StartedAt: undefined,
3411
- State: undefined,
3412
- };
2626
+ });
3413
2627
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3414
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2628
+ if (data.ApplicationId != null) {
3415
2629
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
3416
2630
  }
3417
- if (data.AppliedExtensions !== undefined && data.AppliedExtensions !== null) {
2631
+ if (data.AppliedExtensions != null) {
3418
2632
  contents.AppliedExtensions = deserializeAws_restJson1AppliedExtensions(data.AppliedExtensions, context);
3419
2633
  }
3420
- if (data.CompletedAt !== undefined && data.CompletedAt !== null) {
2634
+ if (data.CompletedAt != null) {
3421
2635
  contents.CompletedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CompletedAt));
3422
2636
  }
3423
- if (data.ConfigurationLocationUri !== undefined && data.ConfigurationLocationUri !== null) {
2637
+ if (data.ConfigurationLocationUri != null) {
3424
2638
  contents.ConfigurationLocationUri = (0, smithy_client_1.expectString)(data.ConfigurationLocationUri);
3425
2639
  }
3426
- if (data.ConfigurationName !== undefined && data.ConfigurationName !== null) {
2640
+ if (data.ConfigurationName != null) {
3427
2641
  contents.ConfigurationName = (0, smithy_client_1.expectString)(data.ConfigurationName);
3428
2642
  }
3429
- if (data.ConfigurationProfileId !== undefined && data.ConfigurationProfileId !== null) {
2643
+ if (data.ConfigurationProfileId != null) {
3430
2644
  contents.ConfigurationProfileId = (0, smithy_client_1.expectString)(data.ConfigurationProfileId);
3431
2645
  }
3432
- if (data.ConfigurationVersion !== undefined && data.ConfigurationVersion !== null) {
2646
+ if (data.ConfigurationVersion != null) {
3433
2647
  contents.ConfigurationVersion = (0, smithy_client_1.expectString)(data.ConfigurationVersion);
3434
2648
  }
3435
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
2649
+ if (data.DeploymentDurationInMinutes != null) {
3436
2650
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
3437
2651
  }
3438
- if (data.DeploymentNumber !== undefined && data.DeploymentNumber !== null) {
2652
+ if (data.DeploymentNumber != null) {
3439
2653
  contents.DeploymentNumber = (0, smithy_client_1.expectInt32)(data.DeploymentNumber);
3440
2654
  }
3441
- if (data.DeploymentStrategyId !== undefined && data.DeploymentStrategyId !== null) {
2655
+ if (data.DeploymentStrategyId != null) {
3442
2656
  contents.DeploymentStrategyId = (0, smithy_client_1.expectString)(data.DeploymentStrategyId);
3443
2657
  }
3444
- if (data.Description !== undefined && data.Description !== null) {
2658
+ if (data.Description != null) {
3445
2659
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3446
2660
  }
3447
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
2661
+ if (data.EnvironmentId != null) {
3448
2662
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
3449
2663
  }
3450
- if (data.EventLog !== undefined && data.EventLog !== null) {
2664
+ if (data.EventLog != null) {
3451
2665
  contents.EventLog = deserializeAws_restJson1DeploymentEvents(data.EventLog, context);
3452
2666
  }
3453
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
2667
+ if (data.FinalBakeTimeInMinutes != null) {
3454
2668
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
3455
2669
  }
3456
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
2670
+ if (data.GrowthFactor != null) {
3457
2671
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
3458
2672
  }
3459
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
2673
+ if (data.GrowthType != null) {
3460
2674
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
3461
2675
  }
3462
- if (data.PercentageComplete !== undefined && data.PercentageComplete !== null) {
2676
+ if (data.PercentageComplete != null) {
3463
2677
  contents.PercentageComplete = (0, smithy_client_1.limitedParseFloat32)(data.PercentageComplete);
3464
2678
  }
3465
- if (data.StartedAt !== undefined && data.StartedAt !== null) {
2679
+ if (data.StartedAt != null) {
3466
2680
  contents.StartedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.StartedAt));
3467
2681
  }
3468
- if (data.State !== undefined && data.State !== null) {
2682
+ if (data.State != null) {
3469
2683
  contents.State = (0, smithy_client_1.expectString)(data.State);
3470
2684
  }
3471
- return Promise.resolve(contents);
2685
+ return contents;
3472
2686
  };
3473
2687
  exports.deserializeAws_restJson1StopDeploymentCommand = deserializeAws_restJson1StopDeploymentCommand;
3474
2688
  const deserializeAws_restJson1StopDeploymentCommandError = async (output, context) => {
@@ -3476,7 +2690,6 @@ const deserializeAws_restJson1StopDeploymentCommandError = async (output, contex
3476
2690
  ...output,
3477
2691
  body: await parseBody(output.body, context),
3478
2692
  };
3479
- let response;
3480
2693
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3481
2694
  switch (errorCode) {
3482
2695
  case "BadRequestException":
@@ -3490,25 +2703,23 @@ const deserializeAws_restJson1StopDeploymentCommandError = async (output, contex
3490
2703
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3491
2704
  default:
3492
2705
  const parsedBody = parsedOutput.body;
3493
- const $metadata = deserializeMetadata(output);
3494
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3495
- response = new AppConfigServiceException_1.AppConfigServiceException({
3496
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3497
- $fault: "client",
3498
- $metadata,
2706
+ (0, smithy_client_1.throwDefaultError)({
2707
+ output,
2708
+ parsedBody,
2709
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2710
+ errorCode,
3499
2711
  });
3500
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3501
2712
  }
3502
2713
  };
3503
2714
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3504
2715
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3505
2716
  return deserializeAws_restJson1TagResourceCommandError(output, context);
3506
2717
  }
3507
- const contents = {
2718
+ const contents = map({
3508
2719
  $metadata: deserializeMetadata(output),
3509
- };
2720
+ });
3510
2721
  await collectBody(output.body, context);
3511
- return Promise.resolve(contents);
2722
+ return contents;
3512
2723
  };
3513
2724
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
3514
2725
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -3516,7 +2727,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3516
2727
  ...output,
3517
2728
  body: await parseBody(output.body, context),
3518
2729
  };
3519
- let response;
3520
2730
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3521
2731
  switch (errorCode) {
3522
2732
  case "BadRequestException":
@@ -3530,25 +2740,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3530
2740
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3531
2741
  default:
3532
2742
  const parsedBody = parsedOutput.body;
3533
- const $metadata = deserializeMetadata(output);
3534
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3535
- response = new AppConfigServiceException_1.AppConfigServiceException({
3536
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3537
- $fault: "client",
3538
- $metadata,
2743
+ (0, smithy_client_1.throwDefaultError)({
2744
+ output,
2745
+ parsedBody,
2746
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2747
+ errorCode,
3539
2748
  });
3540
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3541
2749
  }
3542
2750
  };
3543
2751
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3544
2752
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3545
2753
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
3546
2754
  }
3547
- const contents = {
2755
+ const contents = map({
3548
2756
  $metadata: deserializeMetadata(output),
3549
- };
2757
+ });
3550
2758
  await collectBody(output.body, context);
3551
- return Promise.resolve(contents);
2759
+ return contents;
3552
2760
  };
3553
2761
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
3554
2762
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -3556,7 +2764,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3556
2764
  ...output,
3557
2765
  body: await parseBody(output.body, context),
3558
2766
  };
3559
- let response;
3560
2767
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3561
2768
  switch (errorCode) {
3562
2769
  case "BadRequestException":
@@ -3570,37 +2777,32 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3570
2777
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3571
2778
  default:
3572
2779
  const parsedBody = parsedOutput.body;
3573
- const $metadata = deserializeMetadata(output);
3574
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3575
- response = new AppConfigServiceException_1.AppConfigServiceException({
3576
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3577
- $fault: "client",
3578
- $metadata,
2780
+ (0, smithy_client_1.throwDefaultError)({
2781
+ output,
2782
+ parsedBody,
2783
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2784
+ errorCode,
3579
2785
  });
3580
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3581
2786
  }
3582
2787
  };
3583
2788
  const deserializeAws_restJson1UpdateApplicationCommand = async (output, context) => {
3584
2789
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3585
2790
  return deserializeAws_restJson1UpdateApplicationCommandError(output, context);
3586
2791
  }
3587
- const contents = {
2792
+ const contents = map({
3588
2793
  $metadata: deserializeMetadata(output),
3589
- Description: undefined,
3590
- Id: undefined,
3591
- Name: undefined,
3592
- };
2794
+ });
3593
2795
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3594
- if (data.Description !== undefined && data.Description !== null) {
2796
+ if (data.Description != null) {
3595
2797
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3596
2798
  }
3597
- if (data.Id !== undefined && data.Id !== null) {
2799
+ if (data.Id != null) {
3598
2800
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3599
2801
  }
3600
- if (data.Name !== undefined && data.Name !== null) {
2802
+ if (data.Name != null) {
3601
2803
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3602
2804
  }
3603
- return Promise.resolve(contents);
2805
+ return contents;
3604
2806
  };
3605
2807
  exports.deserializeAws_restJson1UpdateApplicationCommand = deserializeAws_restJson1UpdateApplicationCommand;
3606
2808
  const deserializeAws_restJson1UpdateApplicationCommandError = async (output, context) => {
@@ -3608,7 +2810,6 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async (output, con
3608
2810
  ...output,
3609
2811
  body: await parseBody(output.body, context),
3610
2812
  };
3611
- let response;
3612
2813
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3613
2814
  switch (errorCode) {
3614
2815
  case "BadRequestException":
@@ -3622,57 +2823,47 @@ const deserializeAws_restJson1UpdateApplicationCommandError = async (output, con
3622
2823
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3623
2824
  default:
3624
2825
  const parsedBody = parsedOutput.body;
3625
- const $metadata = deserializeMetadata(output);
3626
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3627
- response = new AppConfigServiceException_1.AppConfigServiceException({
3628
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3629
- $fault: "client",
3630
- $metadata,
2826
+ (0, smithy_client_1.throwDefaultError)({
2827
+ output,
2828
+ parsedBody,
2829
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2830
+ errorCode,
3631
2831
  });
3632
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3633
2832
  }
3634
2833
  };
3635
2834
  const deserializeAws_restJson1UpdateConfigurationProfileCommand = async (output, context) => {
3636
2835
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3637
2836
  return deserializeAws_restJson1UpdateConfigurationProfileCommandError(output, context);
3638
2837
  }
3639
- const contents = {
2838
+ const contents = map({
3640
2839
  $metadata: deserializeMetadata(output),
3641
- ApplicationId: undefined,
3642
- Description: undefined,
3643
- Id: undefined,
3644
- LocationUri: undefined,
3645
- Name: undefined,
3646
- RetrievalRoleArn: undefined,
3647
- Type: undefined,
3648
- Validators: undefined,
3649
- };
2840
+ });
3650
2841
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3651
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2842
+ if (data.ApplicationId != null) {
3652
2843
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
3653
2844
  }
3654
- if (data.Description !== undefined && data.Description !== null) {
2845
+ if (data.Description != null) {
3655
2846
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3656
2847
  }
3657
- if (data.Id !== undefined && data.Id !== null) {
2848
+ if (data.Id != null) {
3658
2849
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3659
2850
  }
3660
- if (data.LocationUri !== undefined && data.LocationUri !== null) {
2851
+ if (data.LocationUri != null) {
3661
2852
  contents.LocationUri = (0, smithy_client_1.expectString)(data.LocationUri);
3662
2853
  }
3663
- if (data.Name !== undefined && data.Name !== null) {
2854
+ if (data.Name != null) {
3664
2855
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3665
2856
  }
3666
- if (data.RetrievalRoleArn !== undefined && data.RetrievalRoleArn !== null) {
2857
+ if (data.RetrievalRoleArn != null) {
3667
2858
  contents.RetrievalRoleArn = (0, smithy_client_1.expectString)(data.RetrievalRoleArn);
3668
2859
  }
3669
- if (data.Type !== undefined && data.Type !== null) {
2860
+ if (data.Type != null) {
3670
2861
  contents.Type = (0, smithy_client_1.expectString)(data.Type);
3671
2862
  }
3672
- if (data.Validators !== undefined && data.Validators !== null) {
2863
+ if (data.Validators != null) {
3673
2864
  contents.Validators = deserializeAws_restJson1ValidatorList(data.Validators, context);
3674
2865
  }
3675
- return Promise.resolve(contents);
2866
+ return contents;
3676
2867
  };
3677
2868
  exports.deserializeAws_restJson1UpdateConfigurationProfileCommand = deserializeAws_restJson1UpdateConfigurationProfileCommand;
3678
2869
  const deserializeAws_restJson1UpdateConfigurationProfileCommandError = async (output, context) => {
@@ -3680,7 +2871,6 @@ const deserializeAws_restJson1UpdateConfigurationProfileCommandError = async (ou
3680
2871
  ...output,
3681
2872
  body: await parseBody(output.body, context),
3682
2873
  };
3683
- let response;
3684
2874
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3685
2875
  switch (errorCode) {
3686
2876
  case "BadRequestException":
@@ -3694,57 +2884,47 @@ const deserializeAws_restJson1UpdateConfigurationProfileCommandError = async (ou
3694
2884
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3695
2885
  default:
3696
2886
  const parsedBody = parsedOutput.body;
3697
- const $metadata = deserializeMetadata(output);
3698
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3699
- response = new AppConfigServiceException_1.AppConfigServiceException({
3700
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3701
- $fault: "client",
3702
- $metadata,
2887
+ (0, smithy_client_1.throwDefaultError)({
2888
+ output,
2889
+ parsedBody,
2890
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2891
+ errorCode,
3703
2892
  });
3704
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3705
2893
  }
3706
2894
  };
3707
2895
  const deserializeAws_restJson1UpdateDeploymentStrategyCommand = async (output, context) => {
3708
2896
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3709
2897
  return deserializeAws_restJson1UpdateDeploymentStrategyCommandError(output, context);
3710
2898
  }
3711
- const contents = {
2899
+ const contents = map({
3712
2900
  $metadata: deserializeMetadata(output),
3713
- DeploymentDurationInMinutes: undefined,
3714
- Description: undefined,
3715
- FinalBakeTimeInMinutes: undefined,
3716
- GrowthFactor: undefined,
3717
- GrowthType: undefined,
3718
- Id: undefined,
3719
- Name: undefined,
3720
- ReplicateTo: undefined,
3721
- };
2901
+ });
3722
2902
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3723
- if (data.DeploymentDurationInMinutes !== undefined && data.DeploymentDurationInMinutes !== null) {
2903
+ if (data.DeploymentDurationInMinutes != null) {
3724
2904
  contents.DeploymentDurationInMinutes = (0, smithy_client_1.expectInt32)(data.DeploymentDurationInMinutes);
3725
2905
  }
3726
- if (data.Description !== undefined && data.Description !== null) {
2906
+ if (data.Description != null) {
3727
2907
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3728
2908
  }
3729
- if (data.FinalBakeTimeInMinutes !== undefined && data.FinalBakeTimeInMinutes !== null) {
2909
+ if (data.FinalBakeTimeInMinutes != null) {
3730
2910
  contents.FinalBakeTimeInMinutes = (0, smithy_client_1.expectInt32)(data.FinalBakeTimeInMinutes);
3731
2911
  }
3732
- if (data.GrowthFactor !== undefined && data.GrowthFactor !== null) {
2912
+ if (data.GrowthFactor != null) {
3733
2913
  contents.GrowthFactor = (0, smithy_client_1.limitedParseFloat32)(data.GrowthFactor);
3734
2914
  }
3735
- if (data.GrowthType !== undefined && data.GrowthType !== null) {
2915
+ if (data.GrowthType != null) {
3736
2916
  contents.GrowthType = (0, smithy_client_1.expectString)(data.GrowthType);
3737
2917
  }
3738
- if (data.Id !== undefined && data.Id !== null) {
2918
+ if (data.Id != null) {
3739
2919
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3740
2920
  }
3741
- if (data.Name !== undefined && data.Name !== null) {
2921
+ if (data.Name != null) {
3742
2922
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3743
2923
  }
3744
- if (data.ReplicateTo !== undefined && data.ReplicateTo !== null) {
2924
+ if (data.ReplicateTo != null) {
3745
2925
  contents.ReplicateTo = (0, smithy_client_1.expectString)(data.ReplicateTo);
3746
2926
  }
3747
- return Promise.resolve(contents);
2927
+ return contents;
3748
2928
  };
3749
2929
  exports.deserializeAws_restJson1UpdateDeploymentStrategyCommand = deserializeAws_restJson1UpdateDeploymentStrategyCommand;
3750
2930
  const deserializeAws_restJson1UpdateDeploymentStrategyCommandError = async (output, context) => {
@@ -3752,7 +2932,6 @@ const deserializeAws_restJson1UpdateDeploymentStrategyCommandError = async (outp
3752
2932
  ...output,
3753
2933
  body: await parseBody(output.body, context),
3754
2934
  };
3755
- let response;
3756
2935
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3757
2936
  switch (errorCode) {
3758
2937
  case "BadRequestException":
@@ -3766,49 +2945,41 @@ const deserializeAws_restJson1UpdateDeploymentStrategyCommandError = async (outp
3766
2945
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3767
2946
  default:
3768
2947
  const parsedBody = parsedOutput.body;
3769
- const $metadata = deserializeMetadata(output);
3770
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3771
- response = new AppConfigServiceException_1.AppConfigServiceException({
3772
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3773
- $fault: "client",
3774
- $metadata,
2948
+ (0, smithy_client_1.throwDefaultError)({
2949
+ output,
2950
+ parsedBody,
2951
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
2952
+ errorCode,
3775
2953
  });
3776
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3777
2954
  }
3778
2955
  };
3779
2956
  const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
3780
2957
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3781
2958
  return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
3782
2959
  }
3783
- const contents = {
2960
+ const contents = map({
3784
2961
  $metadata: deserializeMetadata(output),
3785
- ApplicationId: undefined,
3786
- Description: undefined,
3787
- Id: undefined,
3788
- Monitors: undefined,
3789
- Name: undefined,
3790
- State: undefined,
3791
- };
2962
+ });
3792
2963
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3793
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2964
+ if (data.ApplicationId != null) {
3794
2965
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
3795
2966
  }
3796
- if (data.Description !== undefined && data.Description !== null) {
2967
+ if (data.Description != null) {
3797
2968
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3798
2969
  }
3799
- if (data.Id !== undefined && data.Id !== null) {
2970
+ if (data.Id != null) {
3800
2971
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3801
2972
  }
3802
- if (data.Monitors !== undefined && data.Monitors !== null) {
2973
+ if (data.Monitors != null) {
3803
2974
  contents.Monitors = deserializeAws_restJson1MonitorList(data.Monitors, context);
3804
2975
  }
3805
- if (data.Name !== undefined && data.Name !== null) {
2976
+ if (data.Name != null) {
3806
2977
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3807
2978
  }
3808
- if (data.State !== undefined && data.State !== null) {
2979
+ if (data.State != null) {
3809
2980
  contents.State = (0, smithy_client_1.expectString)(data.State);
3810
2981
  }
3811
- return Promise.resolve(contents);
2982
+ return contents;
3812
2983
  };
3813
2984
  exports.deserializeAws_restJson1UpdateEnvironmentCommand = deserializeAws_restJson1UpdateEnvironmentCommand;
3814
2985
  const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, context) => {
@@ -3816,7 +2987,6 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, con
3816
2987
  ...output,
3817
2988
  body: await parseBody(output.body, context),
3818
2989
  };
3819
- let response;
3820
2990
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3821
2991
  switch (errorCode) {
3822
2992
  case "BadRequestException":
@@ -3830,53 +3000,44 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, con
3830
3000
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3831
3001
  default:
3832
3002
  const parsedBody = parsedOutput.body;
3833
- const $metadata = deserializeMetadata(output);
3834
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3835
- response = new AppConfigServiceException_1.AppConfigServiceException({
3836
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3837
- $fault: "client",
3838
- $metadata,
3003
+ (0, smithy_client_1.throwDefaultError)({
3004
+ output,
3005
+ parsedBody,
3006
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
3007
+ errorCode,
3839
3008
  });
3840
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3841
3009
  }
3842
3010
  };
3843
3011
  const deserializeAws_restJson1UpdateExtensionCommand = async (output, context) => {
3844
3012
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3845
3013
  return deserializeAws_restJson1UpdateExtensionCommandError(output, context);
3846
3014
  }
3847
- const contents = {
3015
+ const contents = map({
3848
3016
  $metadata: deserializeMetadata(output),
3849
- Actions: undefined,
3850
- Arn: undefined,
3851
- Description: undefined,
3852
- Id: undefined,
3853
- Name: undefined,
3854
- Parameters: undefined,
3855
- VersionNumber: undefined,
3856
- };
3017
+ });
3857
3018
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3858
- if (data.Actions !== undefined && data.Actions !== null) {
3019
+ if (data.Actions != null) {
3859
3020
  contents.Actions = deserializeAws_restJson1ActionsMap(data.Actions, context);
3860
3021
  }
3861
- if (data.Arn !== undefined && data.Arn !== null) {
3022
+ if (data.Arn != null) {
3862
3023
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
3863
3024
  }
3864
- if (data.Description !== undefined && data.Description !== null) {
3025
+ if (data.Description != null) {
3865
3026
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3866
3027
  }
3867
- if (data.Id !== undefined && data.Id !== null) {
3028
+ if (data.Id != null) {
3868
3029
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3869
3030
  }
3870
- if (data.Name !== undefined && data.Name !== null) {
3031
+ if (data.Name != null) {
3871
3032
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3872
3033
  }
3873
- if (data.Parameters !== undefined && data.Parameters !== null) {
3034
+ if (data.Parameters != null) {
3874
3035
  contents.Parameters = deserializeAws_restJson1ParameterMap(data.Parameters, context);
3875
3036
  }
3876
- if (data.VersionNumber !== undefined && data.VersionNumber !== null) {
3037
+ if (data.VersionNumber != null) {
3877
3038
  contents.VersionNumber = (0, smithy_client_1.expectInt32)(data.VersionNumber);
3878
3039
  }
3879
- return Promise.resolve(contents);
3040
+ return contents;
3880
3041
  };
3881
3042
  exports.deserializeAws_restJson1UpdateExtensionCommand = deserializeAws_restJson1UpdateExtensionCommand;
3882
3043
  const deserializeAws_restJson1UpdateExtensionCommandError = async (output, context) => {
@@ -3884,7 +3045,6 @@ const deserializeAws_restJson1UpdateExtensionCommandError = async (output, conte
3884
3045
  ...output,
3885
3046
  body: await parseBody(output.body, context),
3886
3047
  };
3887
- let response;
3888
3048
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3889
3049
  switch (errorCode) {
3890
3050
  case "BadRequestException":
@@ -3901,49 +3061,41 @@ const deserializeAws_restJson1UpdateExtensionCommandError = async (output, conte
3901
3061
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3902
3062
  default:
3903
3063
  const parsedBody = parsedOutput.body;
3904
- const $metadata = deserializeMetadata(output);
3905
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3906
- response = new AppConfigServiceException_1.AppConfigServiceException({
3907
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3908
- $fault: "client",
3909
- $metadata,
3064
+ (0, smithy_client_1.throwDefaultError)({
3065
+ output,
3066
+ parsedBody,
3067
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
3068
+ errorCode,
3910
3069
  });
3911
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3912
3070
  }
3913
3071
  };
3914
3072
  const deserializeAws_restJson1UpdateExtensionAssociationCommand = async (output, context) => {
3915
3073
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3916
3074
  return deserializeAws_restJson1UpdateExtensionAssociationCommandError(output, context);
3917
3075
  }
3918
- const contents = {
3076
+ const contents = map({
3919
3077
  $metadata: deserializeMetadata(output),
3920
- Arn: undefined,
3921
- ExtensionArn: undefined,
3922
- ExtensionVersionNumber: undefined,
3923
- Id: undefined,
3924
- Parameters: undefined,
3925
- ResourceArn: undefined,
3926
- };
3078
+ });
3927
3079
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3928
- if (data.Arn !== undefined && data.Arn !== null) {
3080
+ if (data.Arn != null) {
3929
3081
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
3930
3082
  }
3931
- if (data.ExtensionArn !== undefined && data.ExtensionArn !== null) {
3083
+ if (data.ExtensionArn != null) {
3932
3084
  contents.ExtensionArn = (0, smithy_client_1.expectString)(data.ExtensionArn);
3933
3085
  }
3934
- if (data.ExtensionVersionNumber !== undefined && data.ExtensionVersionNumber !== null) {
3086
+ if (data.ExtensionVersionNumber != null) {
3935
3087
  contents.ExtensionVersionNumber = (0, smithy_client_1.expectInt32)(data.ExtensionVersionNumber);
3936
3088
  }
3937
- if (data.Id !== undefined && data.Id !== null) {
3089
+ if (data.Id != null) {
3938
3090
  contents.Id = (0, smithy_client_1.expectString)(data.Id);
3939
3091
  }
3940
- if (data.Parameters !== undefined && data.Parameters !== null) {
3092
+ if (data.Parameters != null) {
3941
3093
  contents.Parameters = deserializeAws_restJson1ParameterValueMap(data.Parameters, context);
3942
3094
  }
3943
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
3095
+ if (data.ResourceArn != null) {
3944
3096
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
3945
3097
  }
3946
- return Promise.resolve(contents);
3098
+ return contents;
3947
3099
  };
3948
3100
  exports.deserializeAws_restJson1UpdateExtensionAssociationCommand = deserializeAws_restJson1UpdateExtensionAssociationCommand;
3949
3101
  const deserializeAws_restJson1UpdateExtensionAssociationCommandError = async (output, context) => {
@@ -3951,7 +3103,6 @@ const deserializeAws_restJson1UpdateExtensionAssociationCommandError = async (ou
3951
3103
  ...output,
3952
3104
  body: await parseBody(output.body, context),
3953
3105
  };
3954
- let response;
3955
3106
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3956
3107
  switch (errorCode) {
3957
3108
  case "BadRequestException":
@@ -3965,25 +3116,23 @@ const deserializeAws_restJson1UpdateExtensionAssociationCommandError = async (ou
3965
3116
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3966
3117
  default:
3967
3118
  const parsedBody = parsedOutput.body;
3968
- const $metadata = deserializeMetadata(output);
3969
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3970
- response = new AppConfigServiceException_1.AppConfigServiceException({
3971
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3972
- $fault: "client",
3973
- $metadata,
3119
+ (0, smithy_client_1.throwDefaultError)({
3120
+ output,
3121
+ parsedBody,
3122
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
3123
+ errorCode,
3974
3124
  });
3975
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3976
3125
  }
3977
3126
  };
3978
3127
  const deserializeAws_restJson1ValidateConfigurationCommand = async (output, context) => {
3979
3128
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3980
3129
  return deserializeAws_restJson1ValidateConfigurationCommandError(output, context);
3981
3130
  }
3982
- const contents = {
3131
+ const contents = map({
3983
3132
  $metadata: deserializeMetadata(output),
3984
- };
3133
+ });
3985
3134
  await collectBody(output.body, context);
3986
- return Promise.resolve(contents);
3135
+ return contents;
3987
3136
  };
3988
3137
  exports.deserializeAws_restJson1ValidateConfigurationCommand = deserializeAws_restJson1ValidateConfigurationCommand;
3989
3138
  const deserializeAws_restJson1ValidateConfigurationCommandError = async (output, context) => {
@@ -3991,7 +3140,6 @@ const deserializeAws_restJson1ValidateConfigurationCommandError = async (output,
3991
3140
  ...output,
3992
3141
  body: await parseBody(output.body, context),
3993
3142
  };
3994
- let response;
3995
3143
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3996
3144
  switch (errorCode) {
3997
3145
  case "BadRequestException":
@@ -4005,26 +3153,25 @@ const deserializeAws_restJson1ValidateConfigurationCommandError = async (output,
4005
3153
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4006
3154
  default:
4007
3155
  const parsedBody = parsedOutput.body;
4008
- const $metadata = deserializeMetadata(output);
4009
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4010
- response = new AppConfigServiceException_1.AppConfigServiceException({
4011
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4012
- $fault: "client",
4013
- $metadata,
3156
+ (0, smithy_client_1.throwDefaultError)({
3157
+ output,
3158
+ parsedBody,
3159
+ exceptionCtor: AppConfigServiceException_1.AppConfigServiceException,
3160
+ errorCode,
4014
3161
  });
4015
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4016
3162
  }
4017
3163
  };
3164
+ const map = smithy_client_1.map;
4018
3165
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
4019
- const contents = {};
3166
+ const contents = map({});
4020
3167
  const data = parsedOutput.body;
4021
- if (data.Details !== undefined && data.Details !== null) {
3168
+ if (data.Details != null) {
4022
3169
  contents.Details = deserializeAws_restJson1BadRequestDetails((0, smithy_client_1.expectUnion)(data.Details), context);
4023
3170
  }
4024
- if (data.Message !== undefined && data.Message !== null) {
3171
+ if (data.Message != null) {
4025
3172
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4026
3173
  }
4027
- if (data.Reason !== undefined && data.Reason !== null) {
3174
+ if (data.Reason != null) {
4028
3175
  contents.Reason = (0, smithy_client_1.expectString)(data.Reason);
4029
3176
  }
4030
3177
  const exception = new models_0_1.BadRequestException({
@@ -4034,9 +3181,9 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
4034
3181
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4035
3182
  };
4036
3183
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
4037
- const contents = {};
3184
+ const contents = map({});
4038
3185
  const data = parsedOutput.body;
4039
- if (data.Message !== undefined && data.Message !== null) {
3186
+ if (data.Message != null) {
4040
3187
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4041
3188
  }
4042
3189
  const exception = new models_0_1.ConflictException({
@@ -4046,9 +3193,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
4046
3193
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4047
3194
  };
4048
3195
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
4049
- const contents = {};
3196
+ const contents = map({});
4050
3197
  const data = parsedOutput.body;
4051
- if (data.Message !== undefined && data.Message !== null) {
3198
+ if (data.Message != null) {
4052
3199
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4053
3200
  }
4054
3201
  const exception = new models_0_1.InternalServerException({
@@ -4058,18 +3205,18 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
4058
3205
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4059
3206
  };
4060
3207
  const deserializeAws_restJson1PayloadTooLargeExceptionResponse = async (parsedOutput, context) => {
4061
- const contents = {};
3208
+ const contents = map({});
4062
3209
  const data = parsedOutput.body;
4063
- if (data.Limit !== undefined && data.Limit !== null) {
3210
+ if (data.Limit != null) {
4064
3211
  contents.Limit = (0, smithy_client_1.limitedParseFloat32)(data.Limit);
4065
3212
  }
4066
- if (data.Measure !== undefined && data.Measure !== null) {
3213
+ if (data.Measure != null) {
4067
3214
  contents.Measure = (0, smithy_client_1.expectString)(data.Measure);
4068
3215
  }
4069
- if (data.Message !== undefined && data.Message !== null) {
3216
+ if (data.Message != null) {
4070
3217
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4071
3218
  }
4072
- if (data.Size !== undefined && data.Size !== null) {
3219
+ if (data.Size != null) {
4073
3220
  contents.Size = (0, smithy_client_1.limitedParseFloat32)(data.Size);
4074
3221
  }
4075
3222
  const exception = new models_0_1.PayloadTooLargeException({
@@ -4079,12 +3226,12 @@ const deserializeAws_restJson1PayloadTooLargeExceptionResponse = async (parsedOu
4079
3226
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4080
3227
  };
4081
3228
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
4082
- const contents = {};
3229
+ const contents = map({});
4083
3230
  const data = parsedOutput.body;
4084
- if (data.Message !== undefined && data.Message !== null) {
3231
+ if (data.Message != null) {
4085
3232
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4086
3233
  }
4087
- if (data.ResourceName !== undefined && data.ResourceName !== null) {
3234
+ if (data.ResourceName != null) {
4088
3235
  contents.ResourceName = (0, smithy_client_1.expectString)(data.ResourceName);
4089
3236
  }
4090
3237
  const exception = new models_0_1.ResourceNotFoundException({
@@ -4094,9 +3241,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
4094
3241
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4095
3242
  };
4096
3243
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
4097
- const contents = {};
3244
+ const contents = map({});
4098
3245
  const data = parsedOutput.body;
4099
- if (data.Message !== undefined && data.Message !== null) {
3246
+ if (data.Message != null) {
4100
3247
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
4101
3248
  }
4102
3249
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -4117,9 +3264,6 @@ const serializeAws_restJson1ActionList = (input, context) => {
4117
3264
  return input
4118
3265
  .filter((e) => e != null)
4119
3266
  .map((entry) => {
4120
- if (entry === null) {
4121
- return null;
4122
- }
4123
3267
  return serializeAws_restJson1Action(entry, context);
4124
3268
  });
4125
3269
  };
@@ -4144,9 +3288,6 @@ const serializeAws_restJson1MonitorList = (input, context) => {
4144
3288
  return input
4145
3289
  .filter((e) => e != null)
4146
3290
  .map((entry) => {
4147
- if (entry === null) {
4148
- return null;
4149
- }
4150
3291
  return serializeAws_restJson1Monitor(entry, context);
4151
3292
  });
4152
3293
  };
@@ -4199,9 +3340,6 @@ const serializeAws_restJson1ValidatorList = (input, context) => {
4199
3340
  return input
4200
3341
  .filter((e) => e != null)
4201
3342
  .map((entry) => {
4202
- if (entry === null) {
4203
- return null;
4204
- }
4205
3343
  return serializeAws_restJson1Validator(entry, context);
4206
3344
  });
4207
3345
  };
@@ -4295,7 +3433,7 @@ const deserializeAws_restJson1AppliedExtensions = (output, context) => {
4295
3433
  return retVal;
4296
3434
  };
4297
3435
  const deserializeAws_restJson1BadRequestDetails = (output, context) => {
4298
- if (output.InvalidConfiguration !== undefined && output.InvalidConfiguration !== null) {
3436
+ if (output.InvalidConfiguration != null) {
4299
3437
  return {
4300
3438
  InvalidConfiguration: deserializeAws_restJson1InvalidConfigurationDetailList(output.InvalidConfiguration, context),
4301
3439
  };