@aws-sdk/client-databrew 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.
@@ -12,16 +12,7 @@ const serializeAws_restJson1BatchDeleteRecipeVersionCommand = async (input, cont
12
12
  "content-type": "application/json",
13
13
  };
14
14
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipes/{Name}/batchDeleteRecipeVersion";
15
- if (input.Name !== undefined) {
16
- const labelValue = input.Name;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: Name.");
19
- }
20
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: Name.");
24
- }
15
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
25
16
  let body;
26
17
  body = JSON.stringify({
27
18
  ...(input.RecipeVersions != null && {
@@ -251,16 +242,7 @@ const serializeAws_restJson1DeleteDatasetCommand = async (input, context) => {
251
242
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
243
  const headers = {};
253
244
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{Name}";
254
- if (input.Name !== undefined) {
255
- const labelValue = input.Name;
256
- if (labelValue.length <= 0) {
257
- throw new Error("Empty value provided for input HTTP label: Name.");
258
- }
259
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
260
- }
261
- else {
262
- throw new Error("No value provided for input HTTP label: Name.");
263
- }
245
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
264
246
  let body;
265
247
  return new protocol_http_1.HttpRequest({
266
248
  protocol,
@@ -277,16 +259,7 @@ const serializeAws_restJson1DeleteJobCommand = async (input, context) => {
277
259
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
278
260
  const headers = {};
279
261
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}";
280
- if (input.Name !== undefined) {
281
- const labelValue = input.Name;
282
- if (labelValue.length <= 0) {
283
- throw new Error("Empty value provided for input HTTP label: Name.");
284
- }
285
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
286
- }
287
- else {
288
- throw new Error("No value provided for input HTTP label: Name.");
289
- }
262
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
290
263
  let body;
291
264
  return new protocol_http_1.HttpRequest({
292
265
  protocol,
@@ -303,16 +276,7 @@ const serializeAws_restJson1DeleteProjectCommand = async (input, context) => {
303
276
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
304
277
  const headers = {};
305
278
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{Name}";
306
- if (input.Name !== undefined) {
307
- const labelValue = input.Name;
308
- if (labelValue.length <= 0) {
309
- throw new Error("Empty value provided for input HTTP label: Name.");
310
- }
311
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
312
- }
313
- else {
314
- throw new Error("No value provided for input HTTP label: Name.");
315
- }
279
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
316
280
  let body;
317
281
  return new protocol_http_1.HttpRequest({
318
282
  protocol,
@@ -330,26 +294,8 @@ const serializeAws_restJson1DeleteRecipeVersionCommand = async (input, context)
330
294
  const headers = {};
331
295
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
332
296
  "/recipes/{Name}/recipeVersion/{RecipeVersion}";
333
- if (input.Name !== undefined) {
334
- const labelValue = input.Name;
335
- if (labelValue.length <= 0) {
336
- throw new Error("Empty value provided for input HTTP label: Name.");
337
- }
338
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
339
- }
340
- else {
341
- throw new Error("No value provided for input HTTP label: Name.");
342
- }
343
- if (input.RecipeVersion !== undefined) {
344
- const labelValue = input.RecipeVersion;
345
- if (labelValue.length <= 0) {
346
- throw new Error("Empty value provided for input HTTP label: RecipeVersion.");
347
- }
348
- resolvedPath = resolvedPath.replace("{RecipeVersion}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
349
- }
350
- else {
351
- throw new Error("No value provided for input HTTP label: RecipeVersion.");
352
- }
297
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
298
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RecipeVersion", () => input.RecipeVersion, "{RecipeVersion}", false);
353
299
  let body;
354
300
  return new protocol_http_1.HttpRequest({
355
301
  protocol,
@@ -366,16 +312,7 @@ const serializeAws_restJson1DeleteRulesetCommand = async (input, context) => {
366
312
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
367
313
  const headers = {};
368
314
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rulesets/{Name}";
369
- if (input.Name !== undefined) {
370
- const labelValue = input.Name;
371
- if (labelValue.length <= 0) {
372
- throw new Error("Empty value provided for input HTTP label: Name.");
373
- }
374
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
375
- }
376
- else {
377
- throw new Error("No value provided for input HTTP label: Name.");
378
- }
315
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
379
316
  let body;
380
317
  return new protocol_http_1.HttpRequest({
381
318
  protocol,
@@ -392,16 +329,7 @@ const serializeAws_restJson1DeleteScheduleCommand = async (input, context) => {
392
329
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
393
330
  const headers = {};
394
331
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
395
- if (input.Name !== undefined) {
396
- const labelValue = input.Name;
397
- if (labelValue.length <= 0) {
398
- throw new Error("Empty value provided for input HTTP label: Name.");
399
- }
400
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
401
- }
402
- else {
403
- throw new Error("No value provided for input HTTP label: Name.");
404
- }
332
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
405
333
  let body;
406
334
  return new protocol_http_1.HttpRequest({
407
335
  protocol,
@@ -418,16 +346,7 @@ const serializeAws_restJson1DescribeDatasetCommand = async (input, context) => {
418
346
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
419
347
  const headers = {};
420
348
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{Name}";
421
- if (input.Name !== undefined) {
422
- const labelValue = input.Name;
423
- if (labelValue.length <= 0) {
424
- throw new Error("Empty value provided for input HTTP label: Name.");
425
- }
426
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
427
- }
428
- else {
429
- throw new Error("No value provided for input HTTP label: Name.");
430
- }
349
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
431
350
  let body;
432
351
  return new protocol_http_1.HttpRequest({
433
352
  protocol,
@@ -444,16 +363,7 @@ const serializeAws_restJson1DescribeJobCommand = async (input, context) => {
444
363
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
445
364
  const headers = {};
446
365
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}";
447
- if (input.Name !== undefined) {
448
- const labelValue = input.Name;
449
- if (labelValue.length <= 0) {
450
- throw new Error("Empty value provided for input HTTP label: Name.");
451
- }
452
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
453
- }
454
- else {
455
- throw new Error("No value provided for input HTTP label: Name.");
456
- }
366
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
457
367
  let body;
458
368
  return new protocol_http_1.HttpRequest({
459
369
  protocol,
@@ -470,26 +380,8 @@ const serializeAws_restJson1DescribeJobRunCommand = async (input, context) => {
470
380
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
471
381
  const headers = {};
472
382
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}/jobRun/{RunId}";
473
- if (input.Name !== undefined) {
474
- const labelValue = input.Name;
475
- if (labelValue.length <= 0) {
476
- throw new Error("Empty value provided for input HTTP label: Name.");
477
- }
478
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
479
- }
480
- else {
481
- throw new Error("No value provided for input HTTP label: Name.");
482
- }
483
- if (input.RunId !== undefined) {
484
- const labelValue = input.RunId;
485
- if (labelValue.length <= 0) {
486
- throw new Error("Empty value provided for input HTTP label: RunId.");
487
- }
488
- resolvedPath = resolvedPath.replace("{RunId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
489
- }
490
- else {
491
- throw new Error("No value provided for input HTTP label: RunId.");
492
- }
383
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
384
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RunId", () => input.RunId, "{RunId}", false);
493
385
  let body;
494
386
  return new protocol_http_1.HttpRequest({
495
387
  protocol,
@@ -506,16 +398,7 @@ const serializeAws_restJson1DescribeProjectCommand = async (input, context) => {
506
398
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
507
399
  const headers = {};
508
400
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{Name}";
509
- if (input.Name !== undefined) {
510
- const labelValue = input.Name;
511
- if (labelValue.length <= 0) {
512
- throw new Error("Empty value provided for input HTTP label: Name.");
513
- }
514
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
515
- }
516
- else {
517
- throw new Error("No value provided for input HTTP label: Name.");
518
- }
401
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
519
402
  let body;
520
403
  return new protocol_http_1.HttpRequest({
521
404
  protocol,
@@ -532,19 +415,10 @@ const serializeAws_restJson1DescribeRecipeCommand = async (input, context) => {
532
415
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
533
416
  const headers = {};
534
417
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipes/{Name}";
535
- if (input.Name !== undefined) {
536
- const labelValue = input.Name;
537
- if (labelValue.length <= 0) {
538
- throw new Error("Empty value provided for input HTTP label: Name.");
539
- }
540
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
541
- }
542
- else {
543
- throw new Error("No value provided for input HTTP label: Name.");
544
- }
545
- const query = {
546
- ...(input.RecipeVersion !== undefined && { recipeVersion: input.RecipeVersion }),
547
- };
418
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
419
+ const query = map({
420
+ recipeVersion: [, input.RecipeVersion],
421
+ });
548
422
  let body;
549
423
  return new protocol_http_1.HttpRequest({
550
424
  protocol,
@@ -562,16 +436,7 @@ const serializeAws_restJson1DescribeRulesetCommand = async (input, context) => {
562
436
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
563
437
  const headers = {};
564
438
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rulesets/{Name}";
565
- if (input.Name !== undefined) {
566
- const labelValue = input.Name;
567
- if (labelValue.length <= 0) {
568
- throw new Error("Empty value provided for input HTTP label: Name.");
569
- }
570
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
571
- }
572
- else {
573
- throw new Error("No value provided for input HTTP label: Name.");
574
- }
439
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
575
440
  let body;
576
441
  return new protocol_http_1.HttpRequest({
577
442
  protocol,
@@ -588,16 +453,7 @@ const serializeAws_restJson1DescribeScheduleCommand = async (input, context) =>
588
453
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
589
454
  const headers = {};
590
455
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
591
- if (input.Name !== undefined) {
592
- const labelValue = input.Name;
593
- if (labelValue.length <= 0) {
594
- throw new Error("Empty value provided for input HTTP label: Name.");
595
- }
596
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
597
- }
598
- else {
599
- throw new Error("No value provided for input HTTP label: Name.");
600
- }
456
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
601
457
  let body;
602
458
  return new protocol_http_1.HttpRequest({
603
459
  protocol,
@@ -614,10 +470,10 @@ const serializeAws_restJson1ListDatasetsCommand = async (input, context) => {
614
470
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
615
471
  const headers = {};
616
472
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets";
617
- const query = {
618
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
619
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
620
- };
473
+ const query = map({
474
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
475
+ nextToken: [, input.NextToken],
476
+ });
621
477
  let body;
622
478
  return new protocol_http_1.HttpRequest({
623
479
  protocol,
@@ -635,20 +491,11 @@ const serializeAws_restJson1ListJobRunsCommand = async (input, context) => {
635
491
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
636
492
  const headers = {};
637
493
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}/jobRuns";
638
- if (input.Name !== undefined) {
639
- const labelValue = input.Name;
640
- if (labelValue.length <= 0) {
641
- throw new Error("Empty value provided for input HTTP label: Name.");
642
- }
643
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
644
- }
645
- else {
646
- throw new Error("No value provided for input HTTP label: Name.");
647
- }
648
- const query = {
649
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
650
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
651
- };
494
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
495
+ const query = map({
496
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
497
+ nextToken: [, input.NextToken],
498
+ });
652
499
  let body;
653
500
  return new protocol_http_1.HttpRequest({
654
501
  protocol,
@@ -666,12 +513,12 @@ const serializeAws_restJson1ListJobsCommand = async (input, context) => {
666
513
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
667
514
  const headers = {};
668
515
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs";
669
- const query = {
670
- ...(input.DatasetName !== undefined && { datasetName: input.DatasetName }),
671
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
672
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
673
- ...(input.ProjectName !== undefined && { projectName: input.ProjectName }),
674
- };
516
+ const query = map({
517
+ datasetName: [, input.DatasetName],
518
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
519
+ nextToken: [, input.NextToken],
520
+ projectName: [, input.ProjectName],
521
+ });
675
522
  let body;
676
523
  return new protocol_http_1.HttpRequest({
677
524
  protocol,
@@ -689,10 +536,10 @@ const serializeAws_restJson1ListProjectsCommand = async (input, context) => {
689
536
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
690
537
  const headers = {};
691
538
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects";
692
- const query = {
693
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
694
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
695
- };
539
+ const query = map({
540
+ nextToken: [, input.NextToken],
541
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
542
+ });
696
543
  let body;
697
544
  return new protocol_http_1.HttpRequest({
698
545
  protocol,
@@ -710,11 +557,11 @@ const serializeAws_restJson1ListRecipesCommand = async (input, context) => {
710
557
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
711
558
  const headers = {};
712
559
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipes";
713
- const query = {
714
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
715
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
716
- ...(input.RecipeVersion !== undefined && { recipeVersion: input.RecipeVersion }),
717
- };
560
+ const query = map({
561
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
562
+ nextToken: [, input.NextToken],
563
+ recipeVersion: [, input.RecipeVersion],
564
+ });
718
565
  let body;
719
566
  return new protocol_http_1.HttpRequest({
720
567
  protocol,
@@ -732,11 +579,11 @@ const serializeAws_restJson1ListRecipeVersionsCommand = async (input, context) =
732
579
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
733
580
  const headers = {};
734
581
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipeVersions";
735
- const query = {
736
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
737
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
738
- ...(input.Name !== undefined && { name: input.Name }),
739
- };
582
+ const query = map({
583
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
584
+ nextToken: [, input.NextToken],
585
+ name: [, input.Name],
586
+ });
740
587
  let body;
741
588
  return new protocol_http_1.HttpRequest({
742
589
  protocol,
@@ -754,11 +601,11 @@ const serializeAws_restJson1ListRulesetsCommand = async (input, context) => {
754
601
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
755
602
  const headers = {};
756
603
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rulesets";
757
- const query = {
758
- ...(input.TargetArn !== undefined && { targetArn: input.TargetArn }),
759
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
760
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
761
- };
604
+ const query = map({
605
+ targetArn: [, input.TargetArn],
606
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
607
+ nextToken: [, input.NextToken],
608
+ });
762
609
  let body;
763
610
  return new protocol_http_1.HttpRequest({
764
611
  protocol,
@@ -776,11 +623,11 @@ const serializeAws_restJson1ListSchedulesCommand = async (input, context) => {
776
623
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
777
624
  const headers = {};
778
625
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/schedules";
779
- const query = {
780
- ...(input.JobName !== undefined && { jobName: input.JobName }),
781
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
782
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
783
- };
626
+ const query = map({
627
+ jobName: [, input.JobName],
628
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
629
+ nextToken: [, input.NextToken],
630
+ });
784
631
  let body;
785
632
  return new protocol_http_1.HttpRequest({
786
633
  protocol,
@@ -798,16 +645,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
798
645
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
799
646
  const headers = {};
800
647
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
801
- if (input.ResourceArn !== undefined) {
802
- const labelValue = input.ResourceArn;
803
- if (labelValue.length <= 0) {
804
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
805
- }
806
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
807
- }
808
- else {
809
- throw new Error("No value provided for input HTTP label: ResourceArn.");
810
- }
648
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
811
649
  let body;
812
650
  return new protocol_http_1.HttpRequest({
813
651
  protocol,
@@ -826,16 +664,7 @@ const serializeAws_restJson1PublishRecipeCommand = async (input, context) => {
826
664
  "content-type": "application/json",
827
665
  };
828
666
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipes/{Name}/publishRecipe";
829
- if (input.Name !== undefined) {
830
- const labelValue = input.Name;
831
- if (labelValue.length <= 0) {
832
- throw new Error("Empty value provided for input HTTP label: Name.");
833
- }
834
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
835
- }
836
- else {
837
- throw new Error("No value provided for input HTTP label: Name.");
838
- }
667
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
839
668
  let body;
840
669
  body = JSON.stringify({
841
670
  ...(input.Description != null && { Description: input.Description }),
@@ -857,16 +686,7 @@ const serializeAws_restJson1SendProjectSessionActionCommand = async (input, cont
857
686
  "content-type": "application/json",
858
687
  };
859
688
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{Name}/sendProjectSessionAction";
860
- if (input.Name !== undefined) {
861
- const labelValue = input.Name;
862
- if (labelValue.length <= 0) {
863
- throw new Error("Empty value provided for input HTTP label: Name.");
864
- }
865
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
866
- }
867
- else {
868
- throw new Error("No value provided for input HTTP label: Name.");
869
- }
689
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
870
690
  let body;
871
691
  body = JSON.stringify({
872
692
  ...(input.ClientSessionId != null && { ClientSessionId: input.ClientSessionId }),
@@ -890,16 +710,7 @@ const serializeAws_restJson1StartJobRunCommand = async (input, context) => {
890
710
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
891
711
  const headers = {};
892
712
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}/startJobRun";
893
- if (input.Name !== undefined) {
894
- const labelValue = input.Name;
895
- if (labelValue.length <= 0) {
896
- throw new Error("Empty value provided for input HTTP label: Name.");
897
- }
898
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
899
- }
900
- else {
901
- throw new Error("No value provided for input HTTP label: Name.");
902
- }
713
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
903
714
  let body;
904
715
  return new protocol_http_1.HttpRequest({
905
716
  protocol,
@@ -918,16 +729,7 @@ const serializeAws_restJson1StartProjectSessionCommand = async (input, context)
918
729
  "content-type": "application/json",
919
730
  };
920
731
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{Name}/startProjectSession";
921
- if (input.Name !== undefined) {
922
- const labelValue = input.Name;
923
- if (labelValue.length <= 0) {
924
- throw new Error("Empty value provided for input HTTP label: Name.");
925
- }
926
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
927
- }
928
- else {
929
- throw new Error("No value provided for input HTTP label: Name.");
930
- }
732
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
931
733
  let body;
932
734
  body = JSON.stringify({
933
735
  ...(input.AssumeControl != null && { AssumeControl: input.AssumeControl }),
@@ -947,26 +749,8 @@ const serializeAws_restJson1StopJobRunCommand = async (input, context) => {
947
749
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
948
750
  const headers = {};
949
751
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/jobs/{Name}/jobRun/{RunId}/stopJobRun";
950
- if (input.Name !== undefined) {
951
- const labelValue = input.Name;
952
- if (labelValue.length <= 0) {
953
- throw new Error("Empty value provided for input HTTP label: Name.");
954
- }
955
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
956
- }
957
- else {
958
- throw new Error("No value provided for input HTTP label: Name.");
959
- }
960
- if (input.RunId !== undefined) {
961
- const labelValue = input.RunId;
962
- if (labelValue.length <= 0) {
963
- throw new Error("Empty value provided for input HTTP label: RunId.");
964
- }
965
- resolvedPath = resolvedPath.replace("{RunId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
966
- }
967
- else {
968
- throw new Error("No value provided for input HTTP label: RunId.");
969
- }
752
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
753
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RunId", () => input.RunId, "{RunId}", false);
970
754
  let body;
971
755
  return new protocol_http_1.HttpRequest({
972
756
  protocol,
@@ -985,16 +769,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
985
769
  "content-type": "application/json",
986
770
  };
987
771
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
988
- if (input.ResourceArn !== undefined) {
989
- const labelValue = input.ResourceArn;
990
- if (labelValue.length <= 0) {
991
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
992
- }
993
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
994
- }
995
- else {
996
- throw new Error("No value provided for input HTTP label: ResourceArn.");
997
- }
772
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
998
773
  let body;
999
774
  body = JSON.stringify({
1000
775
  ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
@@ -1014,19 +789,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
1014
789
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1015
790
  const headers = {};
1016
791
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1017
- if (input.ResourceArn !== undefined) {
1018
- const labelValue = input.ResourceArn;
1019
- if (labelValue.length <= 0) {
1020
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1021
- }
1022
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1023
- }
1024
- else {
1025
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1026
- }
1027
- const query = {
1028
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
1029
- };
792
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
793
+ const query = map({
794
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
795
+ });
1030
796
  let body;
1031
797
  return new protocol_http_1.HttpRequest({
1032
798
  protocol,
@@ -1046,16 +812,7 @@ const serializeAws_restJson1UpdateDatasetCommand = async (input, context) => {
1046
812
  "content-type": "application/json",
1047
813
  };
1048
814
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/datasets/{Name}";
1049
- if (input.Name !== undefined) {
1050
- const labelValue = input.Name;
1051
- if (labelValue.length <= 0) {
1052
- throw new Error("Empty value provided for input HTTP label: Name.");
1053
- }
1054
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1055
- }
1056
- else {
1057
- throw new Error("No value provided for input HTTP label: Name.");
1058
- }
815
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1059
816
  let body;
1060
817
  body = JSON.stringify({
1061
818
  ...(input.Format != null && { Format: input.Format }),
@@ -1082,16 +839,7 @@ const serializeAws_restJson1UpdateProfileJobCommand = async (input, context) =>
1082
839
  "content-type": "application/json",
1083
840
  };
1084
841
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profileJobs/{Name}";
1085
- if (input.Name !== undefined) {
1086
- const labelValue = input.Name;
1087
- if (labelValue.length <= 0) {
1088
- throw new Error("Empty value provided for input HTTP label: Name.");
1089
- }
1090
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1091
- }
1092
- else {
1093
- throw new Error("No value provided for input HTTP label: Name.");
1094
- }
842
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1095
843
  let body;
1096
844
  body = JSON.stringify({
1097
845
  ...(input.Configuration != null && {
@@ -1129,16 +877,7 @@ const serializeAws_restJson1UpdateProjectCommand = async (input, context) => {
1129
877
  "content-type": "application/json",
1130
878
  };
1131
879
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{Name}";
1132
- if (input.Name !== undefined) {
1133
- const labelValue = input.Name;
1134
- if (labelValue.length <= 0) {
1135
- throw new Error("Empty value provided for input HTTP label: Name.");
1136
- }
1137
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1138
- }
1139
- else {
1140
- throw new Error("No value provided for input HTTP label: Name.");
1141
- }
880
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1142
881
  let body;
1143
882
  body = JSON.stringify({
1144
883
  ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
@@ -1161,16 +900,7 @@ const serializeAws_restJson1UpdateRecipeCommand = async (input, context) => {
1161
900
  "content-type": "application/json",
1162
901
  };
1163
902
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipes/{Name}";
1164
- if (input.Name !== undefined) {
1165
- const labelValue = input.Name;
1166
- if (labelValue.length <= 0) {
1167
- throw new Error("Empty value provided for input HTTP label: Name.");
1168
- }
1169
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1170
- }
1171
- else {
1172
- throw new Error("No value provided for input HTTP label: Name.");
1173
- }
903
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1174
904
  let body;
1175
905
  body = JSON.stringify({
1176
906
  ...(input.Description != null && { Description: input.Description }),
@@ -1193,16 +923,7 @@ const serializeAws_restJson1UpdateRecipeJobCommand = async (input, context) => {
1193
923
  "content-type": "application/json",
1194
924
  };
1195
925
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recipeJobs/{Name}";
1196
- if (input.Name !== undefined) {
1197
- const labelValue = input.Name;
1198
- if (labelValue.length <= 0) {
1199
- throw new Error("Empty value provided for input HTTP label: Name.");
1200
- }
1201
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1202
- }
1203
- else {
1204
- throw new Error("No value provided for input HTTP label: Name.");
1205
- }
926
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1206
927
  let body;
1207
928
  body = JSON.stringify({
1208
929
  ...(input.DataCatalogOutputs != null && {
@@ -1237,16 +958,7 @@ const serializeAws_restJson1UpdateRulesetCommand = async (input, context) => {
1237
958
  "content-type": "application/json",
1238
959
  };
1239
960
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/rulesets/{Name}";
1240
- if (input.Name !== undefined) {
1241
- const labelValue = input.Name;
1242
- if (labelValue.length <= 0) {
1243
- throw new Error("Empty value provided for input HTTP label: Name.");
1244
- }
1245
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1246
- }
1247
- else {
1248
- throw new Error("No value provided for input HTTP label: Name.");
1249
- }
961
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1250
962
  let body;
1251
963
  body = JSON.stringify({
1252
964
  ...(input.Description != null && { Description: input.Description }),
@@ -1269,16 +981,7 @@ const serializeAws_restJson1UpdateScheduleCommand = async (input, context) => {
1269
981
  "content-type": "application/json",
1270
982
  };
1271
983
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
1272
- if (input.Name !== undefined) {
1273
- const labelValue = input.Name;
1274
- if (labelValue.length <= 0) {
1275
- throw new Error("Empty value provided for input HTTP label: Name.");
1276
- }
1277
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1278
- }
1279
- else {
1280
- throw new Error("No value provided for input HTTP label: Name.");
1281
- }
984
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
1282
985
  let body;
1283
986
  body = JSON.stringify({
1284
987
  ...(input.CronExpression != null && { CronExpression: input.CronExpression }),
@@ -1299,19 +1002,17 @@ const deserializeAws_restJson1BatchDeleteRecipeVersionCommand = async (output, c
1299
1002
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1300
1003
  return deserializeAws_restJson1BatchDeleteRecipeVersionCommandError(output, context);
1301
1004
  }
1302
- const contents = {
1005
+ const contents = map({
1303
1006
  $metadata: deserializeMetadata(output),
1304
- Errors: undefined,
1305
- Name: undefined,
1306
- };
1007
+ });
1307
1008
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1308
- if (data.Errors !== undefined && data.Errors !== null) {
1009
+ if (data.Errors != null) {
1309
1010
  contents.Errors = deserializeAws_restJson1RecipeErrorList(data.Errors, context);
1310
1011
  }
1311
- if (data.Name !== undefined && data.Name !== null) {
1012
+ if (data.Name != null) {
1312
1013
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1313
1014
  }
1314
- return Promise.resolve(contents);
1015
+ return contents;
1315
1016
  };
1316
1017
  exports.deserializeAws_restJson1BatchDeleteRecipeVersionCommand = deserializeAws_restJson1BatchDeleteRecipeVersionCommand;
1317
1018
  const deserializeAws_restJson1BatchDeleteRecipeVersionCommandError = async (output, context) => {
@@ -1319,7 +1020,6 @@ const deserializeAws_restJson1BatchDeleteRecipeVersionCommandError = async (outp
1319
1020
  ...output,
1320
1021
  body: await parseBody(output.body, context),
1321
1022
  };
1322
- let response;
1323
1023
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1324
1024
  switch (errorCode) {
1325
1025
  case "ConflictException":
@@ -1333,29 +1033,26 @@ const deserializeAws_restJson1BatchDeleteRecipeVersionCommandError = async (outp
1333
1033
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1334
1034
  default:
1335
1035
  const parsedBody = parsedOutput.body;
1336
- const $metadata = deserializeMetadata(output);
1337
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1338
- response = new DataBrewServiceException_1.DataBrewServiceException({
1339
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1340
- $fault: "client",
1341
- $metadata,
1036
+ (0, smithy_client_1.throwDefaultError)({
1037
+ output,
1038
+ parsedBody,
1039
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1040
+ errorCode,
1342
1041
  });
1343
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1344
1042
  }
1345
1043
  };
1346
1044
  const deserializeAws_restJson1CreateDatasetCommand = async (output, context) => {
1347
1045
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1348
1046
  return deserializeAws_restJson1CreateDatasetCommandError(output, context);
1349
1047
  }
1350
- const contents = {
1048
+ const contents = map({
1351
1049
  $metadata: deserializeMetadata(output),
1352
- Name: undefined,
1353
- };
1050
+ });
1354
1051
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1355
- if (data.Name !== undefined && data.Name !== null) {
1052
+ if (data.Name != null) {
1356
1053
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1357
1054
  }
1358
- return Promise.resolve(contents);
1055
+ return contents;
1359
1056
  };
1360
1057
  exports.deserializeAws_restJson1CreateDatasetCommand = deserializeAws_restJson1CreateDatasetCommand;
1361
1058
  const deserializeAws_restJson1CreateDatasetCommandError = async (output, context) => {
@@ -1363,7 +1060,6 @@ const deserializeAws_restJson1CreateDatasetCommandError = async (output, context
1363
1060
  ...output,
1364
1061
  body: await parseBody(output.body, context),
1365
1062
  };
1366
- let response;
1367
1063
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1368
1064
  switch (errorCode) {
1369
1065
  case "AccessDeniedException":
@@ -1380,29 +1076,26 @@ const deserializeAws_restJson1CreateDatasetCommandError = async (output, context
1380
1076
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1381
1077
  default:
1382
1078
  const parsedBody = parsedOutput.body;
1383
- const $metadata = deserializeMetadata(output);
1384
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1385
- response = new DataBrewServiceException_1.DataBrewServiceException({
1386
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1387
- $fault: "client",
1388
- $metadata,
1079
+ (0, smithy_client_1.throwDefaultError)({
1080
+ output,
1081
+ parsedBody,
1082
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1083
+ errorCode,
1389
1084
  });
1390
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1391
1085
  }
1392
1086
  };
1393
1087
  const deserializeAws_restJson1CreateProfileJobCommand = async (output, context) => {
1394
1088
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1395
1089
  return deserializeAws_restJson1CreateProfileJobCommandError(output, context);
1396
1090
  }
1397
- const contents = {
1091
+ const contents = map({
1398
1092
  $metadata: deserializeMetadata(output),
1399
- Name: undefined,
1400
- };
1093
+ });
1401
1094
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1402
- if (data.Name !== undefined && data.Name !== null) {
1095
+ if (data.Name != null) {
1403
1096
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1404
1097
  }
1405
- return Promise.resolve(contents);
1098
+ return contents;
1406
1099
  };
1407
1100
  exports.deserializeAws_restJson1CreateProfileJobCommand = deserializeAws_restJson1CreateProfileJobCommand;
1408
1101
  const deserializeAws_restJson1CreateProfileJobCommandError = async (output, context) => {
@@ -1410,7 +1103,6 @@ const deserializeAws_restJson1CreateProfileJobCommandError = async (output, cont
1410
1103
  ...output,
1411
1104
  body: await parseBody(output.body, context),
1412
1105
  };
1413
- let response;
1414
1106
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1415
1107
  switch (errorCode) {
1416
1108
  case "AccessDeniedException":
@@ -1430,29 +1122,26 @@ const deserializeAws_restJson1CreateProfileJobCommandError = async (output, cont
1430
1122
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1431
1123
  default:
1432
1124
  const parsedBody = parsedOutput.body;
1433
- const $metadata = deserializeMetadata(output);
1434
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1435
- response = new DataBrewServiceException_1.DataBrewServiceException({
1436
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1437
- $fault: "client",
1438
- $metadata,
1125
+ (0, smithy_client_1.throwDefaultError)({
1126
+ output,
1127
+ parsedBody,
1128
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1129
+ errorCode,
1439
1130
  });
1440
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1441
1131
  }
1442
1132
  };
1443
1133
  const deserializeAws_restJson1CreateProjectCommand = async (output, context) => {
1444
1134
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1445
1135
  return deserializeAws_restJson1CreateProjectCommandError(output, context);
1446
1136
  }
1447
- const contents = {
1137
+ const contents = map({
1448
1138
  $metadata: deserializeMetadata(output),
1449
- Name: undefined,
1450
- };
1139
+ });
1451
1140
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1452
- if (data.Name !== undefined && data.Name !== null) {
1141
+ if (data.Name != null) {
1453
1142
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1454
1143
  }
1455
- return Promise.resolve(contents);
1144
+ return contents;
1456
1145
  };
1457
1146
  exports.deserializeAws_restJson1CreateProjectCommand = deserializeAws_restJson1CreateProjectCommand;
1458
1147
  const deserializeAws_restJson1CreateProjectCommandError = async (output, context) => {
@@ -1460,7 +1149,6 @@ const deserializeAws_restJson1CreateProjectCommandError = async (output, context
1460
1149
  ...output,
1461
1150
  body: await parseBody(output.body, context),
1462
1151
  };
1463
- let response;
1464
1152
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1465
1153
  switch (errorCode) {
1466
1154
  case "ConflictException":
@@ -1477,29 +1165,26 @@ const deserializeAws_restJson1CreateProjectCommandError = async (output, context
1477
1165
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1478
1166
  default:
1479
1167
  const parsedBody = parsedOutput.body;
1480
- const $metadata = deserializeMetadata(output);
1481
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1482
- response = new DataBrewServiceException_1.DataBrewServiceException({
1483
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1484
- $fault: "client",
1485
- $metadata,
1168
+ (0, smithy_client_1.throwDefaultError)({
1169
+ output,
1170
+ parsedBody,
1171
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1172
+ errorCode,
1486
1173
  });
1487
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1488
1174
  }
1489
1175
  };
1490
1176
  const deserializeAws_restJson1CreateRecipeCommand = async (output, context) => {
1491
1177
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1492
1178
  return deserializeAws_restJson1CreateRecipeCommandError(output, context);
1493
1179
  }
1494
- const contents = {
1180
+ const contents = map({
1495
1181
  $metadata: deserializeMetadata(output),
1496
- Name: undefined,
1497
- };
1182
+ });
1498
1183
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1499
- if (data.Name !== undefined && data.Name !== null) {
1184
+ if (data.Name != null) {
1500
1185
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1501
1186
  }
1502
- return Promise.resolve(contents);
1187
+ return contents;
1503
1188
  };
1504
1189
  exports.deserializeAws_restJson1CreateRecipeCommand = deserializeAws_restJson1CreateRecipeCommand;
1505
1190
  const deserializeAws_restJson1CreateRecipeCommandError = async (output, context) => {
@@ -1507,7 +1192,6 @@ const deserializeAws_restJson1CreateRecipeCommandError = async (output, context)
1507
1192
  ...output,
1508
1193
  body: await parseBody(output.body, context),
1509
1194
  };
1510
- let response;
1511
1195
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1512
1196
  switch (errorCode) {
1513
1197
  case "ConflictException":
@@ -1521,29 +1205,26 @@ const deserializeAws_restJson1CreateRecipeCommandError = async (output, context)
1521
1205
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1522
1206
  default:
1523
1207
  const parsedBody = parsedOutput.body;
1524
- const $metadata = deserializeMetadata(output);
1525
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1526
- response = new DataBrewServiceException_1.DataBrewServiceException({
1527
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1528
- $fault: "client",
1529
- $metadata,
1208
+ (0, smithy_client_1.throwDefaultError)({
1209
+ output,
1210
+ parsedBody,
1211
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1212
+ errorCode,
1530
1213
  });
1531
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1532
1214
  }
1533
1215
  };
1534
1216
  const deserializeAws_restJson1CreateRecipeJobCommand = async (output, context) => {
1535
1217
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1536
1218
  return deserializeAws_restJson1CreateRecipeJobCommandError(output, context);
1537
1219
  }
1538
- const contents = {
1220
+ const contents = map({
1539
1221
  $metadata: deserializeMetadata(output),
1540
- Name: undefined,
1541
- };
1222
+ });
1542
1223
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1543
- if (data.Name !== undefined && data.Name !== null) {
1224
+ if (data.Name != null) {
1544
1225
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1545
1226
  }
1546
- return Promise.resolve(contents);
1227
+ return contents;
1547
1228
  };
1548
1229
  exports.deserializeAws_restJson1CreateRecipeJobCommand = deserializeAws_restJson1CreateRecipeJobCommand;
1549
1230
  const deserializeAws_restJson1CreateRecipeJobCommandError = async (output, context) => {
@@ -1551,7 +1232,6 @@ const deserializeAws_restJson1CreateRecipeJobCommandError = async (output, conte
1551
1232
  ...output,
1552
1233
  body: await parseBody(output.body, context),
1553
1234
  };
1554
- let response;
1555
1235
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1556
1236
  switch (errorCode) {
1557
1237
  case "AccessDeniedException":
@@ -1571,29 +1251,26 @@ const deserializeAws_restJson1CreateRecipeJobCommandError = async (output, conte
1571
1251
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1572
1252
  default:
1573
1253
  const parsedBody = parsedOutput.body;
1574
- const $metadata = deserializeMetadata(output);
1575
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1576
- response = new DataBrewServiceException_1.DataBrewServiceException({
1577
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1578
- $fault: "client",
1579
- $metadata,
1254
+ (0, smithy_client_1.throwDefaultError)({
1255
+ output,
1256
+ parsedBody,
1257
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1258
+ errorCode,
1580
1259
  });
1581
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1582
1260
  }
1583
1261
  };
1584
1262
  const deserializeAws_restJson1CreateRulesetCommand = async (output, context) => {
1585
1263
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1586
1264
  return deserializeAws_restJson1CreateRulesetCommandError(output, context);
1587
1265
  }
1588
- const contents = {
1266
+ const contents = map({
1589
1267
  $metadata: deserializeMetadata(output),
1590
- Name: undefined,
1591
- };
1268
+ });
1592
1269
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1593
- if (data.Name !== undefined && data.Name !== null) {
1270
+ if (data.Name != null) {
1594
1271
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1595
1272
  }
1596
- return Promise.resolve(contents);
1273
+ return contents;
1597
1274
  };
1598
1275
  exports.deserializeAws_restJson1CreateRulesetCommand = deserializeAws_restJson1CreateRulesetCommand;
1599
1276
  const deserializeAws_restJson1CreateRulesetCommandError = async (output, context) => {
@@ -1601,7 +1278,6 @@ const deserializeAws_restJson1CreateRulesetCommandError = async (output, context
1601
1278
  ...output,
1602
1279
  body: await parseBody(output.body, context),
1603
1280
  };
1604
- let response;
1605
1281
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1606
1282
  switch (errorCode) {
1607
1283
  case "ConflictException":
@@ -1615,29 +1291,26 @@ const deserializeAws_restJson1CreateRulesetCommandError = async (output, context
1615
1291
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1616
1292
  default:
1617
1293
  const parsedBody = parsedOutput.body;
1618
- const $metadata = deserializeMetadata(output);
1619
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1620
- response = new DataBrewServiceException_1.DataBrewServiceException({
1621
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1622
- $fault: "client",
1623
- $metadata,
1294
+ (0, smithy_client_1.throwDefaultError)({
1295
+ output,
1296
+ parsedBody,
1297
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1298
+ errorCode,
1624
1299
  });
1625
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1626
1300
  }
1627
1301
  };
1628
1302
  const deserializeAws_restJson1CreateScheduleCommand = async (output, context) => {
1629
1303
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1630
1304
  return deserializeAws_restJson1CreateScheduleCommandError(output, context);
1631
1305
  }
1632
- const contents = {
1306
+ const contents = map({
1633
1307
  $metadata: deserializeMetadata(output),
1634
- Name: undefined,
1635
- };
1308
+ });
1636
1309
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1637
- if (data.Name !== undefined && data.Name !== null) {
1310
+ if (data.Name != null) {
1638
1311
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1639
1312
  }
1640
- return Promise.resolve(contents);
1313
+ return contents;
1641
1314
  };
1642
1315
  exports.deserializeAws_restJson1CreateScheduleCommand = deserializeAws_restJson1CreateScheduleCommand;
1643
1316
  const deserializeAws_restJson1CreateScheduleCommandError = async (output, context) => {
@@ -1645,7 +1318,6 @@ const deserializeAws_restJson1CreateScheduleCommandError = async (output, contex
1645
1318
  ...output,
1646
1319
  body: await parseBody(output.body, context),
1647
1320
  };
1648
- let response;
1649
1321
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1650
1322
  switch (errorCode) {
1651
1323
  case "ConflictException":
@@ -1659,29 +1331,26 @@ const deserializeAws_restJson1CreateScheduleCommandError = async (output, contex
1659
1331
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1660
1332
  default:
1661
1333
  const parsedBody = parsedOutput.body;
1662
- const $metadata = deserializeMetadata(output);
1663
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1664
- response = new DataBrewServiceException_1.DataBrewServiceException({
1665
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1666
- $fault: "client",
1667
- $metadata,
1334
+ (0, smithy_client_1.throwDefaultError)({
1335
+ output,
1336
+ parsedBody,
1337
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1338
+ errorCode,
1668
1339
  });
1669
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1670
1340
  }
1671
1341
  };
1672
1342
  const deserializeAws_restJson1DeleteDatasetCommand = async (output, context) => {
1673
1343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1674
1344
  return deserializeAws_restJson1DeleteDatasetCommandError(output, context);
1675
1345
  }
1676
- const contents = {
1346
+ const contents = map({
1677
1347
  $metadata: deserializeMetadata(output),
1678
- Name: undefined,
1679
- };
1348
+ });
1680
1349
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1681
- if (data.Name !== undefined && data.Name !== null) {
1350
+ if (data.Name != null) {
1682
1351
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1683
1352
  }
1684
- return Promise.resolve(contents);
1353
+ return contents;
1685
1354
  };
1686
1355
  exports.deserializeAws_restJson1DeleteDatasetCommand = deserializeAws_restJson1DeleteDatasetCommand;
1687
1356
  const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context) => {
@@ -1689,7 +1358,6 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context
1689
1358
  ...output,
1690
1359
  body: await parseBody(output.body, context),
1691
1360
  };
1692
- let response;
1693
1361
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1694
1362
  switch (errorCode) {
1695
1363
  case "ConflictException":
@@ -1703,29 +1371,26 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context
1703
1371
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1704
1372
  default:
1705
1373
  const parsedBody = parsedOutput.body;
1706
- const $metadata = deserializeMetadata(output);
1707
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1708
- response = new DataBrewServiceException_1.DataBrewServiceException({
1709
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1710
- $fault: "client",
1711
- $metadata,
1374
+ (0, smithy_client_1.throwDefaultError)({
1375
+ output,
1376
+ parsedBody,
1377
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1378
+ errorCode,
1712
1379
  });
1713
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1714
1380
  }
1715
1381
  };
1716
1382
  const deserializeAws_restJson1DeleteJobCommand = async (output, context) => {
1717
1383
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1718
1384
  return deserializeAws_restJson1DeleteJobCommandError(output, context);
1719
1385
  }
1720
- const contents = {
1386
+ const contents = map({
1721
1387
  $metadata: deserializeMetadata(output),
1722
- Name: undefined,
1723
- };
1388
+ });
1724
1389
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1725
- if (data.Name !== undefined && data.Name !== null) {
1390
+ if (data.Name != null) {
1726
1391
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1727
1392
  }
1728
- return Promise.resolve(contents);
1393
+ return contents;
1729
1394
  };
1730
1395
  exports.deserializeAws_restJson1DeleteJobCommand = deserializeAws_restJson1DeleteJobCommand;
1731
1396
  const deserializeAws_restJson1DeleteJobCommandError = async (output, context) => {
@@ -1733,7 +1398,6 @@ const deserializeAws_restJson1DeleteJobCommandError = async (output, context) =>
1733
1398
  ...output,
1734
1399
  body: await parseBody(output.body, context),
1735
1400
  };
1736
- let response;
1737
1401
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1738
1402
  switch (errorCode) {
1739
1403
  case "ConflictException":
@@ -1747,29 +1411,26 @@ const deserializeAws_restJson1DeleteJobCommandError = async (output, context) =>
1747
1411
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1748
1412
  default:
1749
1413
  const parsedBody = parsedOutput.body;
1750
- const $metadata = deserializeMetadata(output);
1751
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1752
- response = new DataBrewServiceException_1.DataBrewServiceException({
1753
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1754
- $fault: "client",
1755
- $metadata,
1414
+ (0, smithy_client_1.throwDefaultError)({
1415
+ output,
1416
+ parsedBody,
1417
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1418
+ errorCode,
1756
1419
  });
1757
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1758
1420
  }
1759
1421
  };
1760
1422
  const deserializeAws_restJson1DeleteProjectCommand = async (output, context) => {
1761
1423
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1762
1424
  return deserializeAws_restJson1DeleteProjectCommandError(output, context);
1763
1425
  }
1764
- const contents = {
1426
+ const contents = map({
1765
1427
  $metadata: deserializeMetadata(output),
1766
- Name: undefined,
1767
- };
1428
+ });
1768
1429
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1769
- if (data.Name !== undefined && data.Name !== null) {
1430
+ if (data.Name != null) {
1770
1431
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1771
1432
  }
1772
- return Promise.resolve(contents);
1433
+ return contents;
1773
1434
  };
1774
1435
  exports.deserializeAws_restJson1DeleteProjectCommand = deserializeAws_restJson1DeleteProjectCommand;
1775
1436
  const deserializeAws_restJson1DeleteProjectCommandError = async (output, context) => {
@@ -1777,7 +1438,6 @@ const deserializeAws_restJson1DeleteProjectCommandError = async (output, context
1777
1438
  ...output,
1778
1439
  body: await parseBody(output.body, context),
1779
1440
  };
1780
- let response;
1781
1441
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1782
1442
  switch (errorCode) {
1783
1443
  case "ConflictException":
@@ -1791,33 +1451,29 @@ const deserializeAws_restJson1DeleteProjectCommandError = async (output, context
1791
1451
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1792
1452
  default:
1793
1453
  const parsedBody = parsedOutput.body;
1794
- const $metadata = deserializeMetadata(output);
1795
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1796
- response = new DataBrewServiceException_1.DataBrewServiceException({
1797
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1798
- $fault: "client",
1799
- $metadata,
1454
+ (0, smithy_client_1.throwDefaultError)({
1455
+ output,
1456
+ parsedBody,
1457
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1458
+ errorCode,
1800
1459
  });
1801
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1802
1460
  }
1803
1461
  };
1804
1462
  const deserializeAws_restJson1DeleteRecipeVersionCommand = async (output, context) => {
1805
1463
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1806
1464
  return deserializeAws_restJson1DeleteRecipeVersionCommandError(output, context);
1807
1465
  }
1808
- const contents = {
1466
+ const contents = map({
1809
1467
  $metadata: deserializeMetadata(output),
1810
- Name: undefined,
1811
- RecipeVersion: undefined,
1812
- };
1468
+ });
1813
1469
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1814
- if (data.Name !== undefined && data.Name !== null) {
1470
+ if (data.Name != null) {
1815
1471
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1816
1472
  }
1817
- if (data.RecipeVersion !== undefined && data.RecipeVersion !== null) {
1473
+ if (data.RecipeVersion != null) {
1818
1474
  contents.RecipeVersion = (0, smithy_client_1.expectString)(data.RecipeVersion);
1819
1475
  }
1820
- return Promise.resolve(contents);
1476
+ return contents;
1821
1477
  };
1822
1478
  exports.deserializeAws_restJson1DeleteRecipeVersionCommand = deserializeAws_restJson1DeleteRecipeVersionCommand;
1823
1479
  const deserializeAws_restJson1DeleteRecipeVersionCommandError = async (output, context) => {
@@ -1825,7 +1481,6 @@ const deserializeAws_restJson1DeleteRecipeVersionCommandError = async (output, c
1825
1481
  ...output,
1826
1482
  body: await parseBody(output.body, context),
1827
1483
  };
1828
- let response;
1829
1484
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1830
1485
  switch (errorCode) {
1831
1486
  case "ConflictException":
@@ -1839,29 +1494,26 @@ const deserializeAws_restJson1DeleteRecipeVersionCommandError = async (output, c
1839
1494
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1840
1495
  default:
1841
1496
  const parsedBody = parsedOutput.body;
1842
- const $metadata = deserializeMetadata(output);
1843
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1844
- response = new DataBrewServiceException_1.DataBrewServiceException({
1845
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1846
- $fault: "client",
1847
- $metadata,
1497
+ (0, smithy_client_1.throwDefaultError)({
1498
+ output,
1499
+ parsedBody,
1500
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1501
+ errorCode,
1848
1502
  });
1849
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1850
1503
  }
1851
1504
  };
1852
1505
  const deserializeAws_restJson1DeleteRulesetCommand = async (output, context) => {
1853
1506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1854
1507
  return deserializeAws_restJson1DeleteRulesetCommandError(output, context);
1855
1508
  }
1856
- const contents = {
1509
+ const contents = map({
1857
1510
  $metadata: deserializeMetadata(output),
1858
- Name: undefined,
1859
- };
1511
+ });
1860
1512
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1861
- if (data.Name !== undefined && data.Name !== null) {
1513
+ if (data.Name != null) {
1862
1514
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1863
1515
  }
1864
- return Promise.resolve(contents);
1516
+ return contents;
1865
1517
  };
1866
1518
  exports.deserializeAws_restJson1DeleteRulesetCommand = deserializeAws_restJson1DeleteRulesetCommand;
1867
1519
  const deserializeAws_restJson1DeleteRulesetCommandError = async (output, context) => {
@@ -1869,7 +1521,6 @@ const deserializeAws_restJson1DeleteRulesetCommandError = async (output, context
1869
1521
  ...output,
1870
1522
  body: await parseBody(output.body, context),
1871
1523
  };
1872
- let response;
1873
1524
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1874
1525
  switch (errorCode) {
1875
1526
  case "ConflictException":
@@ -1883,29 +1534,26 @@ const deserializeAws_restJson1DeleteRulesetCommandError = async (output, context
1883
1534
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1884
1535
  default:
1885
1536
  const parsedBody = parsedOutput.body;
1886
- const $metadata = deserializeMetadata(output);
1887
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1888
- response = new DataBrewServiceException_1.DataBrewServiceException({
1889
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1890
- $fault: "client",
1891
- $metadata,
1537
+ (0, smithy_client_1.throwDefaultError)({
1538
+ output,
1539
+ parsedBody,
1540
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1541
+ errorCode,
1892
1542
  });
1893
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1894
1543
  }
1895
1544
  };
1896
1545
  const deserializeAws_restJson1DeleteScheduleCommand = async (output, context) => {
1897
1546
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1898
1547
  return deserializeAws_restJson1DeleteScheduleCommandError(output, context);
1899
1548
  }
1900
- const contents = {
1549
+ const contents = map({
1901
1550
  $metadata: deserializeMetadata(output),
1902
- Name: undefined,
1903
- };
1551
+ });
1904
1552
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1905
- if (data.Name !== undefined && data.Name !== null) {
1553
+ if (data.Name != null) {
1906
1554
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1907
1555
  }
1908
- return Promise.resolve(contents);
1556
+ return contents;
1909
1557
  };
1910
1558
  exports.deserializeAws_restJson1DeleteScheduleCommand = deserializeAws_restJson1DeleteScheduleCommand;
1911
1559
  const deserializeAws_restJson1DeleteScheduleCommandError = async (output, context) => {
@@ -1913,7 +1561,6 @@ const deserializeAws_restJson1DeleteScheduleCommandError = async (output, contex
1913
1561
  ...output,
1914
1562
  body: await parseBody(output.body, context),
1915
1563
  };
1916
- let response;
1917
1564
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1918
1565
  switch (errorCode) {
1919
1566
  case "ResourceNotFoundException":
@@ -1924,73 +1571,59 @@ const deserializeAws_restJson1DeleteScheduleCommandError = async (output, contex
1924
1571
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1925
1572
  default:
1926
1573
  const parsedBody = parsedOutput.body;
1927
- const $metadata = deserializeMetadata(output);
1928
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1929
- response = new DataBrewServiceException_1.DataBrewServiceException({
1930
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1931
- $fault: "client",
1932
- $metadata,
1574
+ (0, smithy_client_1.throwDefaultError)({
1575
+ output,
1576
+ parsedBody,
1577
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1578
+ errorCode,
1933
1579
  });
1934
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1935
1580
  }
1936
1581
  };
1937
1582
  const deserializeAws_restJson1DescribeDatasetCommand = async (output, context) => {
1938
1583
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1939
1584
  return deserializeAws_restJson1DescribeDatasetCommandError(output, context);
1940
1585
  }
1941
- const contents = {
1586
+ const contents = map({
1942
1587
  $metadata: deserializeMetadata(output),
1943
- CreateDate: undefined,
1944
- CreatedBy: undefined,
1945
- Format: undefined,
1946
- FormatOptions: undefined,
1947
- Input: undefined,
1948
- LastModifiedBy: undefined,
1949
- LastModifiedDate: undefined,
1950
- Name: undefined,
1951
- PathOptions: undefined,
1952
- ResourceArn: undefined,
1953
- Source: undefined,
1954
- Tags: undefined,
1955
- };
1588
+ });
1956
1589
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1957
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
1590
+ if (data.CreateDate != null) {
1958
1591
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
1959
1592
  }
1960
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
1593
+ if (data.CreatedBy != null) {
1961
1594
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
1962
1595
  }
1963
- if (data.Format !== undefined && data.Format !== null) {
1596
+ if (data.Format != null) {
1964
1597
  contents.Format = (0, smithy_client_1.expectString)(data.Format);
1965
1598
  }
1966
- if (data.FormatOptions !== undefined && data.FormatOptions !== null) {
1599
+ if (data.FormatOptions != null) {
1967
1600
  contents.FormatOptions = deserializeAws_restJson1FormatOptions(data.FormatOptions, context);
1968
1601
  }
1969
- if (data.Input !== undefined && data.Input !== null) {
1602
+ if (data.Input != null) {
1970
1603
  contents.Input = deserializeAws_restJson1Input(data.Input, context);
1971
1604
  }
1972
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
1605
+ if (data.LastModifiedBy != null) {
1973
1606
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
1974
1607
  }
1975
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
1608
+ if (data.LastModifiedDate != null) {
1976
1609
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
1977
1610
  }
1978
- if (data.Name !== undefined && data.Name !== null) {
1611
+ if (data.Name != null) {
1979
1612
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1980
1613
  }
1981
- if (data.PathOptions !== undefined && data.PathOptions !== null) {
1614
+ if (data.PathOptions != null) {
1982
1615
  contents.PathOptions = deserializeAws_restJson1PathOptions(data.PathOptions, context);
1983
1616
  }
1984
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
1617
+ if (data.ResourceArn != null) {
1985
1618
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
1986
1619
  }
1987
- if (data.Source !== undefined && data.Source !== null) {
1620
+ if (data.Source != null) {
1988
1621
  contents.Source = (0, smithy_client_1.expectString)(data.Source);
1989
1622
  }
1990
- if (data.Tags !== undefined && data.Tags !== null) {
1623
+ if (data.Tags != null) {
1991
1624
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1992
1625
  }
1993
- return Promise.resolve(contents);
1626
+ return contents;
1994
1627
  };
1995
1628
  exports.deserializeAws_restJson1DescribeDatasetCommand = deserializeAws_restJson1DescribeDatasetCommand;
1996
1629
  const deserializeAws_restJson1DescribeDatasetCommandError = async (output, context) => {
@@ -1998,7 +1631,6 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async (output, conte
1998
1631
  ...output,
1999
1632
  body: await parseBody(output.body, context),
2000
1633
  };
2001
- let response;
2002
1634
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2003
1635
  switch (errorCode) {
2004
1636
  case "ResourceNotFoundException":
@@ -2009,121 +1641,95 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async (output, conte
2009
1641
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2010
1642
  default:
2011
1643
  const parsedBody = parsedOutput.body;
2012
- const $metadata = deserializeMetadata(output);
2013
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2014
- response = new DataBrewServiceException_1.DataBrewServiceException({
2015
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2016
- $fault: "client",
2017
- $metadata,
1644
+ (0, smithy_client_1.throwDefaultError)({
1645
+ output,
1646
+ parsedBody,
1647
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1648
+ errorCode,
2018
1649
  });
2019
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2020
1650
  }
2021
1651
  };
2022
1652
  const deserializeAws_restJson1DescribeJobCommand = async (output, context) => {
2023
1653
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2024
1654
  return deserializeAws_restJson1DescribeJobCommandError(output, context);
2025
1655
  }
2026
- const contents = {
1656
+ const contents = map({
2027
1657
  $metadata: deserializeMetadata(output),
2028
- CreateDate: undefined,
2029
- CreatedBy: undefined,
2030
- DataCatalogOutputs: undefined,
2031
- DatabaseOutputs: undefined,
2032
- DatasetName: undefined,
2033
- EncryptionKeyArn: undefined,
2034
- EncryptionMode: undefined,
2035
- JobSample: undefined,
2036
- LastModifiedBy: undefined,
2037
- LastModifiedDate: undefined,
2038
- LogSubscription: undefined,
2039
- MaxCapacity: undefined,
2040
- MaxRetries: undefined,
2041
- Name: undefined,
2042
- Outputs: undefined,
2043
- ProfileConfiguration: undefined,
2044
- ProjectName: undefined,
2045
- RecipeReference: undefined,
2046
- ResourceArn: undefined,
2047
- RoleArn: undefined,
2048
- Tags: undefined,
2049
- Timeout: undefined,
2050
- Type: undefined,
2051
- ValidationConfigurations: undefined,
2052
- };
1658
+ });
2053
1659
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2054
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
1660
+ if (data.CreateDate != null) {
2055
1661
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
2056
1662
  }
2057
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
1663
+ if (data.CreatedBy != null) {
2058
1664
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
2059
1665
  }
2060
- if (data.DataCatalogOutputs !== undefined && data.DataCatalogOutputs !== null) {
1666
+ if (data.DataCatalogOutputs != null) {
2061
1667
  contents.DataCatalogOutputs = deserializeAws_restJson1DataCatalogOutputList(data.DataCatalogOutputs, context);
2062
1668
  }
2063
- if (data.DatabaseOutputs !== undefined && data.DatabaseOutputs !== null) {
1669
+ if (data.DatabaseOutputs != null) {
2064
1670
  contents.DatabaseOutputs = deserializeAws_restJson1DatabaseOutputList(data.DatabaseOutputs, context);
2065
1671
  }
2066
- if (data.DatasetName !== undefined && data.DatasetName !== null) {
1672
+ if (data.DatasetName != null) {
2067
1673
  contents.DatasetName = (0, smithy_client_1.expectString)(data.DatasetName);
2068
1674
  }
2069
- if (data.EncryptionKeyArn !== undefined && data.EncryptionKeyArn !== null) {
1675
+ if (data.EncryptionKeyArn != null) {
2070
1676
  contents.EncryptionKeyArn = (0, smithy_client_1.expectString)(data.EncryptionKeyArn);
2071
1677
  }
2072
- if (data.EncryptionMode !== undefined && data.EncryptionMode !== null) {
1678
+ if (data.EncryptionMode != null) {
2073
1679
  contents.EncryptionMode = (0, smithy_client_1.expectString)(data.EncryptionMode);
2074
1680
  }
2075
- if (data.JobSample !== undefined && data.JobSample !== null) {
1681
+ if (data.JobSample != null) {
2076
1682
  contents.JobSample = deserializeAws_restJson1JobSample(data.JobSample, context);
2077
1683
  }
2078
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
1684
+ if (data.LastModifiedBy != null) {
2079
1685
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
2080
1686
  }
2081
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
1687
+ if (data.LastModifiedDate != null) {
2082
1688
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
2083
1689
  }
2084
- if (data.LogSubscription !== undefined && data.LogSubscription !== null) {
1690
+ if (data.LogSubscription != null) {
2085
1691
  contents.LogSubscription = (0, smithy_client_1.expectString)(data.LogSubscription);
2086
1692
  }
2087
- if (data.MaxCapacity !== undefined && data.MaxCapacity !== null) {
1693
+ if (data.MaxCapacity != null) {
2088
1694
  contents.MaxCapacity = (0, smithy_client_1.expectInt32)(data.MaxCapacity);
2089
1695
  }
2090
- if (data.MaxRetries !== undefined && data.MaxRetries !== null) {
1696
+ if (data.MaxRetries != null) {
2091
1697
  contents.MaxRetries = (0, smithy_client_1.expectInt32)(data.MaxRetries);
2092
1698
  }
2093
- if (data.Name !== undefined && data.Name !== null) {
1699
+ if (data.Name != null) {
2094
1700
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2095
1701
  }
2096
- if (data.Outputs !== undefined && data.Outputs !== null) {
1702
+ if (data.Outputs != null) {
2097
1703
  contents.Outputs = deserializeAws_restJson1OutputList(data.Outputs, context);
2098
1704
  }
2099
- if (data.ProfileConfiguration !== undefined && data.ProfileConfiguration !== null) {
1705
+ if (data.ProfileConfiguration != null) {
2100
1706
  contents.ProfileConfiguration = deserializeAws_restJson1ProfileConfiguration(data.ProfileConfiguration, context);
2101
1707
  }
2102
- if (data.ProjectName !== undefined && data.ProjectName !== null) {
1708
+ if (data.ProjectName != null) {
2103
1709
  contents.ProjectName = (0, smithy_client_1.expectString)(data.ProjectName);
2104
1710
  }
2105
- if (data.RecipeReference !== undefined && data.RecipeReference !== null) {
1711
+ if (data.RecipeReference != null) {
2106
1712
  contents.RecipeReference = deserializeAws_restJson1RecipeReference(data.RecipeReference, context);
2107
1713
  }
2108
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
1714
+ if (data.ResourceArn != null) {
2109
1715
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2110
1716
  }
2111
- if (data.RoleArn !== undefined && data.RoleArn !== null) {
1717
+ if (data.RoleArn != null) {
2112
1718
  contents.RoleArn = (0, smithy_client_1.expectString)(data.RoleArn);
2113
1719
  }
2114
- if (data.Tags !== undefined && data.Tags !== null) {
1720
+ if (data.Tags != null) {
2115
1721
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2116
1722
  }
2117
- if (data.Timeout !== undefined && data.Timeout !== null) {
1723
+ if (data.Timeout != null) {
2118
1724
  contents.Timeout = (0, smithy_client_1.expectInt32)(data.Timeout);
2119
1725
  }
2120
- if (data.Type !== undefined && data.Type !== null) {
1726
+ if (data.Type != null) {
2121
1727
  contents.Type = (0, smithy_client_1.expectString)(data.Type);
2122
1728
  }
2123
- if (data.ValidationConfigurations !== undefined && data.ValidationConfigurations !== null) {
1729
+ if (data.ValidationConfigurations != null) {
2124
1730
  contents.ValidationConfigurations = deserializeAws_restJson1ValidationConfigurationList(data.ValidationConfigurations, context);
2125
1731
  }
2126
- return Promise.resolve(contents);
1732
+ return contents;
2127
1733
  };
2128
1734
  exports.deserializeAws_restJson1DescribeJobCommand = deserializeAws_restJson1DescribeJobCommand;
2129
1735
  const deserializeAws_restJson1DescribeJobCommandError = async (output, context) => {
@@ -2131,7 +1737,6 @@ const deserializeAws_restJson1DescribeJobCommandError = async (output, context)
2131
1737
  ...output,
2132
1738
  body: await parseBody(output.body, context),
2133
1739
  };
2134
- let response;
2135
1740
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2136
1741
  switch (errorCode) {
2137
1742
  case "ResourceNotFoundException":
@@ -2142,101 +1747,80 @@ const deserializeAws_restJson1DescribeJobCommandError = async (output, context)
2142
1747
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2143
1748
  default:
2144
1749
  const parsedBody = parsedOutput.body;
2145
- const $metadata = deserializeMetadata(output);
2146
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2147
- response = new DataBrewServiceException_1.DataBrewServiceException({
2148
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2149
- $fault: "client",
2150
- $metadata,
1750
+ (0, smithy_client_1.throwDefaultError)({
1751
+ output,
1752
+ parsedBody,
1753
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1754
+ errorCode,
2151
1755
  });
2152
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2153
1756
  }
2154
1757
  };
2155
1758
  const deserializeAws_restJson1DescribeJobRunCommand = async (output, context) => {
2156
1759
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2157
1760
  return deserializeAws_restJson1DescribeJobRunCommandError(output, context);
2158
1761
  }
2159
- const contents = {
1762
+ const contents = map({
2160
1763
  $metadata: deserializeMetadata(output),
2161
- Attempt: undefined,
2162
- CompletedOn: undefined,
2163
- DataCatalogOutputs: undefined,
2164
- DatabaseOutputs: undefined,
2165
- DatasetName: undefined,
2166
- ErrorMessage: undefined,
2167
- ExecutionTime: undefined,
2168
- JobName: undefined,
2169
- JobSample: undefined,
2170
- LogGroupName: undefined,
2171
- LogSubscription: undefined,
2172
- Outputs: undefined,
2173
- ProfileConfiguration: undefined,
2174
- RecipeReference: undefined,
2175
- RunId: undefined,
2176
- StartedBy: undefined,
2177
- StartedOn: undefined,
2178
- State: undefined,
2179
- ValidationConfigurations: undefined,
2180
- };
1764
+ });
2181
1765
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2182
- if (data.Attempt !== undefined && data.Attempt !== null) {
1766
+ if (data.Attempt != null) {
2183
1767
  contents.Attempt = (0, smithy_client_1.expectInt32)(data.Attempt);
2184
1768
  }
2185
- if (data.CompletedOn !== undefined && data.CompletedOn !== null) {
1769
+ if (data.CompletedOn != null) {
2186
1770
  contents.CompletedOn = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CompletedOn)));
2187
1771
  }
2188
- if (data.DataCatalogOutputs !== undefined && data.DataCatalogOutputs !== null) {
1772
+ if (data.DataCatalogOutputs != null) {
2189
1773
  contents.DataCatalogOutputs = deserializeAws_restJson1DataCatalogOutputList(data.DataCatalogOutputs, context);
2190
1774
  }
2191
- if (data.DatabaseOutputs !== undefined && data.DatabaseOutputs !== null) {
1775
+ if (data.DatabaseOutputs != null) {
2192
1776
  contents.DatabaseOutputs = deserializeAws_restJson1DatabaseOutputList(data.DatabaseOutputs, context);
2193
1777
  }
2194
- if (data.DatasetName !== undefined && data.DatasetName !== null) {
1778
+ if (data.DatasetName != null) {
2195
1779
  contents.DatasetName = (0, smithy_client_1.expectString)(data.DatasetName);
2196
1780
  }
2197
- if (data.ErrorMessage !== undefined && data.ErrorMessage !== null) {
1781
+ if (data.ErrorMessage != null) {
2198
1782
  contents.ErrorMessage = (0, smithy_client_1.expectString)(data.ErrorMessage);
2199
1783
  }
2200
- if (data.ExecutionTime !== undefined && data.ExecutionTime !== null) {
1784
+ if (data.ExecutionTime != null) {
2201
1785
  contents.ExecutionTime = (0, smithy_client_1.expectInt32)(data.ExecutionTime);
2202
1786
  }
2203
- if (data.JobName !== undefined && data.JobName !== null) {
1787
+ if (data.JobName != null) {
2204
1788
  contents.JobName = (0, smithy_client_1.expectString)(data.JobName);
2205
1789
  }
2206
- if (data.JobSample !== undefined && data.JobSample !== null) {
1790
+ if (data.JobSample != null) {
2207
1791
  contents.JobSample = deserializeAws_restJson1JobSample(data.JobSample, context);
2208
1792
  }
2209
- if (data.LogGroupName !== undefined && data.LogGroupName !== null) {
1793
+ if (data.LogGroupName != null) {
2210
1794
  contents.LogGroupName = (0, smithy_client_1.expectString)(data.LogGroupName);
2211
1795
  }
2212
- if (data.LogSubscription !== undefined && data.LogSubscription !== null) {
1796
+ if (data.LogSubscription != null) {
2213
1797
  contents.LogSubscription = (0, smithy_client_1.expectString)(data.LogSubscription);
2214
1798
  }
2215
- if (data.Outputs !== undefined && data.Outputs !== null) {
1799
+ if (data.Outputs != null) {
2216
1800
  contents.Outputs = deserializeAws_restJson1OutputList(data.Outputs, context);
2217
1801
  }
2218
- if (data.ProfileConfiguration !== undefined && data.ProfileConfiguration !== null) {
1802
+ if (data.ProfileConfiguration != null) {
2219
1803
  contents.ProfileConfiguration = deserializeAws_restJson1ProfileConfiguration(data.ProfileConfiguration, context);
2220
1804
  }
2221
- if (data.RecipeReference !== undefined && data.RecipeReference !== null) {
1805
+ if (data.RecipeReference != null) {
2222
1806
  contents.RecipeReference = deserializeAws_restJson1RecipeReference(data.RecipeReference, context);
2223
1807
  }
2224
- if (data.RunId !== undefined && data.RunId !== null) {
1808
+ if (data.RunId != null) {
2225
1809
  contents.RunId = (0, smithy_client_1.expectString)(data.RunId);
2226
1810
  }
2227
- if (data.StartedBy !== undefined && data.StartedBy !== null) {
1811
+ if (data.StartedBy != null) {
2228
1812
  contents.StartedBy = (0, smithy_client_1.expectString)(data.StartedBy);
2229
1813
  }
2230
- if (data.StartedOn !== undefined && data.StartedOn !== null) {
1814
+ if (data.StartedOn != null) {
2231
1815
  contents.StartedOn = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.StartedOn)));
2232
1816
  }
2233
- if (data.State !== undefined && data.State !== null) {
1817
+ if (data.State != null) {
2234
1818
  contents.State = (0, smithy_client_1.expectString)(data.State);
2235
1819
  }
2236
- if (data.ValidationConfigurations !== undefined && data.ValidationConfigurations !== null) {
1820
+ if (data.ValidationConfigurations != null) {
2237
1821
  contents.ValidationConfigurations = deserializeAws_restJson1ValidationConfigurationList(data.ValidationConfigurations, context);
2238
1822
  }
2239
- return Promise.resolve(contents);
1823
+ return contents;
2240
1824
  };
2241
1825
  exports.deserializeAws_restJson1DescribeJobRunCommand = deserializeAws_restJson1DescribeJobRunCommand;
2242
1826
  const deserializeAws_restJson1DescribeJobRunCommandError = async (output, context) => {
@@ -2244,7 +1828,6 @@ const deserializeAws_restJson1DescribeJobRunCommandError = async (output, contex
2244
1828
  ...output,
2245
1829
  body: await parseBody(output.body, context),
2246
1830
  };
2247
- let response;
2248
1831
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2249
1832
  switch (errorCode) {
2250
1833
  case "ResourceNotFoundException":
@@ -2255,81 +1838,65 @@ const deserializeAws_restJson1DescribeJobRunCommandError = async (output, contex
2255
1838
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2256
1839
  default:
2257
1840
  const parsedBody = parsedOutput.body;
2258
- const $metadata = deserializeMetadata(output);
2259
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2260
- response = new DataBrewServiceException_1.DataBrewServiceException({
2261
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2262
- $fault: "client",
2263
- $metadata,
1841
+ (0, smithy_client_1.throwDefaultError)({
1842
+ output,
1843
+ parsedBody,
1844
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1845
+ errorCode,
2264
1846
  });
2265
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2266
1847
  }
2267
1848
  };
2268
1849
  const deserializeAws_restJson1DescribeProjectCommand = async (output, context) => {
2269
1850
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2270
1851
  return deserializeAws_restJson1DescribeProjectCommandError(output, context);
2271
1852
  }
2272
- const contents = {
1853
+ const contents = map({
2273
1854
  $metadata: deserializeMetadata(output),
2274
- CreateDate: undefined,
2275
- CreatedBy: undefined,
2276
- DatasetName: undefined,
2277
- LastModifiedBy: undefined,
2278
- LastModifiedDate: undefined,
2279
- Name: undefined,
2280
- OpenDate: undefined,
2281
- OpenedBy: undefined,
2282
- RecipeName: undefined,
2283
- ResourceArn: undefined,
2284
- RoleArn: undefined,
2285
- Sample: undefined,
2286
- SessionStatus: undefined,
2287
- Tags: undefined,
2288
- };
1855
+ });
2289
1856
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2290
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
1857
+ if (data.CreateDate != null) {
2291
1858
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
2292
1859
  }
2293
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
1860
+ if (data.CreatedBy != null) {
2294
1861
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
2295
1862
  }
2296
- if (data.DatasetName !== undefined && data.DatasetName !== null) {
1863
+ if (data.DatasetName != null) {
2297
1864
  contents.DatasetName = (0, smithy_client_1.expectString)(data.DatasetName);
2298
1865
  }
2299
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
1866
+ if (data.LastModifiedBy != null) {
2300
1867
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
2301
1868
  }
2302
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
1869
+ if (data.LastModifiedDate != null) {
2303
1870
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
2304
1871
  }
2305
- if (data.Name !== undefined && data.Name !== null) {
1872
+ if (data.Name != null) {
2306
1873
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2307
1874
  }
2308
- if (data.OpenDate !== undefined && data.OpenDate !== null) {
1875
+ if (data.OpenDate != null) {
2309
1876
  contents.OpenDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.OpenDate)));
2310
1877
  }
2311
- if (data.OpenedBy !== undefined && data.OpenedBy !== null) {
1878
+ if (data.OpenedBy != null) {
2312
1879
  contents.OpenedBy = (0, smithy_client_1.expectString)(data.OpenedBy);
2313
1880
  }
2314
- if (data.RecipeName !== undefined && data.RecipeName !== null) {
1881
+ if (data.RecipeName != null) {
2315
1882
  contents.RecipeName = (0, smithy_client_1.expectString)(data.RecipeName);
2316
1883
  }
2317
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
1884
+ if (data.ResourceArn != null) {
2318
1885
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2319
1886
  }
2320
- if (data.RoleArn !== undefined && data.RoleArn !== null) {
1887
+ if (data.RoleArn != null) {
2321
1888
  contents.RoleArn = (0, smithy_client_1.expectString)(data.RoleArn);
2322
1889
  }
2323
- if (data.Sample !== undefined && data.Sample !== null) {
1890
+ if (data.Sample != null) {
2324
1891
  contents.Sample = deserializeAws_restJson1Sample(data.Sample, context);
2325
1892
  }
2326
- if (data.SessionStatus !== undefined && data.SessionStatus !== null) {
1893
+ if (data.SessionStatus != null) {
2327
1894
  contents.SessionStatus = (0, smithy_client_1.expectString)(data.SessionStatus);
2328
1895
  }
2329
- if (data.Tags !== undefined && data.Tags !== null) {
1896
+ if (data.Tags != null) {
2330
1897
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2331
1898
  }
2332
- return Promise.resolve(contents);
1899
+ return contents;
2333
1900
  };
2334
1901
  exports.deserializeAws_restJson1DescribeProjectCommand = deserializeAws_restJson1DescribeProjectCommand;
2335
1902
  const deserializeAws_restJson1DescribeProjectCommandError = async (output, context) => {
@@ -2337,7 +1904,6 @@ const deserializeAws_restJson1DescribeProjectCommandError = async (output, conte
2337
1904
  ...output,
2338
1905
  body: await parseBody(output.body, context),
2339
1906
  };
2340
- let response;
2341
1907
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2342
1908
  switch (errorCode) {
2343
1909
  case "ResourceNotFoundException":
@@ -2348,77 +1914,62 @@ const deserializeAws_restJson1DescribeProjectCommandError = async (output, conte
2348
1914
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2349
1915
  default:
2350
1916
  const parsedBody = parsedOutput.body;
2351
- const $metadata = deserializeMetadata(output);
2352
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2353
- response = new DataBrewServiceException_1.DataBrewServiceException({
2354
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2355
- $fault: "client",
2356
- $metadata,
1917
+ (0, smithy_client_1.throwDefaultError)({
1918
+ output,
1919
+ parsedBody,
1920
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1921
+ errorCode,
2357
1922
  });
2358
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2359
1923
  }
2360
1924
  };
2361
1925
  const deserializeAws_restJson1DescribeRecipeCommand = async (output, context) => {
2362
1926
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2363
1927
  return deserializeAws_restJson1DescribeRecipeCommandError(output, context);
2364
1928
  }
2365
- const contents = {
1929
+ const contents = map({
2366
1930
  $metadata: deserializeMetadata(output),
2367
- CreateDate: undefined,
2368
- CreatedBy: undefined,
2369
- Description: undefined,
2370
- LastModifiedBy: undefined,
2371
- LastModifiedDate: undefined,
2372
- Name: undefined,
2373
- ProjectName: undefined,
2374
- PublishedBy: undefined,
2375
- PublishedDate: undefined,
2376
- RecipeVersion: undefined,
2377
- ResourceArn: undefined,
2378
- Steps: undefined,
2379
- Tags: undefined,
2380
- };
1931
+ });
2381
1932
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2382
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
1933
+ if (data.CreateDate != null) {
2383
1934
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
2384
1935
  }
2385
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
1936
+ if (data.CreatedBy != null) {
2386
1937
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
2387
1938
  }
2388
- if (data.Description !== undefined && data.Description !== null) {
1939
+ if (data.Description != null) {
2389
1940
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2390
1941
  }
2391
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
1942
+ if (data.LastModifiedBy != null) {
2392
1943
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
2393
1944
  }
2394
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
1945
+ if (data.LastModifiedDate != null) {
2395
1946
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
2396
1947
  }
2397
- if (data.Name !== undefined && data.Name !== null) {
1948
+ if (data.Name != null) {
2398
1949
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2399
1950
  }
2400
- if (data.ProjectName !== undefined && data.ProjectName !== null) {
1951
+ if (data.ProjectName != null) {
2401
1952
  contents.ProjectName = (0, smithy_client_1.expectString)(data.ProjectName);
2402
1953
  }
2403
- if (data.PublishedBy !== undefined && data.PublishedBy !== null) {
1954
+ if (data.PublishedBy != null) {
2404
1955
  contents.PublishedBy = (0, smithy_client_1.expectString)(data.PublishedBy);
2405
1956
  }
2406
- if (data.PublishedDate !== undefined && data.PublishedDate !== null) {
1957
+ if (data.PublishedDate != null) {
2407
1958
  contents.PublishedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.PublishedDate)));
2408
1959
  }
2409
- if (data.RecipeVersion !== undefined && data.RecipeVersion !== null) {
1960
+ if (data.RecipeVersion != null) {
2410
1961
  contents.RecipeVersion = (0, smithy_client_1.expectString)(data.RecipeVersion);
2411
1962
  }
2412
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
1963
+ if (data.ResourceArn != null) {
2413
1964
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2414
1965
  }
2415
- if (data.Steps !== undefined && data.Steps !== null) {
1966
+ if (data.Steps != null) {
2416
1967
  contents.Steps = deserializeAws_restJson1RecipeStepList(data.Steps, context);
2417
1968
  }
2418
- if (data.Tags !== undefined && data.Tags !== null) {
1969
+ if (data.Tags != null) {
2419
1970
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2420
1971
  }
2421
- return Promise.resolve(contents);
1972
+ return contents;
2422
1973
  };
2423
1974
  exports.deserializeAws_restJson1DescribeRecipeCommand = deserializeAws_restJson1DescribeRecipeCommand;
2424
1975
  const deserializeAws_restJson1DescribeRecipeCommandError = async (output, context) => {
@@ -2426,7 +1977,6 @@ const deserializeAws_restJson1DescribeRecipeCommandError = async (output, contex
2426
1977
  ...output,
2427
1978
  body: await parseBody(output.body, context),
2428
1979
  };
2429
- let response;
2430
1980
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2431
1981
  switch (errorCode) {
2432
1982
  case "ResourceNotFoundException":
@@ -2437,65 +1987,53 @@ const deserializeAws_restJson1DescribeRecipeCommandError = async (output, contex
2437
1987
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2438
1988
  default:
2439
1989
  const parsedBody = parsedOutput.body;
2440
- const $metadata = deserializeMetadata(output);
2441
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2442
- response = new DataBrewServiceException_1.DataBrewServiceException({
2443
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2444
- $fault: "client",
2445
- $metadata,
1990
+ (0, smithy_client_1.throwDefaultError)({
1991
+ output,
1992
+ parsedBody,
1993
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
1994
+ errorCode,
2446
1995
  });
2447
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2448
1996
  }
2449
1997
  };
2450
1998
  const deserializeAws_restJson1DescribeRulesetCommand = async (output, context) => {
2451
1999
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2452
2000
  return deserializeAws_restJson1DescribeRulesetCommandError(output, context);
2453
2001
  }
2454
- const contents = {
2002
+ const contents = map({
2455
2003
  $metadata: deserializeMetadata(output),
2456
- CreateDate: undefined,
2457
- CreatedBy: undefined,
2458
- Description: undefined,
2459
- LastModifiedBy: undefined,
2460
- LastModifiedDate: undefined,
2461
- Name: undefined,
2462
- ResourceArn: undefined,
2463
- Rules: undefined,
2464
- Tags: undefined,
2465
- TargetArn: undefined,
2466
- };
2004
+ });
2467
2005
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2468
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
2006
+ if (data.CreateDate != null) {
2469
2007
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
2470
2008
  }
2471
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
2009
+ if (data.CreatedBy != null) {
2472
2010
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
2473
2011
  }
2474
- if (data.Description !== undefined && data.Description !== null) {
2012
+ if (data.Description != null) {
2475
2013
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2476
2014
  }
2477
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
2015
+ if (data.LastModifiedBy != null) {
2478
2016
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
2479
2017
  }
2480
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
2018
+ if (data.LastModifiedDate != null) {
2481
2019
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
2482
2020
  }
2483
- if (data.Name !== undefined && data.Name !== null) {
2021
+ if (data.Name != null) {
2484
2022
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2485
2023
  }
2486
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
2024
+ if (data.ResourceArn != null) {
2487
2025
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2488
2026
  }
2489
- if (data.Rules !== undefined && data.Rules !== null) {
2027
+ if (data.Rules != null) {
2490
2028
  contents.Rules = deserializeAws_restJson1RuleList(data.Rules, context);
2491
2029
  }
2492
- if (data.Tags !== undefined && data.Tags !== null) {
2030
+ if (data.Tags != null) {
2493
2031
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2494
2032
  }
2495
- if (data.TargetArn !== undefined && data.TargetArn !== null) {
2033
+ if (data.TargetArn != null) {
2496
2034
  contents.TargetArn = (0, smithy_client_1.expectString)(data.TargetArn);
2497
2035
  }
2498
- return Promise.resolve(contents);
2036
+ return contents;
2499
2037
  };
2500
2038
  exports.deserializeAws_restJson1DescribeRulesetCommand = deserializeAws_restJson1DescribeRulesetCommand;
2501
2039
  const deserializeAws_restJson1DescribeRulesetCommandError = async (output, context) => {
@@ -2503,7 +2041,6 @@ const deserializeAws_restJson1DescribeRulesetCommandError = async (output, conte
2503
2041
  ...output,
2504
2042
  body: await parseBody(output.body, context),
2505
2043
  };
2506
- let response;
2507
2044
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2508
2045
  switch (errorCode) {
2509
2046
  case "ResourceNotFoundException":
@@ -2514,61 +2051,50 @@ const deserializeAws_restJson1DescribeRulesetCommandError = async (output, conte
2514
2051
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2515
2052
  default:
2516
2053
  const parsedBody = parsedOutput.body;
2517
- const $metadata = deserializeMetadata(output);
2518
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2519
- response = new DataBrewServiceException_1.DataBrewServiceException({
2520
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2521
- $fault: "client",
2522
- $metadata,
2054
+ (0, smithy_client_1.throwDefaultError)({
2055
+ output,
2056
+ parsedBody,
2057
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2058
+ errorCode,
2523
2059
  });
2524
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2525
2060
  }
2526
2061
  };
2527
2062
  const deserializeAws_restJson1DescribeScheduleCommand = async (output, context) => {
2528
2063
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2529
2064
  return deserializeAws_restJson1DescribeScheduleCommandError(output, context);
2530
2065
  }
2531
- const contents = {
2066
+ const contents = map({
2532
2067
  $metadata: deserializeMetadata(output),
2533
- CreateDate: undefined,
2534
- CreatedBy: undefined,
2535
- CronExpression: undefined,
2536
- JobNames: undefined,
2537
- LastModifiedBy: undefined,
2538
- LastModifiedDate: undefined,
2539
- Name: undefined,
2540
- ResourceArn: undefined,
2541
- Tags: undefined,
2542
- };
2068
+ });
2543
2069
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2544
- if (data.CreateDate !== undefined && data.CreateDate !== null) {
2070
+ if (data.CreateDate != null) {
2545
2071
  contents.CreateDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreateDate)));
2546
2072
  }
2547
- if (data.CreatedBy !== undefined && data.CreatedBy !== null) {
2073
+ if (data.CreatedBy != null) {
2548
2074
  contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
2549
2075
  }
2550
- if (data.CronExpression !== undefined && data.CronExpression !== null) {
2076
+ if (data.CronExpression != null) {
2551
2077
  contents.CronExpression = (0, smithy_client_1.expectString)(data.CronExpression);
2552
2078
  }
2553
- if (data.JobNames !== undefined && data.JobNames !== null) {
2079
+ if (data.JobNames != null) {
2554
2080
  contents.JobNames = deserializeAws_restJson1JobNameList(data.JobNames, context);
2555
2081
  }
2556
- if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
2082
+ if (data.LastModifiedBy != null) {
2557
2083
  contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
2558
2084
  }
2559
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
2085
+ if (data.LastModifiedDate != null) {
2560
2086
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
2561
2087
  }
2562
- if (data.Name !== undefined && data.Name !== null) {
2088
+ if (data.Name != null) {
2563
2089
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2564
2090
  }
2565
- if (data.ResourceArn !== undefined && data.ResourceArn !== null) {
2091
+ if (data.ResourceArn != null) {
2566
2092
  contents.ResourceArn = (0, smithy_client_1.expectString)(data.ResourceArn);
2567
2093
  }
2568
- if (data.Tags !== undefined && data.Tags !== null) {
2094
+ if (data.Tags != null) {
2569
2095
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2570
2096
  }
2571
- return Promise.resolve(contents);
2097
+ return contents;
2572
2098
  };
2573
2099
  exports.deserializeAws_restJson1DescribeScheduleCommand = deserializeAws_restJson1DescribeScheduleCommand;
2574
2100
  const deserializeAws_restJson1DescribeScheduleCommandError = async (output, context) => {
@@ -2576,7 +2102,6 @@ const deserializeAws_restJson1DescribeScheduleCommandError = async (output, cont
2576
2102
  ...output,
2577
2103
  body: await parseBody(output.body, context),
2578
2104
  };
2579
- let response;
2580
2105
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2581
2106
  switch (errorCode) {
2582
2107
  case "ResourceNotFoundException":
@@ -2587,33 +2112,29 @@ const deserializeAws_restJson1DescribeScheduleCommandError = async (output, cont
2587
2112
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2588
2113
  default:
2589
2114
  const parsedBody = parsedOutput.body;
2590
- const $metadata = deserializeMetadata(output);
2591
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2592
- response = new DataBrewServiceException_1.DataBrewServiceException({
2593
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2594
- $fault: "client",
2595
- $metadata,
2115
+ (0, smithy_client_1.throwDefaultError)({
2116
+ output,
2117
+ parsedBody,
2118
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2119
+ errorCode,
2596
2120
  });
2597
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2598
2121
  }
2599
2122
  };
2600
2123
  const deserializeAws_restJson1ListDatasetsCommand = async (output, context) => {
2601
2124
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2602
2125
  return deserializeAws_restJson1ListDatasetsCommandError(output, context);
2603
2126
  }
2604
- const contents = {
2127
+ const contents = map({
2605
2128
  $metadata: deserializeMetadata(output),
2606
- Datasets: undefined,
2607
- NextToken: undefined,
2608
- };
2129
+ });
2609
2130
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2610
- if (data.Datasets !== undefined && data.Datasets !== null) {
2131
+ if (data.Datasets != null) {
2611
2132
  contents.Datasets = deserializeAws_restJson1DatasetList(data.Datasets, context);
2612
2133
  }
2613
- if (data.NextToken !== undefined && data.NextToken !== null) {
2134
+ if (data.NextToken != null) {
2614
2135
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2615
2136
  }
2616
- return Promise.resolve(contents);
2137
+ return contents;
2617
2138
  };
2618
2139
  exports.deserializeAws_restJson1ListDatasetsCommand = deserializeAws_restJson1ListDatasetsCommand;
2619
2140
  const deserializeAws_restJson1ListDatasetsCommandError = async (output, context) => {
@@ -2621,7 +2142,6 @@ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context)
2621
2142
  ...output,
2622
2143
  body: await parseBody(output.body, context),
2623
2144
  };
2624
- let response;
2625
2145
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2626
2146
  switch (errorCode) {
2627
2147
  case "ValidationException":
@@ -2629,33 +2149,29 @@ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context)
2629
2149
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2630
2150
  default:
2631
2151
  const parsedBody = parsedOutput.body;
2632
- const $metadata = deserializeMetadata(output);
2633
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2634
- response = new DataBrewServiceException_1.DataBrewServiceException({
2635
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2636
- $fault: "client",
2637
- $metadata,
2152
+ (0, smithy_client_1.throwDefaultError)({
2153
+ output,
2154
+ parsedBody,
2155
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2156
+ errorCode,
2638
2157
  });
2639
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2640
2158
  }
2641
2159
  };
2642
2160
  const deserializeAws_restJson1ListJobRunsCommand = async (output, context) => {
2643
2161
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2644
2162
  return deserializeAws_restJson1ListJobRunsCommandError(output, context);
2645
2163
  }
2646
- const contents = {
2164
+ const contents = map({
2647
2165
  $metadata: deserializeMetadata(output),
2648
- JobRuns: undefined,
2649
- NextToken: undefined,
2650
- };
2166
+ });
2651
2167
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2652
- if (data.JobRuns !== undefined && data.JobRuns !== null) {
2168
+ if (data.JobRuns != null) {
2653
2169
  contents.JobRuns = deserializeAws_restJson1JobRunList(data.JobRuns, context);
2654
2170
  }
2655
- if (data.NextToken !== undefined && data.NextToken !== null) {
2171
+ if (data.NextToken != null) {
2656
2172
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2657
2173
  }
2658
- return Promise.resolve(contents);
2174
+ return contents;
2659
2175
  };
2660
2176
  exports.deserializeAws_restJson1ListJobRunsCommand = deserializeAws_restJson1ListJobRunsCommand;
2661
2177
  const deserializeAws_restJson1ListJobRunsCommandError = async (output, context) => {
@@ -2663,7 +2179,6 @@ const deserializeAws_restJson1ListJobRunsCommandError = async (output, context)
2663
2179
  ...output,
2664
2180
  body: await parseBody(output.body, context),
2665
2181
  };
2666
- let response;
2667
2182
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2668
2183
  switch (errorCode) {
2669
2184
  case "ResourceNotFoundException":
@@ -2674,33 +2189,29 @@ const deserializeAws_restJson1ListJobRunsCommandError = async (output, context)
2674
2189
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2675
2190
  default:
2676
2191
  const parsedBody = parsedOutput.body;
2677
- const $metadata = deserializeMetadata(output);
2678
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2679
- response = new DataBrewServiceException_1.DataBrewServiceException({
2680
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2681
- $fault: "client",
2682
- $metadata,
2192
+ (0, smithy_client_1.throwDefaultError)({
2193
+ output,
2194
+ parsedBody,
2195
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2196
+ errorCode,
2683
2197
  });
2684
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2685
2198
  }
2686
2199
  };
2687
2200
  const deserializeAws_restJson1ListJobsCommand = async (output, context) => {
2688
2201
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2689
2202
  return deserializeAws_restJson1ListJobsCommandError(output, context);
2690
2203
  }
2691
- const contents = {
2204
+ const contents = map({
2692
2205
  $metadata: deserializeMetadata(output),
2693
- Jobs: undefined,
2694
- NextToken: undefined,
2695
- };
2206
+ });
2696
2207
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2697
- if (data.Jobs !== undefined && data.Jobs !== null) {
2208
+ if (data.Jobs != null) {
2698
2209
  contents.Jobs = deserializeAws_restJson1JobList(data.Jobs, context);
2699
2210
  }
2700
- if (data.NextToken !== undefined && data.NextToken !== null) {
2211
+ if (data.NextToken != null) {
2701
2212
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2702
2213
  }
2703
- return Promise.resolve(contents);
2214
+ return contents;
2704
2215
  };
2705
2216
  exports.deserializeAws_restJson1ListJobsCommand = deserializeAws_restJson1ListJobsCommand;
2706
2217
  const deserializeAws_restJson1ListJobsCommandError = async (output, context) => {
@@ -2708,7 +2219,6 @@ const deserializeAws_restJson1ListJobsCommandError = async (output, context) =>
2708
2219
  ...output,
2709
2220
  body: await parseBody(output.body, context),
2710
2221
  };
2711
- let response;
2712
2222
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2713
2223
  switch (errorCode) {
2714
2224
  case "ValidationException":
@@ -2716,33 +2226,29 @@ const deserializeAws_restJson1ListJobsCommandError = async (output, context) =>
2716
2226
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2717
2227
  default:
2718
2228
  const parsedBody = parsedOutput.body;
2719
- const $metadata = deserializeMetadata(output);
2720
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2721
- response = new DataBrewServiceException_1.DataBrewServiceException({
2722
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2723
- $fault: "client",
2724
- $metadata,
2229
+ (0, smithy_client_1.throwDefaultError)({
2230
+ output,
2231
+ parsedBody,
2232
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2233
+ errorCode,
2725
2234
  });
2726
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2727
2235
  }
2728
2236
  };
2729
2237
  const deserializeAws_restJson1ListProjectsCommand = async (output, context) => {
2730
2238
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2731
2239
  return deserializeAws_restJson1ListProjectsCommandError(output, context);
2732
2240
  }
2733
- const contents = {
2241
+ const contents = map({
2734
2242
  $metadata: deserializeMetadata(output),
2735
- NextToken: undefined,
2736
- Projects: undefined,
2737
- };
2243
+ });
2738
2244
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2739
- if (data.NextToken !== undefined && data.NextToken !== null) {
2245
+ if (data.NextToken != null) {
2740
2246
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2741
2247
  }
2742
- if (data.Projects !== undefined && data.Projects !== null) {
2248
+ if (data.Projects != null) {
2743
2249
  contents.Projects = deserializeAws_restJson1ProjectList(data.Projects, context);
2744
2250
  }
2745
- return Promise.resolve(contents);
2251
+ return contents;
2746
2252
  };
2747
2253
  exports.deserializeAws_restJson1ListProjectsCommand = deserializeAws_restJson1ListProjectsCommand;
2748
2254
  const deserializeAws_restJson1ListProjectsCommandError = async (output, context) => {
@@ -2750,7 +2256,6 @@ const deserializeAws_restJson1ListProjectsCommandError = async (output, context)
2750
2256
  ...output,
2751
2257
  body: await parseBody(output.body, context),
2752
2258
  };
2753
- let response;
2754
2259
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2755
2260
  switch (errorCode) {
2756
2261
  case "ValidationException":
@@ -2758,33 +2263,29 @@ const deserializeAws_restJson1ListProjectsCommandError = async (output, context)
2758
2263
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2759
2264
  default:
2760
2265
  const parsedBody = parsedOutput.body;
2761
- const $metadata = deserializeMetadata(output);
2762
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2763
- response = new DataBrewServiceException_1.DataBrewServiceException({
2764
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2765
- $fault: "client",
2766
- $metadata,
2266
+ (0, smithy_client_1.throwDefaultError)({
2267
+ output,
2268
+ parsedBody,
2269
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2270
+ errorCode,
2767
2271
  });
2768
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2769
2272
  }
2770
2273
  };
2771
2274
  const deserializeAws_restJson1ListRecipesCommand = async (output, context) => {
2772
2275
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2773
2276
  return deserializeAws_restJson1ListRecipesCommandError(output, context);
2774
2277
  }
2775
- const contents = {
2278
+ const contents = map({
2776
2279
  $metadata: deserializeMetadata(output),
2777
- NextToken: undefined,
2778
- Recipes: undefined,
2779
- };
2280
+ });
2780
2281
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2781
- if (data.NextToken !== undefined && data.NextToken !== null) {
2282
+ if (data.NextToken != null) {
2782
2283
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2783
2284
  }
2784
- if (data.Recipes !== undefined && data.Recipes !== null) {
2285
+ if (data.Recipes != null) {
2785
2286
  contents.Recipes = deserializeAws_restJson1RecipeList(data.Recipes, context);
2786
2287
  }
2787
- return Promise.resolve(contents);
2288
+ return contents;
2788
2289
  };
2789
2290
  exports.deserializeAws_restJson1ListRecipesCommand = deserializeAws_restJson1ListRecipesCommand;
2790
2291
  const deserializeAws_restJson1ListRecipesCommandError = async (output, context) => {
@@ -2792,7 +2293,6 @@ const deserializeAws_restJson1ListRecipesCommandError = async (output, context)
2792
2293
  ...output,
2793
2294
  body: await parseBody(output.body, context),
2794
2295
  };
2795
- let response;
2796
2296
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2797
2297
  switch (errorCode) {
2798
2298
  case "ValidationException":
@@ -2800,33 +2300,29 @@ const deserializeAws_restJson1ListRecipesCommandError = async (output, context)
2800
2300
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2801
2301
  default:
2802
2302
  const parsedBody = parsedOutput.body;
2803
- const $metadata = deserializeMetadata(output);
2804
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2805
- response = new DataBrewServiceException_1.DataBrewServiceException({
2806
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2807
- $fault: "client",
2808
- $metadata,
2303
+ (0, smithy_client_1.throwDefaultError)({
2304
+ output,
2305
+ parsedBody,
2306
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2307
+ errorCode,
2809
2308
  });
2810
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2811
2309
  }
2812
2310
  };
2813
2311
  const deserializeAws_restJson1ListRecipeVersionsCommand = async (output, context) => {
2814
2312
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2815
2313
  return deserializeAws_restJson1ListRecipeVersionsCommandError(output, context);
2816
2314
  }
2817
- const contents = {
2315
+ const contents = map({
2818
2316
  $metadata: deserializeMetadata(output),
2819
- NextToken: undefined,
2820
- Recipes: undefined,
2821
- };
2317
+ });
2822
2318
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2823
- if (data.NextToken !== undefined && data.NextToken !== null) {
2319
+ if (data.NextToken != null) {
2824
2320
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2825
2321
  }
2826
- if (data.Recipes !== undefined && data.Recipes !== null) {
2322
+ if (data.Recipes != null) {
2827
2323
  contents.Recipes = deserializeAws_restJson1RecipeList(data.Recipes, context);
2828
2324
  }
2829
- return Promise.resolve(contents);
2325
+ return contents;
2830
2326
  };
2831
2327
  exports.deserializeAws_restJson1ListRecipeVersionsCommand = deserializeAws_restJson1ListRecipeVersionsCommand;
2832
2328
  const deserializeAws_restJson1ListRecipeVersionsCommandError = async (output, context) => {
@@ -2834,7 +2330,6 @@ const deserializeAws_restJson1ListRecipeVersionsCommandError = async (output, co
2834
2330
  ...output,
2835
2331
  body: await parseBody(output.body, context),
2836
2332
  };
2837
- let response;
2838
2333
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2839
2334
  switch (errorCode) {
2840
2335
  case "ValidationException":
@@ -2842,33 +2337,29 @@ const deserializeAws_restJson1ListRecipeVersionsCommandError = async (output, co
2842
2337
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2843
2338
  default:
2844
2339
  const parsedBody = parsedOutput.body;
2845
- const $metadata = deserializeMetadata(output);
2846
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2847
- response = new DataBrewServiceException_1.DataBrewServiceException({
2848
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2849
- $fault: "client",
2850
- $metadata,
2340
+ (0, smithy_client_1.throwDefaultError)({
2341
+ output,
2342
+ parsedBody,
2343
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2344
+ errorCode,
2851
2345
  });
2852
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2853
2346
  }
2854
2347
  };
2855
2348
  const deserializeAws_restJson1ListRulesetsCommand = async (output, context) => {
2856
2349
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2857
2350
  return deserializeAws_restJson1ListRulesetsCommandError(output, context);
2858
2351
  }
2859
- const contents = {
2352
+ const contents = map({
2860
2353
  $metadata: deserializeMetadata(output),
2861
- NextToken: undefined,
2862
- Rulesets: undefined,
2863
- };
2354
+ });
2864
2355
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2865
- if (data.NextToken !== undefined && data.NextToken !== null) {
2356
+ if (data.NextToken != null) {
2866
2357
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2867
2358
  }
2868
- if (data.Rulesets !== undefined && data.Rulesets !== null) {
2359
+ if (data.Rulesets != null) {
2869
2360
  contents.Rulesets = deserializeAws_restJson1RulesetItemList(data.Rulesets, context);
2870
2361
  }
2871
- return Promise.resolve(contents);
2362
+ return contents;
2872
2363
  };
2873
2364
  exports.deserializeAws_restJson1ListRulesetsCommand = deserializeAws_restJson1ListRulesetsCommand;
2874
2365
  const deserializeAws_restJson1ListRulesetsCommandError = async (output, context) => {
@@ -2876,7 +2367,6 @@ const deserializeAws_restJson1ListRulesetsCommandError = async (output, context)
2876
2367
  ...output,
2877
2368
  body: await parseBody(output.body, context),
2878
2369
  };
2879
- let response;
2880
2370
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2881
2371
  switch (errorCode) {
2882
2372
  case "ResourceNotFoundException":
@@ -2887,33 +2377,29 @@ const deserializeAws_restJson1ListRulesetsCommandError = async (output, context)
2887
2377
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2888
2378
  default:
2889
2379
  const parsedBody = parsedOutput.body;
2890
- const $metadata = deserializeMetadata(output);
2891
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2892
- response = new DataBrewServiceException_1.DataBrewServiceException({
2893
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2894
- $fault: "client",
2895
- $metadata,
2380
+ (0, smithy_client_1.throwDefaultError)({
2381
+ output,
2382
+ parsedBody,
2383
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2384
+ errorCode,
2896
2385
  });
2897
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2898
2386
  }
2899
2387
  };
2900
2388
  const deserializeAws_restJson1ListSchedulesCommand = async (output, context) => {
2901
2389
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2902
2390
  return deserializeAws_restJson1ListSchedulesCommandError(output, context);
2903
2391
  }
2904
- const contents = {
2392
+ const contents = map({
2905
2393
  $metadata: deserializeMetadata(output),
2906
- NextToken: undefined,
2907
- Schedules: undefined,
2908
- };
2394
+ });
2909
2395
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2910
- if (data.NextToken !== undefined && data.NextToken !== null) {
2396
+ if (data.NextToken != null) {
2911
2397
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2912
2398
  }
2913
- if (data.Schedules !== undefined && data.Schedules !== null) {
2399
+ if (data.Schedules != null) {
2914
2400
  contents.Schedules = deserializeAws_restJson1ScheduleList(data.Schedules, context);
2915
2401
  }
2916
- return Promise.resolve(contents);
2402
+ return contents;
2917
2403
  };
2918
2404
  exports.deserializeAws_restJson1ListSchedulesCommand = deserializeAws_restJson1ListSchedulesCommand;
2919
2405
  const deserializeAws_restJson1ListSchedulesCommandError = async (output, context) => {
@@ -2921,7 +2407,6 @@ const deserializeAws_restJson1ListSchedulesCommandError = async (output, context
2921
2407
  ...output,
2922
2408
  body: await parseBody(output.body, context),
2923
2409
  };
2924
- let response;
2925
2410
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2926
2411
  switch (errorCode) {
2927
2412
  case "ValidationException":
@@ -2929,29 +2414,26 @@ const deserializeAws_restJson1ListSchedulesCommandError = async (output, context
2929
2414
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2930
2415
  default:
2931
2416
  const parsedBody = parsedOutput.body;
2932
- const $metadata = deserializeMetadata(output);
2933
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2934
- response = new DataBrewServiceException_1.DataBrewServiceException({
2935
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2936
- $fault: "client",
2937
- $metadata,
2417
+ (0, smithy_client_1.throwDefaultError)({
2418
+ output,
2419
+ parsedBody,
2420
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2421
+ errorCode,
2938
2422
  });
2939
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2940
2423
  }
2941
2424
  };
2942
2425
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2943
2426
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2944
2427
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2945
2428
  }
2946
- const contents = {
2429
+ const contents = map({
2947
2430
  $metadata: deserializeMetadata(output),
2948
- Tags: undefined,
2949
- };
2431
+ });
2950
2432
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2951
- if (data.Tags !== undefined && data.Tags !== null) {
2433
+ if (data.Tags != null) {
2952
2434
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2953
2435
  }
2954
- return Promise.resolve(contents);
2436
+ return contents;
2955
2437
  };
2956
2438
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2957
2439
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -2959,7 +2441,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2959
2441
  ...output,
2960
2442
  body: await parseBody(output.body, context),
2961
2443
  };
2962
- let response;
2963
2444
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2964
2445
  switch (errorCode) {
2965
2446
  case "InternalServerException":
@@ -2973,29 +2454,26 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2973
2454
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2974
2455
  default:
2975
2456
  const parsedBody = parsedOutput.body;
2976
- const $metadata = deserializeMetadata(output);
2977
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2978
- response = new DataBrewServiceException_1.DataBrewServiceException({
2979
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2980
- $fault: "client",
2981
- $metadata,
2457
+ (0, smithy_client_1.throwDefaultError)({
2458
+ output,
2459
+ parsedBody,
2460
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2461
+ errorCode,
2982
2462
  });
2983
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2984
2463
  }
2985
2464
  };
2986
2465
  const deserializeAws_restJson1PublishRecipeCommand = async (output, context) => {
2987
2466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2988
2467
  return deserializeAws_restJson1PublishRecipeCommandError(output, context);
2989
2468
  }
2990
- const contents = {
2469
+ const contents = map({
2991
2470
  $metadata: deserializeMetadata(output),
2992
- Name: undefined,
2993
- };
2471
+ });
2994
2472
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2995
- if (data.Name !== undefined && data.Name !== null) {
2473
+ if (data.Name != null) {
2996
2474
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2997
2475
  }
2998
- return Promise.resolve(contents);
2476
+ return contents;
2999
2477
  };
3000
2478
  exports.deserializeAws_restJson1PublishRecipeCommand = deserializeAws_restJson1PublishRecipeCommand;
3001
2479
  const deserializeAws_restJson1PublishRecipeCommandError = async (output, context) => {
@@ -3003,7 +2481,6 @@ const deserializeAws_restJson1PublishRecipeCommandError = async (output, context
3003
2481
  ...output,
3004
2482
  body: await parseBody(output.body, context),
3005
2483
  };
3006
- let response;
3007
2484
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3008
2485
  switch (errorCode) {
3009
2486
  case "ResourceNotFoundException":
@@ -3017,37 +2494,32 @@ const deserializeAws_restJson1PublishRecipeCommandError = async (output, context
3017
2494
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3018
2495
  default:
3019
2496
  const parsedBody = parsedOutput.body;
3020
- const $metadata = deserializeMetadata(output);
3021
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3022
- response = new DataBrewServiceException_1.DataBrewServiceException({
3023
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3024
- $fault: "client",
3025
- $metadata,
2497
+ (0, smithy_client_1.throwDefaultError)({
2498
+ output,
2499
+ parsedBody,
2500
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2501
+ errorCode,
3026
2502
  });
3027
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3028
2503
  }
3029
2504
  };
3030
2505
  const deserializeAws_restJson1SendProjectSessionActionCommand = async (output, context) => {
3031
2506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3032
2507
  return deserializeAws_restJson1SendProjectSessionActionCommandError(output, context);
3033
2508
  }
3034
- const contents = {
2509
+ const contents = map({
3035
2510
  $metadata: deserializeMetadata(output),
3036
- ActionId: undefined,
3037
- Name: undefined,
3038
- Result: undefined,
3039
- };
2511
+ });
3040
2512
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3041
- if (data.ActionId !== undefined && data.ActionId !== null) {
2513
+ if (data.ActionId != null) {
3042
2514
  contents.ActionId = (0, smithy_client_1.expectInt32)(data.ActionId);
3043
2515
  }
3044
- if (data.Name !== undefined && data.Name !== null) {
2516
+ if (data.Name != null) {
3045
2517
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3046
2518
  }
3047
- if (data.Result !== undefined && data.Result !== null) {
2519
+ if (data.Result != null) {
3048
2520
  contents.Result = (0, smithy_client_1.expectString)(data.Result);
3049
2521
  }
3050
- return Promise.resolve(contents);
2522
+ return contents;
3051
2523
  };
3052
2524
  exports.deserializeAws_restJson1SendProjectSessionActionCommand = deserializeAws_restJson1SendProjectSessionActionCommand;
3053
2525
  const deserializeAws_restJson1SendProjectSessionActionCommandError = async (output, context) => {
@@ -3055,7 +2527,6 @@ const deserializeAws_restJson1SendProjectSessionActionCommandError = async (outp
3055
2527
  ...output,
3056
2528
  body: await parseBody(output.body, context),
3057
2529
  };
3058
- let response;
3059
2530
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3060
2531
  switch (errorCode) {
3061
2532
  case "ConflictException":
@@ -3069,29 +2540,26 @@ const deserializeAws_restJson1SendProjectSessionActionCommandError = async (outp
3069
2540
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3070
2541
  default:
3071
2542
  const parsedBody = parsedOutput.body;
3072
- const $metadata = deserializeMetadata(output);
3073
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3074
- response = new DataBrewServiceException_1.DataBrewServiceException({
3075
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3076
- $fault: "client",
3077
- $metadata,
2543
+ (0, smithy_client_1.throwDefaultError)({
2544
+ output,
2545
+ parsedBody,
2546
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2547
+ errorCode,
3078
2548
  });
3079
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3080
2549
  }
3081
2550
  };
3082
2551
  const deserializeAws_restJson1StartJobRunCommand = async (output, context) => {
3083
2552
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3084
2553
  return deserializeAws_restJson1StartJobRunCommandError(output, context);
3085
2554
  }
3086
- const contents = {
2555
+ const contents = map({
3087
2556
  $metadata: deserializeMetadata(output),
3088
- RunId: undefined,
3089
- };
2557
+ });
3090
2558
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3091
- if (data.RunId !== undefined && data.RunId !== null) {
2559
+ if (data.RunId != null) {
3092
2560
  contents.RunId = (0, smithy_client_1.expectString)(data.RunId);
3093
2561
  }
3094
- return Promise.resolve(contents);
2562
+ return contents;
3095
2563
  };
3096
2564
  exports.deserializeAws_restJson1StartJobRunCommand = deserializeAws_restJson1StartJobRunCommand;
3097
2565
  const deserializeAws_restJson1StartJobRunCommandError = async (output, context) => {
@@ -3099,7 +2567,6 @@ const deserializeAws_restJson1StartJobRunCommandError = async (output, context)
3099
2567
  ...output,
3100
2568
  body: await parseBody(output.body, context),
3101
2569
  };
3102
- let response;
3103
2570
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3104
2571
  switch (errorCode) {
3105
2572
  case "ConflictException":
@@ -3116,33 +2583,29 @@ const deserializeAws_restJson1StartJobRunCommandError = async (output, context)
3116
2583
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3117
2584
  default:
3118
2585
  const parsedBody = parsedOutput.body;
3119
- const $metadata = deserializeMetadata(output);
3120
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3121
- response = new DataBrewServiceException_1.DataBrewServiceException({
3122
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3123
- $fault: "client",
3124
- $metadata,
2586
+ (0, smithy_client_1.throwDefaultError)({
2587
+ output,
2588
+ parsedBody,
2589
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2590
+ errorCode,
3125
2591
  });
3126
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3127
2592
  }
3128
2593
  };
3129
2594
  const deserializeAws_restJson1StartProjectSessionCommand = async (output, context) => {
3130
2595
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3131
2596
  return deserializeAws_restJson1StartProjectSessionCommandError(output, context);
3132
2597
  }
3133
- const contents = {
2598
+ const contents = map({
3134
2599
  $metadata: deserializeMetadata(output),
3135
- ClientSessionId: undefined,
3136
- Name: undefined,
3137
- };
2600
+ });
3138
2601
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3139
- if (data.ClientSessionId !== undefined && data.ClientSessionId !== null) {
2602
+ if (data.ClientSessionId != null) {
3140
2603
  contents.ClientSessionId = (0, smithy_client_1.expectString)(data.ClientSessionId);
3141
2604
  }
3142
- if (data.Name !== undefined && data.Name !== null) {
2605
+ if (data.Name != null) {
3143
2606
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3144
2607
  }
3145
- return Promise.resolve(contents);
2608
+ return contents;
3146
2609
  };
3147
2610
  exports.deserializeAws_restJson1StartProjectSessionCommand = deserializeAws_restJson1StartProjectSessionCommand;
3148
2611
  const deserializeAws_restJson1StartProjectSessionCommandError = async (output, context) => {
@@ -3150,7 +2613,6 @@ const deserializeAws_restJson1StartProjectSessionCommandError = async (output, c
3150
2613
  ...output,
3151
2614
  body: await parseBody(output.body, context),
3152
2615
  };
3153
- let response;
3154
2616
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3155
2617
  switch (errorCode) {
3156
2618
  case "ConflictException":
@@ -3167,29 +2629,26 @@ const deserializeAws_restJson1StartProjectSessionCommandError = async (output, c
3167
2629
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3168
2630
  default:
3169
2631
  const parsedBody = parsedOutput.body;
3170
- const $metadata = deserializeMetadata(output);
3171
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3172
- response = new DataBrewServiceException_1.DataBrewServiceException({
3173
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3174
- $fault: "client",
3175
- $metadata,
2632
+ (0, smithy_client_1.throwDefaultError)({
2633
+ output,
2634
+ parsedBody,
2635
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2636
+ errorCode,
3176
2637
  });
3177
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3178
2638
  }
3179
2639
  };
3180
2640
  const deserializeAws_restJson1StopJobRunCommand = async (output, context) => {
3181
2641
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3182
2642
  return deserializeAws_restJson1StopJobRunCommandError(output, context);
3183
2643
  }
3184
- const contents = {
2644
+ const contents = map({
3185
2645
  $metadata: deserializeMetadata(output),
3186
- RunId: undefined,
3187
- };
2646
+ });
3188
2647
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3189
- if (data.RunId !== undefined && data.RunId !== null) {
2648
+ if (data.RunId != null) {
3190
2649
  contents.RunId = (0, smithy_client_1.expectString)(data.RunId);
3191
2650
  }
3192
- return Promise.resolve(contents);
2651
+ return contents;
3193
2652
  };
3194
2653
  exports.deserializeAws_restJson1StopJobRunCommand = deserializeAws_restJson1StopJobRunCommand;
3195
2654
  const deserializeAws_restJson1StopJobRunCommandError = async (output, context) => {
@@ -3197,7 +2656,6 @@ const deserializeAws_restJson1StopJobRunCommandError = async (output, context) =
3197
2656
  ...output,
3198
2657
  body: await parseBody(output.body, context),
3199
2658
  };
3200
- let response;
3201
2659
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3202
2660
  switch (errorCode) {
3203
2661
  case "ResourceNotFoundException":
@@ -3208,25 +2666,23 @@ const deserializeAws_restJson1StopJobRunCommandError = async (output, context) =
3208
2666
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3209
2667
  default:
3210
2668
  const parsedBody = parsedOutput.body;
3211
- const $metadata = deserializeMetadata(output);
3212
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3213
- response = new DataBrewServiceException_1.DataBrewServiceException({
3214
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3215
- $fault: "client",
3216
- $metadata,
2669
+ (0, smithy_client_1.throwDefaultError)({
2670
+ output,
2671
+ parsedBody,
2672
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2673
+ errorCode,
3217
2674
  });
3218
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3219
2675
  }
3220
2676
  };
3221
2677
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3222
2678
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3223
2679
  return deserializeAws_restJson1TagResourceCommandError(output, context);
3224
2680
  }
3225
- const contents = {
2681
+ const contents = map({
3226
2682
  $metadata: deserializeMetadata(output),
3227
- };
2683
+ });
3228
2684
  await collectBody(output.body, context);
3229
- return Promise.resolve(contents);
2685
+ return contents;
3230
2686
  };
3231
2687
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
3232
2688
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -3234,7 +2690,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3234
2690
  ...output,
3235
2691
  body: await parseBody(output.body, context),
3236
2692
  };
3237
- let response;
3238
2693
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3239
2694
  switch (errorCode) {
3240
2695
  case "InternalServerException":
@@ -3248,25 +2703,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3248
2703
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3249
2704
  default:
3250
2705
  const parsedBody = parsedOutput.body;
3251
- const $metadata = deserializeMetadata(output);
3252
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3253
- response = new DataBrewServiceException_1.DataBrewServiceException({
3254
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3255
- $fault: "client",
3256
- $metadata,
2706
+ (0, smithy_client_1.throwDefaultError)({
2707
+ output,
2708
+ parsedBody,
2709
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2710
+ errorCode,
3257
2711
  });
3258
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3259
2712
  }
3260
2713
  };
3261
2714
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3262
2715
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3263
2716
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
3264
2717
  }
3265
- const contents = {
2718
+ const contents = map({
3266
2719
  $metadata: deserializeMetadata(output),
3267
- };
2720
+ });
3268
2721
  await collectBody(output.body, context);
3269
- return Promise.resolve(contents);
2722
+ return contents;
3270
2723
  };
3271
2724
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
3272
2725
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -3274,7 +2727,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3274
2727
  ...output,
3275
2728
  body: await parseBody(output.body, context),
3276
2729
  };
3277
- let response;
3278
2730
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3279
2731
  switch (errorCode) {
3280
2732
  case "InternalServerException":
@@ -3288,29 +2740,26 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3288
2740
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3289
2741
  default:
3290
2742
  const parsedBody = parsedOutput.body;
3291
- const $metadata = deserializeMetadata(output);
3292
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3293
- response = new DataBrewServiceException_1.DataBrewServiceException({
3294
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3295
- $fault: "client",
3296
- $metadata,
2743
+ (0, smithy_client_1.throwDefaultError)({
2744
+ output,
2745
+ parsedBody,
2746
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2747
+ errorCode,
3297
2748
  });
3298
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3299
2749
  }
3300
2750
  };
3301
2751
  const deserializeAws_restJson1UpdateDatasetCommand = async (output, context) => {
3302
2752
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3303
2753
  return deserializeAws_restJson1UpdateDatasetCommandError(output, context);
3304
2754
  }
3305
- const contents = {
2755
+ const contents = map({
3306
2756
  $metadata: deserializeMetadata(output),
3307
- Name: undefined,
3308
- };
2757
+ });
3309
2758
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3310
- if (data.Name !== undefined && data.Name !== null) {
2759
+ if (data.Name != null) {
3311
2760
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3312
2761
  }
3313
- return Promise.resolve(contents);
2762
+ return contents;
3314
2763
  };
3315
2764
  exports.deserializeAws_restJson1UpdateDatasetCommand = deserializeAws_restJson1UpdateDatasetCommand;
3316
2765
  const deserializeAws_restJson1UpdateDatasetCommandError = async (output, context) => {
@@ -3318,7 +2767,6 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async (output, context
3318
2767
  ...output,
3319
2768
  body: await parseBody(output.body, context),
3320
2769
  };
3321
- let response;
3322
2770
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3323
2771
  switch (errorCode) {
3324
2772
  case "AccessDeniedException":
@@ -3332,29 +2780,26 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async (output, context
3332
2780
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3333
2781
  default:
3334
2782
  const parsedBody = parsedOutput.body;
3335
- const $metadata = deserializeMetadata(output);
3336
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3337
- response = new DataBrewServiceException_1.DataBrewServiceException({
3338
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3339
- $fault: "client",
3340
- $metadata,
2783
+ (0, smithy_client_1.throwDefaultError)({
2784
+ output,
2785
+ parsedBody,
2786
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2787
+ errorCode,
3341
2788
  });
3342
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3343
2789
  }
3344
2790
  };
3345
2791
  const deserializeAws_restJson1UpdateProfileJobCommand = async (output, context) => {
3346
2792
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3347
2793
  return deserializeAws_restJson1UpdateProfileJobCommandError(output, context);
3348
2794
  }
3349
- const contents = {
2795
+ const contents = map({
3350
2796
  $metadata: deserializeMetadata(output),
3351
- Name: undefined,
3352
- };
2797
+ });
3353
2798
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3354
- if (data.Name !== undefined && data.Name !== null) {
2799
+ if (data.Name != null) {
3355
2800
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3356
2801
  }
3357
- return Promise.resolve(contents);
2802
+ return contents;
3358
2803
  };
3359
2804
  exports.deserializeAws_restJson1UpdateProfileJobCommand = deserializeAws_restJson1UpdateProfileJobCommand;
3360
2805
  const deserializeAws_restJson1UpdateProfileJobCommandError = async (output, context) => {
@@ -3362,7 +2807,6 @@ const deserializeAws_restJson1UpdateProfileJobCommandError = async (output, cont
3362
2807
  ...output,
3363
2808
  body: await parseBody(output.body, context),
3364
2809
  };
3365
- let response;
3366
2810
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3367
2811
  switch (errorCode) {
3368
2812
  case "AccessDeniedException":
@@ -3376,33 +2820,29 @@ const deserializeAws_restJson1UpdateProfileJobCommandError = async (output, cont
3376
2820
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3377
2821
  default:
3378
2822
  const parsedBody = parsedOutput.body;
3379
- const $metadata = deserializeMetadata(output);
3380
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3381
- response = new DataBrewServiceException_1.DataBrewServiceException({
3382
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3383
- $fault: "client",
3384
- $metadata,
2823
+ (0, smithy_client_1.throwDefaultError)({
2824
+ output,
2825
+ parsedBody,
2826
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2827
+ errorCode,
3385
2828
  });
3386
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3387
2829
  }
3388
2830
  };
3389
2831
  const deserializeAws_restJson1UpdateProjectCommand = async (output, context) => {
3390
2832
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3391
2833
  return deserializeAws_restJson1UpdateProjectCommandError(output, context);
3392
2834
  }
3393
- const contents = {
2835
+ const contents = map({
3394
2836
  $metadata: deserializeMetadata(output),
3395
- LastModifiedDate: undefined,
3396
- Name: undefined,
3397
- };
2837
+ });
3398
2838
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3399
- if (data.LastModifiedDate !== undefined && data.LastModifiedDate !== null) {
2839
+ if (data.LastModifiedDate != null) {
3400
2840
  contents.LastModifiedDate = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedDate)));
3401
2841
  }
3402
- if (data.Name !== undefined && data.Name !== null) {
2842
+ if (data.Name != null) {
3403
2843
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3404
2844
  }
3405
- return Promise.resolve(contents);
2845
+ return contents;
3406
2846
  };
3407
2847
  exports.deserializeAws_restJson1UpdateProjectCommand = deserializeAws_restJson1UpdateProjectCommand;
3408
2848
  const deserializeAws_restJson1UpdateProjectCommandError = async (output, context) => {
@@ -3410,7 +2850,6 @@ const deserializeAws_restJson1UpdateProjectCommandError = async (output, context
3410
2850
  ...output,
3411
2851
  body: await parseBody(output.body, context),
3412
2852
  };
3413
- let response;
3414
2853
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3415
2854
  switch (errorCode) {
3416
2855
  case "ResourceNotFoundException":
@@ -3421,29 +2860,26 @@ const deserializeAws_restJson1UpdateProjectCommandError = async (output, context
3421
2860
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3422
2861
  default:
3423
2862
  const parsedBody = parsedOutput.body;
3424
- const $metadata = deserializeMetadata(output);
3425
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3426
- response = new DataBrewServiceException_1.DataBrewServiceException({
3427
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3428
- $fault: "client",
3429
- $metadata,
2863
+ (0, smithy_client_1.throwDefaultError)({
2864
+ output,
2865
+ parsedBody,
2866
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2867
+ errorCode,
3430
2868
  });
3431
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3432
2869
  }
3433
2870
  };
3434
2871
  const deserializeAws_restJson1UpdateRecipeCommand = async (output, context) => {
3435
2872
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3436
2873
  return deserializeAws_restJson1UpdateRecipeCommandError(output, context);
3437
2874
  }
3438
- const contents = {
2875
+ const contents = map({
3439
2876
  $metadata: deserializeMetadata(output),
3440
- Name: undefined,
3441
- };
2877
+ });
3442
2878
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3443
- if (data.Name !== undefined && data.Name !== null) {
2879
+ if (data.Name != null) {
3444
2880
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3445
2881
  }
3446
- return Promise.resolve(contents);
2882
+ return contents;
3447
2883
  };
3448
2884
  exports.deserializeAws_restJson1UpdateRecipeCommand = deserializeAws_restJson1UpdateRecipeCommand;
3449
2885
  const deserializeAws_restJson1UpdateRecipeCommandError = async (output, context) => {
@@ -3451,7 +2887,6 @@ const deserializeAws_restJson1UpdateRecipeCommandError = async (output, context)
3451
2887
  ...output,
3452
2888
  body: await parseBody(output.body, context),
3453
2889
  };
3454
- let response;
3455
2890
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3456
2891
  switch (errorCode) {
3457
2892
  case "ResourceNotFoundException":
@@ -3462,29 +2897,26 @@ const deserializeAws_restJson1UpdateRecipeCommandError = async (output, context)
3462
2897
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3463
2898
  default:
3464
2899
  const parsedBody = parsedOutput.body;
3465
- const $metadata = deserializeMetadata(output);
3466
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3467
- response = new DataBrewServiceException_1.DataBrewServiceException({
3468
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3469
- $fault: "client",
3470
- $metadata,
2900
+ (0, smithy_client_1.throwDefaultError)({
2901
+ output,
2902
+ parsedBody,
2903
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2904
+ errorCode,
3471
2905
  });
3472
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3473
2906
  }
3474
2907
  };
3475
2908
  const deserializeAws_restJson1UpdateRecipeJobCommand = async (output, context) => {
3476
2909
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3477
2910
  return deserializeAws_restJson1UpdateRecipeJobCommandError(output, context);
3478
2911
  }
3479
- const contents = {
2912
+ const contents = map({
3480
2913
  $metadata: deserializeMetadata(output),
3481
- Name: undefined,
3482
- };
2914
+ });
3483
2915
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3484
- if (data.Name !== undefined && data.Name !== null) {
2916
+ if (data.Name != null) {
3485
2917
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3486
2918
  }
3487
- return Promise.resolve(contents);
2919
+ return contents;
3488
2920
  };
3489
2921
  exports.deserializeAws_restJson1UpdateRecipeJobCommand = deserializeAws_restJson1UpdateRecipeJobCommand;
3490
2922
  const deserializeAws_restJson1UpdateRecipeJobCommandError = async (output, context) => {
@@ -3492,7 +2924,6 @@ const deserializeAws_restJson1UpdateRecipeJobCommandError = async (output, conte
3492
2924
  ...output,
3493
2925
  body: await parseBody(output.body, context),
3494
2926
  };
3495
- let response;
3496
2927
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3497
2928
  switch (errorCode) {
3498
2929
  case "AccessDeniedException":
@@ -3506,29 +2937,26 @@ const deserializeAws_restJson1UpdateRecipeJobCommandError = async (output, conte
3506
2937
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3507
2938
  default:
3508
2939
  const parsedBody = parsedOutput.body;
3509
- const $metadata = deserializeMetadata(output);
3510
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3511
- response = new DataBrewServiceException_1.DataBrewServiceException({
3512
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3513
- $fault: "client",
3514
- $metadata,
2940
+ (0, smithy_client_1.throwDefaultError)({
2941
+ output,
2942
+ parsedBody,
2943
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2944
+ errorCode,
3515
2945
  });
3516
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3517
2946
  }
3518
2947
  };
3519
2948
  const deserializeAws_restJson1UpdateRulesetCommand = async (output, context) => {
3520
2949
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3521
2950
  return deserializeAws_restJson1UpdateRulesetCommandError(output, context);
3522
2951
  }
3523
- const contents = {
2952
+ const contents = map({
3524
2953
  $metadata: deserializeMetadata(output),
3525
- Name: undefined,
3526
- };
2954
+ });
3527
2955
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3528
- if (data.Name !== undefined && data.Name !== null) {
2956
+ if (data.Name != null) {
3529
2957
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3530
2958
  }
3531
- return Promise.resolve(contents);
2959
+ return contents;
3532
2960
  };
3533
2961
  exports.deserializeAws_restJson1UpdateRulesetCommand = deserializeAws_restJson1UpdateRulesetCommand;
3534
2962
  const deserializeAws_restJson1UpdateRulesetCommandError = async (output, context) => {
@@ -3536,7 +2964,6 @@ const deserializeAws_restJson1UpdateRulesetCommandError = async (output, context
3536
2964
  ...output,
3537
2965
  body: await parseBody(output.body, context),
3538
2966
  };
3539
- let response;
3540
2967
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3541
2968
  switch (errorCode) {
3542
2969
  case "ResourceNotFoundException":
@@ -3547,29 +2974,26 @@ const deserializeAws_restJson1UpdateRulesetCommandError = async (output, context
3547
2974
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3548
2975
  default:
3549
2976
  const parsedBody = parsedOutput.body;
3550
- const $metadata = deserializeMetadata(output);
3551
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3552
- response = new DataBrewServiceException_1.DataBrewServiceException({
3553
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3554
- $fault: "client",
3555
- $metadata,
2977
+ (0, smithy_client_1.throwDefaultError)({
2978
+ output,
2979
+ parsedBody,
2980
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
2981
+ errorCode,
3556
2982
  });
3557
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3558
2983
  }
3559
2984
  };
3560
2985
  const deserializeAws_restJson1UpdateScheduleCommand = async (output, context) => {
3561
2986
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3562
2987
  return deserializeAws_restJson1UpdateScheduleCommandError(output, context);
3563
2988
  }
3564
- const contents = {
2989
+ const contents = map({
3565
2990
  $metadata: deserializeMetadata(output),
3566
- Name: undefined,
3567
- };
2991
+ });
3568
2992
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3569
- if (data.Name !== undefined && data.Name !== null) {
2993
+ if (data.Name != null) {
3570
2994
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
3571
2995
  }
3572
- return Promise.resolve(contents);
2996
+ return contents;
3573
2997
  };
3574
2998
  exports.deserializeAws_restJson1UpdateScheduleCommand = deserializeAws_restJson1UpdateScheduleCommand;
3575
2999
  const deserializeAws_restJson1UpdateScheduleCommandError = async (output, context) => {
@@ -3577,7 +3001,6 @@ const deserializeAws_restJson1UpdateScheduleCommandError = async (output, contex
3577
3001
  ...output,
3578
3002
  body: await parseBody(output.body, context),
3579
3003
  };
3580
- let response;
3581
3004
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3582
3005
  switch (errorCode) {
3583
3006
  case "ResourceNotFoundException":
@@ -3591,20 +3014,19 @@ const deserializeAws_restJson1UpdateScheduleCommandError = async (output, contex
3591
3014
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3592
3015
  default:
3593
3016
  const parsedBody = parsedOutput.body;
3594
- const $metadata = deserializeMetadata(output);
3595
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3596
- response = new DataBrewServiceException_1.DataBrewServiceException({
3597
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3598
- $fault: "client",
3599
- $metadata,
3017
+ (0, smithy_client_1.throwDefaultError)({
3018
+ output,
3019
+ parsedBody,
3020
+ exceptionCtor: DataBrewServiceException_1.DataBrewServiceException,
3021
+ errorCode,
3600
3022
  });
3601
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3602
3023
  }
3603
3024
  };
3025
+ const map = smithy_client_1.map;
3604
3026
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3605
- const contents = {};
3027
+ const contents = map({});
3606
3028
  const data = parsedOutput.body;
3607
- if (data.Message !== undefined && data.Message !== null) {
3029
+ if (data.Message != null) {
3608
3030
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3609
3031
  }
3610
3032
  const exception = new models_0_1.AccessDeniedException({
@@ -3614,9 +3036,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
3614
3036
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3615
3037
  };
3616
3038
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3617
- const contents = {};
3039
+ const contents = map({});
3618
3040
  const data = parsedOutput.body;
3619
- if (data.Message !== undefined && data.Message !== null) {
3041
+ if (data.Message != null) {
3620
3042
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3621
3043
  }
3622
3044
  const exception = new models_0_1.ConflictException({
@@ -3626,9 +3048,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
3626
3048
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3627
3049
  };
3628
3050
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
3629
- const contents = {};
3051
+ const contents = map({});
3630
3052
  const data = parsedOutput.body;
3631
- if (data.Message !== undefined && data.Message !== null) {
3053
+ if (data.Message != null) {
3632
3054
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3633
3055
  }
3634
3056
  const exception = new models_0_1.InternalServerException({
@@ -3638,9 +3060,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
3638
3060
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3639
3061
  };
3640
3062
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
3641
- const contents = {};
3063
+ const contents = map({});
3642
3064
  const data = parsedOutput.body;
3643
- if (data.Message !== undefined && data.Message !== null) {
3065
+ if (data.Message != null) {
3644
3066
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3645
3067
  }
3646
3068
  const exception = new models_0_1.ResourceNotFoundException({
@@ -3650,9 +3072,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
3650
3072
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3651
3073
  };
3652
3074
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
3653
- const contents = {};
3075
+ const contents = map({});
3654
3076
  const data = parsedOutput.body;
3655
- if (data.Message !== undefined && data.Message !== null) {
3077
+ if (data.Message != null) {
3656
3078
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3657
3079
  }
3658
3080
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -3662,9 +3084,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
3662
3084
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3663
3085
  };
3664
3086
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3665
- const contents = {};
3087
+ const contents = map({});
3666
3088
  const data = parsedOutput.body;
3667
- if (data.Message !== undefined && data.Message !== null) {
3089
+ if (data.Message != null) {
3668
3090
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3669
3091
  }
3670
3092
  const exception = new models_0_1.ValidationException({
@@ -3677,9 +3099,6 @@ const serializeAws_restJson1AllowedStatisticList = (input, context) => {
3677
3099
  return input
3678
3100
  .filter((e) => e != null)
3679
3101
  .map((entry) => {
3680
- if (entry === null) {
3681
- return null;
3682
- }
3683
3102
  return serializeAws_restJson1AllowedStatistics(entry, context);
3684
3103
  });
3685
3104
  };
@@ -3692,9 +3111,6 @@ const serializeAws_restJson1ColumnNameList = (input, context) => {
3692
3111
  return input
3693
3112
  .filter((e) => e != null)
3694
3113
  .map((entry) => {
3695
- if (entry === null) {
3696
- return null;
3697
- }
3698
3114
  return entry;
3699
3115
  });
3700
3116
  };
@@ -3708,9 +3124,6 @@ const serializeAws_restJson1ColumnSelectorList = (input, context) => {
3708
3124
  return input
3709
3125
  .filter((e) => e != null)
3710
3126
  .map((entry) => {
3711
- if (entry === null) {
3712
- return null;
3713
- }
3714
3127
  return serializeAws_restJson1ColumnSelector(entry, context);
3715
3128
  });
3716
3129
  };
@@ -3726,9 +3139,6 @@ const serializeAws_restJson1ColumnStatisticsConfigurationList = (input, context)
3726
3139
  return input
3727
3140
  .filter((e) => e != null)
3728
3141
  .map((entry) => {
3729
- if (entry === null) {
3730
- return null;
3731
- }
3732
3142
  return serializeAws_restJson1ColumnStatisticsConfiguration(entry, context);
3733
3143
  });
3734
3144
  };
@@ -3743,9 +3153,6 @@ const serializeAws_restJson1ConditionExpressionList = (input, context) => {
3743
3153
  return input
3744
3154
  .filter((e) => e != null)
3745
3155
  .map((entry) => {
3746
- if (entry === null) {
3747
- return null;
3748
- }
3749
3156
  return serializeAws_restJson1ConditionExpression(entry, context);
3750
3157
  });
3751
3158
  };
@@ -3783,9 +3190,6 @@ const serializeAws_restJson1DatabaseOutputList = (input, context) => {
3783
3190
  return input
3784
3191
  .filter((e) => e != null)
3785
3192
  .map((entry) => {
3786
- if (entry === null) {
3787
- return null;
3788
- }
3789
3193
  return serializeAws_restJson1DatabaseOutput(entry, context);
3790
3194
  });
3791
3195
  };
@@ -3823,9 +3227,6 @@ const serializeAws_restJson1DataCatalogOutputList = (input, context) => {
3823
3227
  return input
3824
3228
  .filter((e) => e != null)
3825
3229
  .map((entry) => {
3826
- if (entry === null) {
3827
- return null;
3828
- }
3829
3230
  return serializeAws_restJson1DataCatalogOutput(entry, context);
3830
3231
  });
3831
3232
  };
@@ -3859,9 +3260,6 @@ const serializeAws_restJson1EntityTypeList = (input, context) => {
3859
3260
  return input
3860
3261
  .filter((e) => e != null)
3861
3262
  .map((entry) => {
3862
- if (entry === null) {
3863
- return null;
3864
- }
3865
3263
  return entry;
3866
3264
  });
3867
3265
  };
@@ -3898,9 +3296,6 @@ const serializeAws_restJson1HiddenColumnList = (input, context) => {
3898
3296
  return input
3899
3297
  .filter((e) => e != null)
3900
3298
  .map((entry) => {
3901
- if (entry === null) {
3902
- return null;
3903
- }
3904
3299
  return entry;
3905
3300
  });
3906
3301
  };
@@ -3922,9 +3317,6 @@ const serializeAws_restJson1JobNameList = (input, context) => {
3922
3317
  return input
3923
3318
  .filter((e) => e != null)
3924
3319
  .map((entry) => {
3925
- if (entry === null) {
3926
- return null;
3927
- }
3928
3320
  return entry;
3929
3321
  });
3930
3322
  };
@@ -3968,9 +3360,6 @@ const serializeAws_restJson1OutputList = (input, context) => {
3968
3360
  return input
3969
3361
  .filter((e) => e != null)
3970
3362
  .map((entry) => {
3971
- if (entry === null) {
3972
- return null;
3973
- }
3974
3363
  return serializeAws_restJson1Output(entry, context);
3975
3364
  });
3976
3365
  };
@@ -4045,9 +3434,6 @@ const serializeAws_restJson1RecipeStepList = (input, context) => {
4045
3434
  return input
4046
3435
  .filter((e) => e != null)
4047
3436
  .map((entry) => {
4048
- if (entry === null) {
4049
- return null;
4050
- }
4051
3437
  return serializeAws_restJson1RecipeStep(entry, context);
4052
3438
  });
4053
3439
  };
@@ -4055,9 +3441,6 @@ const serializeAws_restJson1RecipeVersionList = (input, context) => {
4055
3441
  return input
4056
3442
  .filter((e) => e != null)
4057
3443
  .map((entry) => {
4058
- if (entry === null) {
4059
- return null;
4060
- }
4061
3444
  return entry;
4062
3445
  });
4063
3446
  };
@@ -4079,9 +3462,6 @@ const serializeAws_restJson1RuleList = (input, context) => {
4079
3462
  return input
4080
3463
  .filter((e) => e != null)
4081
3464
  .map((entry) => {
4082
- if (entry === null) {
4083
- return null;
4084
- }
4085
3465
  return serializeAws_restJson1Rule(entry, context);
4086
3466
  });
4087
3467
  };
@@ -4107,9 +3487,6 @@ const serializeAws_restJson1SheetIndexList = (input, context) => {
4107
3487
  return input
4108
3488
  .filter((e) => e != null)
4109
3489
  .map((entry) => {
4110
- if (entry === null) {
4111
- return null;
4112
- }
4113
3490
  return entry;
4114
3491
  });
4115
3492
  };
@@ -4117,9 +3494,6 @@ const serializeAws_restJson1SheetNameList = (input, context) => {
4117
3494
  return input
4118
3495
  .filter((e) => e != null)
4119
3496
  .map((entry) => {
4120
- if (entry === null) {
4121
- return null;
4122
- }
4123
3497
  return entry;
4124
3498
  });
4125
3499
  };
@@ -4127,9 +3501,6 @@ const serializeAws_restJson1StatisticList = (input, context) => {
4127
3501
  return input
4128
3502
  .filter((e) => e != null)
4129
3503
  .map((entry) => {
4130
- if (entry === null) {
4131
- return null;
4132
- }
4133
3504
  return entry;
4134
3505
  });
4135
3506
  };
@@ -4143,9 +3514,6 @@ const serializeAws_restJson1StatisticOverrideList = (input, context) => {
4143
3514
  return input
4144
3515
  .filter((e) => e != null)
4145
3516
  .map((entry) => {
4146
- if (entry === null) {
4147
- return null;
4148
- }
4149
3517
  return serializeAws_restJson1StatisticOverride(entry, context);
4150
3518
  });
4151
3519
  };
@@ -4187,9 +3555,6 @@ const serializeAws_restJson1ValidationConfigurationList = (input, context) => {
4187
3555
  return input
4188
3556
  .filter((e) => e != null)
4189
3557
  .map((entry) => {
4190
- if (entry === null) {
4191
- return null;
4192
- }
4193
3558
  return serializeAws_restJson1ValidationConfiguration(entry, context);
4194
3559
  });
4195
3560
  };