@aws-sdk/client-synthetics 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,16 +11,7 @@ const serializeAws_restJson1AssociateResourceCommand = async (input, context) =>
11
11
  "content-type": "application/json",
12
12
  };
13
13
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/group/{GroupIdentifier}/associate";
14
- if (input.GroupIdentifier !== undefined) {
15
- const labelValue = input.GroupIdentifier;
16
- if (labelValue.length <= 0) {
17
- throw new Error("Empty value provided for input HTTP label: GroupIdentifier.");
18
- }
19
- resolvedPath = resolvedPath.replace("{GroupIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
20
- }
21
- else {
22
- throw new Error("No value provided for input HTTP label: GroupIdentifier.");
23
- }
14
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GroupIdentifier", () => input.GroupIdentifier, "{GroupIdentifier}", false);
24
15
  let body;
25
16
  body = JSON.stringify({
26
17
  ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
@@ -100,19 +91,10 @@ const serializeAws_restJson1DeleteCanaryCommand = async (input, context) => {
100
91
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
92
  const headers = {};
102
93
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}";
103
- if (input.Name !== undefined) {
104
- const labelValue = input.Name;
105
- if (labelValue.length <= 0) {
106
- throw new Error("Empty value provided for input HTTP label: Name.");
107
- }
108
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
109
- }
110
- else {
111
- throw new Error("No value provided for input HTTP label: Name.");
112
- }
113
- const query = {
114
- ...(input.DeleteLambda !== undefined && { deleteLambda: input.DeleteLambda.toString() }),
115
- };
94
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
95
+ const query = map({
96
+ deleteLambda: [() => input.DeleteLambda !== void 0, () => input.DeleteLambda.toString()],
97
+ });
116
98
  let body;
117
99
  return new protocol_http_1.HttpRequest({
118
100
  protocol,
@@ -130,16 +112,7 @@ const serializeAws_restJson1DeleteGroupCommand = async (input, context) => {
130
112
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
131
113
  const headers = {};
132
114
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/group/{GroupIdentifier}";
133
- if (input.GroupIdentifier !== undefined) {
134
- const labelValue = input.GroupIdentifier;
135
- if (labelValue.length <= 0) {
136
- throw new Error("Empty value provided for input HTTP label: GroupIdentifier.");
137
- }
138
- resolvedPath = resolvedPath.replace("{GroupIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
139
- }
140
- else {
141
- throw new Error("No value provided for input HTTP label: GroupIdentifier.");
142
- }
115
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GroupIdentifier", () => input.GroupIdentifier, "{GroupIdentifier}", false);
143
116
  let body;
144
117
  return new protocol_http_1.HttpRequest({
145
118
  protocol,
@@ -228,16 +201,7 @@ const serializeAws_restJson1DisassociateResourceCommand = async (input, context)
228
201
  "content-type": "application/json",
229
202
  };
230
203
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/group/{GroupIdentifier}/disassociate";
231
- if (input.GroupIdentifier !== undefined) {
232
- const labelValue = input.GroupIdentifier;
233
- if (labelValue.length <= 0) {
234
- throw new Error("Empty value provided for input HTTP label: GroupIdentifier.");
235
- }
236
- resolvedPath = resolvedPath.replace("{GroupIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
237
- }
238
- else {
239
- throw new Error("No value provided for input HTTP label: GroupIdentifier.");
240
- }
204
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GroupIdentifier", () => input.GroupIdentifier, "{GroupIdentifier}", false);
241
205
  let body;
242
206
  body = JSON.stringify({
243
207
  ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
@@ -257,16 +221,7 @@ const serializeAws_restJson1GetCanaryCommand = async (input, context) => {
257
221
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
258
222
  const headers = {};
259
223
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}";
260
- if (input.Name !== undefined) {
261
- const labelValue = input.Name;
262
- if (labelValue.length <= 0) {
263
- throw new Error("Empty value provided for input HTTP label: Name.");
264
- }
265
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
266
- }
267
- else {
268
- throw new Error("No value provided for input HTTP label: Name.");
269
- }
224
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
270
225
  let body;
271
226
  return new protocol_http_1.HttpRequest({
272
227
  protocol,
@@ -285,16 +240,7 @@ const serializeAws_restJson1GetCanaryRunsCommand = async (input, context) => {
285
240
  "content-type": "application/json",
286
241
  };
287
242
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}/runs";
288
- if (input.Name !== undefined) {
289
- const labelValue = input.Name;
290
- if (labelValue.length <= 0) {
291
- throw new Error("Empty value provided for input HTTP label: Name.");
292
- }
293
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
294
- }
295
- else {
296
- throw new Error("No value provided for input HTTP label: Name.");
297
- }
243
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
298
244
  let body;
299
245
  body = JSON.stringify({
300
246
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -315,16 +261,7 @@ const serializeAws_restJson1GetGroupCommand = async (input, context) => {
315
261
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
316
262
  const headers = {};
317
263
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/group/{GroupIdentifier}";
318
- if (input.GroupIdentifier !== undefined) {
319
- const labelValue = input.GroupIdentifier;
320
- if (labelValue.length <= 0) {
321
- throw new Error("Empty value provided for input HTTP label: GroupIdentifier.");
322
- }
323
- resolvedPath = resolvedPath.replace("{GroupIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
324
- }
325
- else {
326
- throw new Error("No value provided for input HTTP label: GroupIdentifier.");
327
- }
264
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GroupIdentifier", () => input.GroupIdentifier, "{GroupIdentifier}", false);
328
265
  let body;
329
266
  return new protocol_http_1.HttpRequest({
330
267
  protocol,
@@ -343,16 +280,7 @@ const serializeAws_restJson1ListAssociatedGroupsCommand = async (input, context)
343
280
  "content-type": "application/json",
344
281
  };
345
282
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/resource/{ResourceArn}/groups";
346
- if (input.ResourceArn !== undefined) {
347
- const labelValue = input.ResourceArn;
348
- if (labelValue.length <= 0) {
349
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
350
- }
351
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
352
- }
353
- else {
354
- throw new Error("No value provided for input HTTP label: ResourceArn.");
355
- }
283
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
356
284
  let body;
357
285
  body = JSON.stringify({
358
286
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -375,16 +303,7 @@ const serializeAws_restJson1ListGroupResourcesCommand = async (input, context) =
375
303
  "content-type": "application/json",
376
304
  };
377
305
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/group/{GroupIdentifier}/resources";
378
- if (input.GroupIdentifier !== undefined) {
379
- const labelValue = input.GroupIdentifier;
380
- if (labelValue.length <= 0) {
381
- throw new Error("Empty value provided for input HTTP label: GroupIdentifier.");
382
- }
383
- resolvedPath = resolvedPath.replace("{GroupIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
384
- }
385
- else {
386
- throw new Error("No value provided for input HTTP label: GroupIdentifier.");
387
- }
306
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GroupIdentifier", () => input.GroupIdentifier, "{GroupIdentifier}", false);
388
307
  let body;
389
308
  body = JSON.stringify({
390
309
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -427,16 +346,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
427
346
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
428
347
  const headers = {};
429
348
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
430
- if (input.ResourceArn !== undefined) {
431
- const labelValue = input.ResourceArn;
432
- if (labelValue.length <= 0) {
433
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
434
- }
435
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
436
- }
437
- else {
438
- throw new Error("No value provided for input HTTP label: ResourceArn.");
439
- }
349
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
440
350
  let body;
441
351
  return new protocol_http_1.HttpRequest({
442
352
  protocol,
@@ -453,16 +363,7 @@ const serializeAws_restJson1StartCanaryCommand = async (input, context) => {
453
363
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
454
364
  const headers = {};
455
365
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}/start";
456
- if (input.Name !== undefined) {
457
- const labelValue = input.Name;
458
- if (labelValue.length <= 0) {
459
- throw new Error("Empty value provided for input HTTP label: Name.");
460
- }
461
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
462
- }
463
- else {
464
- throw new Error("No value provided for input HTTP label: Name.");
465
- }
366
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
466
367
  let body;
467
368
  return new protocol_http_1.HttpRequest({
468
369
  protocol,
@@ -479,16 +380,7 @@ const serializeAws_restJson1StopCanaryCommand = async (input, context) => {
479
380
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
480
381
  const headers = {};
481
382
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}/stop";
482
- if (input.Name !== undefined) {
483
- const labelValue = input.Name;
484
- if (labelValue.length <= 0) {
485
- throw new Error("Empty value provided for input HTTP label: Name.");
486
- }
487
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
488
- }
489
- else {
490
- throw new Error("No value provided for input HTTP label: Name.");
491
- }
383
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
492
384
  let body;
493
385
  return new protocol_http_1.HttpRequest({
494
386
  protocol,
@@ -507,16 +399,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
507
399
  "content-type": "application/json",
508
400
  };
509
401
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
510
- if (input.ResourceArn !== undefined) {
511
- const labelValue = input.ResourceArn;
512
- if (labelValue.length <= 0) {
513
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
514
- }
515
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
516
- }
517
- else {
518
- throw new Error("No value provided for input HTTP label: ResourceArn.");
519
- }
402
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
520
403
  let body;
521
404
  body = JSON.stringify({
522
405
  ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
@@ -536,19 +419,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
536
419
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
537
420
  const headers = {};
538
421
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
539
- if (input.ResourceArn !== undefined) {
540
- const labelValue = input.ResourceArn;
541
- if (labelValue.length <= 0) {
542
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
543
- }
544
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
545
- }
546
- else {
547
- throw new Error("No value provided for input HTTP label: ResourceArn.");
548
- }
549
- const query = {
550
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
551
- };
422
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
423
+ const query = map({
424
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
425
+ });
552
426
  let body;
553
427
  return new protocol_http_1.HttpRequest({
554
428
  protocol,
@@ -568,16 +442,7 @@ const serializeAws_restJson1UpdateCanaryCommand = async (input, context) => {
568
442
  "content-type": "application/json",
569
443
  };
570
444
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/canary/{Name}";
571
- if (input.Name !== undefined) {
572
- const labelValue = input.Name;
573
- if (labelValue.length <= 0) {
574
- throw new Error("Empty value provided for input HTTP label: Name.");
575
- }
576
- resolvedPath = resolvedPath.replace("{Name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
577
- }
578
- else {
579
- throw new Error("No value provided for input HTTP label: Name.");
580
- }
445
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
581
446
  let body;
582
447
  body = JSON.stringify({
583
448
  ...(input.ArtifactConfig != null && {
@@ -615,11 +480,11 @@ const deserializeAws_restJson1AssociateResourceCommand = async (output, context)
615
480
  if (output.statusCode !== 200 && output.statusCode >= 300) {
616
481
  return deserializeAws_restJson1AssociateResourceCommandError(output, context);
617
482
  }
618
- const contents = {
483
+ const contents = map({
619
484
  $metadata: deserializeMetadata(output),
620
- };
485
+ });
621
486
  await collectBody(output.body, context);
622
- return Promise.resolve(contents);
487
+ return contents;
623
488
  };
624
489
  exports.deserializeAws_restJson1AssociateResourceCommand = deserializeAws_restJson1AssociateResourceCommand;
625
490
  const deserializeAws_restJson1AssociateResourceCommandError = async (output, context) => {
@@ -627,7 +492,6 @@ const deserializeAws_restJson1AssociateResourceCommandError = async (output, con
627
492
  ...output,
628
493
  body: await parseBody(output.body, context),
629
494
  };
630
- let response;
631
495
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
632
496
  switch (errorCode) {
633
497
  case "ConflictException":
@@ -647,29 +511,26 @@ const deserializeAws_restJson1AssociateResourceCommandError = async (output, con
647
511
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
648
512
  default:
649
513
  const parsedBody = parsedOutput.body;
650
- const $metadata = deserializeMetadata(output);
651
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
652
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
653
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
654
- $fault: "client",
655
- $metadata,
514
+ (0, smithy_client_1.throwDefaultError)({
515
+ output,
516
+ parsedBody,
517
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
518
+ errorCode,
656
519
  });
657
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
658
520
  }
659
521
  };
660
522
  const deserializeAws_restJson1CreateCanaryCommand = async (output, context) => {
661
523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
662
524
  return deserializeAws_restJson1CreateCanaryCommandError(output, context);
663
525
  }
664
- const contents = {
526
+ const contents = map({
665
527
  $metadata: deserializeMetadata(output),
666
- Canary: undefined,
667
- };
528
+ });
668
529
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
669
- if (data.Canary !== undefined && data.Canary !== null) {
530
+ if (data.Canary != null) {
670
531
  contents.Canary = deserializeAws_restJson1Canary(data.Canary, context);
671
532
  }
672
- return Promise.resolve(contents);
533
+ return contents;
673
534
  };
674
535
  exports.deserializeAws_restJson1CreateCanaryCommand = deserializeAws_restJson1CreateCanaryCommand;
675
536
  const deserializeAws_restJson1CreateCanaryCommandError = async (output, context) => {
@@ -677,7 +538,6 @@ const deserializeAws_restJson1CreateCanaryCommandError = async (output, context)
677
538
  ...output,
678
539
  body: await parseBody(output.body, context),
679
540
  };
680
- let response;
681
541
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
682
542
  switch (errorCode) {
683
543
  case "InternalServerException":
@@ -691,29 +551,26 @@ const deserializeAws_restJson1CreateCanaryCommandError = async (output, context)
691
551
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
692
552
  default:
693
553
  const parsedBody = parsedOutput.body;
694
- const $metadata = deserializeMetadata(output);
695
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
696
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
697
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
698
- $fault: "client",
699
- $metadata,
554
+ (0, smithy_client_1.throwDefaultError)({
555
+ output,
556
+ parsedBody,
557
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
558
+ errorCode,
700
559
  });
701
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
702
560
  }
703
561
  };
704
562
  const deserializeAws_restJson1CreateGroupCommand = async (output, context) => {
705
563
  if (output.statusCode !== 200 && output.statusCode >= 300) {
706
564
  return deserializeAws_restJson1CreateGroupCommandError(output, context);
707
565
  }
708
- const contents = {
566
+ const contents = map({
709
567
  $metadata: deserializeMetadata(output),
710
- Group: undefined,
711
- };
568
+ });
712
569
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
713
- if (data.Group !== undefined && data.Group !== null) {
570
+ if (data.Group != null) {
714
571
  contents.Group = deserializeAws_restJson1Group(data.Group, context);
715
572
  }
716
- return Promise.resolve(contents);
573
+ return contents;
717
574
  };
718
575
  exports.deserializeAws_restJson1CreateGroupCommand = deserializeAws_restJson1CreateGroupCommand;
719
576
  const deserializeAws_restJson1CreateGroupCommandError = async (output, context) => {
@@ -721,7 +578,6 @@ const deserializeAws_restJson1CreateGroupCommandError = async (output, context)
721
578
  ...output,
722
579
  body: await parseBody(output.body, context),
723
580
  };
724
- let response;
725
581
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
726
582
  switch (errorCode) {
727
583
  case "ConflictException":
@@ -738,25 +594,23 @@ const deserializeAws_restJson1CreateGroupCommandError = async (output, context)
738
594
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
739
595
  default:
740
596
  const parsedBody = parsedOutput.body;
741
- const $metadata = deserializeMetadata(output);
742
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
743
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
744
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
745
- $fault: "client",
746
- $metadata,
597
+ (0, smithy_client_1.throwDefaultError)({
598
+ output,
599
+ parsedBody,
600
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
601
+ errorCode,
747
602
  });
748
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
749
603
  }
750
604
  };
751
605
  const deserializeAws_restJson1DeleteCanaryCommand = async (output, context) => {
752
606
  if (output.statusCode !== 200 && output.statusCode >= 300) {
753
607
  return deserializeAws_restJson1DeleteCanaryCommandError(output, context);
754
608
  }
755
- const contents = {
609
+ const contents = map({
756
610
  $metadata: deserializeMetadata(output),
757
- };
611
+ });
758
612
  await collectBody(output.body, context);
759
- return Promise.resolve(contents);
613
+ return contents;
760
614
  };
761
615
  exports.deserializeAws_restJson1DeleteCanaryCommand = deserializeAws_restJson1DeleteCanaryCommand;
762
616
  const deserializeAws_restJson1DeleteCanaryCommandError = async (output, context) => {
@@ -764,7 +618,6 @@ const deserializeAws_restJson1DeleteCanaryCommandError = async (output, context)
764
618
  ...output,
765
619
  body: await parseBody(output.body, context),
766
620
  };
767
- let response;
768
621
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
769
622
  switch (errorCode) {
770
623
  case "ConflictException":
@@ -781,25 +634,23 @@ const deserializeAws_restJson1DeleteCanaryCommandError = async (output, context)
781
634
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
782
635
  default:
783
636
  const parsedBody = parsedOutput.body;
784
- const $metadata = deserializeMetadata(output);
785
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
786
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
787
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
788
- $fault: "client",
789
- $metadata,
637
+ (0, smithy_client_1.throwDefaultError)({
638
+ output,
639
+ parsedBody,
640
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
641
+ errorCode,
790
642
  });
791
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
792
643
  }
793
644
  };
794
645
  const deserializeAws_restJson1DeleteGroupCommand = async (output, context) => {
795
646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
796
647
  return deserializeAws_restJson1DeleteGroupCommandError(output, context);
797
648
  }
798
- const contents = {
649
+ const contents = map({
799
650
  $metadata: deserializeMetadata(output),
800
- };
651
+ });
801
652
  await collectBody(output.body, context);
802
- return Promise.resolve(contents);
653
+ return contents;
803
654
  };
804
655
  exports.deserializeAws_restJson1DeleteGroupCommand = deserializeAws_restJson1DeleteGroupCommand;
805
656
  const deserializeAws_restJson1DeleteGroupCommandError = async (output, context) => {
@@ -807,7 +658,6 @@ const deserializeAws_restJson1DeleteGroupCommandError = async (output, context)
807
658
  ...output,
808
659
  body: await parseBody(output.body, context),
809
660
  };
810
- let response;
811
661
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
812
662
  switch (errorCode) {
813
663
  case "ConflictException":
@@ -824,33 +674,29 @@ const deserializeAws_restJson1DeleteGroupCommandError = async (output, context)
824
674
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
825
675
  default:
826
676
  const parsedBody = parsedOutput.body;
827
- const $metadata = deserializeMetadata(output);
828
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
829
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
830
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
831
- $fault: "client",
832
- $metadata,
677
+ (0, smithy_client_1.throwDefaultError)({
678
+ output,
679
+ parsedBody,
680
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
681
+ errorCode,
833
682
  });
834
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
835
683
  }
836
684
  };
837
685
  const deserializeAws_restJson1DescribeCanariesCommand = async (output, context) => {
838
686
  if (output.statusCode !== 200 && output.statusCode >= 300) {
839
687
  return deserializeAws_restJson1DescribeCanariesCommandError(output, context);
840
688
  }
841
- const contents = {
689
+ const contents = map({
842
690
  $metadata: deserializeMetadata(output),
843
- Canaries: undefined,
844
- NextToken: undefined,
845
- };
691
+ });
846
692
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
847
- if (data.Canaries !== undefined && data.Canaries !== null) {
693
+ if (data.Canaries != null) {
848
694
  contents.Canaries = deserializeAws_restJson1Canaries(data.Canaries, context);
849
695
  }
850
- if (data.NextToken !== undefined && data.NextToken !== null) {
696
+ if (data.NextToken != null) {
851
697
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
852
698
  }
853
- return Promise.resolve(contents);
699
+ return contents;
854
700
  };
855
701
  exports.deserializeAws_restJson1DescribeCanariesCommand = deserializeAws_restJson1DescribeCanariesCommand;
856
702
  const deserializeAws_restJson1DescribeCanariesCommandError = async (output, context) => {
@@ -858,7 +704,6 @@ const deserializeAws_restJson1DescribeCanariesCommandError = async (output, cont
858
704
  ...output,
859
705
  body: await parseBody(output.body, context),
860
706
  };
861
- let response;
862
707
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
863
708
  switch (errorCode) {
864
709
  case "InternalServerException":
@@ -869,33 +714,29 @@ const deserializeAws_restJson1DescribeCanariesCommandError = async (output, cont
869
714
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
870
715
  default:
871
716
  const parsedBody = parsedOutput.body;
872
- const $metadata = deserializeMetadata(output);
873
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
874
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
875
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
876
- $fault: "client",
877
- $metadata,
717
+ (0, smithy_client_1.throwDefaultError)({
718
+ output,
719
+ parsedBody,
720
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
721
+ errorCode,
878
722
  });
879
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
880
723
  }
881
724
  };
882
725
  const deserializeAws_restJson1DescribeCanariesLastRunCommand = async (output, context) => {
883
726
  if (output.statusCode !== 200 && output.statusCode >= 300) {
884
727
  return deserializeAws_restJson1DescribeCanariesLastRunCommandError(output, context);
885
728
  }
886
- const contents = {
729
+ const contents = map({
887
730
  $metadata: deserializeMetadata(output),
888
- CanariesLastRun: undefined,
889
- NextToken: undefined,
890
- };
731
+ });
891
732
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
892
- if (data.CanariesLastRun !== undefined && data.CanariesLastRun !== null) {
733
+ if (data.CanariesLastRun != null) {
893
734
  contents.CanariesLastRun = deserializeAws_restJson1CanariesLastRun(data.CanariesLastRun, context);
894
735
  }
895
- if (data.NextToken !== undefined && data.NextToken !== null) {
736
+ if (data.NextToken != null) {
896
737
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
897
738
  }
898
- return Promise.resolve(contents);
739
+ return contents;
899
740
  };
900
741
  exports.deserializeAws_restJson1DescribeCanariesLastRunCommand = deserializeAws_restJson1DescribeCanariesLastRunCommand;
901
742
  const deserializeAws_restJson1DescribeCanariesLastRunCommandError = async (output, context) => {
@@ -903,7 +744,6 @@ const deserializeAws_restJson1DescribeCanariesLastRunCommandError = async (outpu
903
744
  ...output,
904
745
  body: await parseBody(output.body, context),
905
746
  };
906
- let response;
907
747
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
908
748
  switch (errorCode) {
909
749
  case "InternalServerException":
@@ -914,33 +754,29 @@ const deserializeAws_restJson1DescribeCanariesLastRunCommandError = async (outpu
914
754
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
915
755
  default:
916
756
  const parsedBody = parsedOutput.body;
917
- const $metadata = deserializeMetadata(output);
918
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
919
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
920
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
921
- $fault: "client",
922
- $metadata,
757
+ (0, smithy_client_1.throwDefaultError)({
758
+ output,
759
+ parsedBody,
760
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
761
+ errorCode,
923
762
  });
924
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
925
763
  }
926
764
  };
927
765
  const deserializeAws_restJson1DescribeRuntimeVersionsCommand = async (output, context) => {
928
766
  if (output.statusCode !== 200 && output.statusCode >= 300) {
929
767
  return deserializeAws_restJson1DescribeRuntimeVersionsCommandError(output, context);
930
768
  }
931
- const contents = {
769
+ const contents = map({
932
770
  $metadata: deserializeMetadata(output),
933
- NextToken: undefined,
934
- RuntimeVersions: undefined,
935
- };
771
+ });
936
772
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
937
- if (data.NextToken !== undefined && data.NextToken !== null) {
773
+ if (data.NextToken != null) {
938
774
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
939
775
  }
940
- if (data.RuntimeVersions !== undefined && data.RuntimeVersions !== null) {
776
+ if (data.RuntimeVersions != null) {
941
777
  contents.RuntimeVersions = deserializeAws_restJson1RuntimeVersionList(data.RuntimeVersions, context);
942
778
  }
943
- return Promise.resolve(contents);
779
+ return contents;
944
780
  };
945
781
  exports.deserializeAws_restJson1DescribeRuntimeVersionsCommand = deserializeAws_restJson1DescribeRuntimeVersionsCommand;
946
782
  const deserializeAws_restJson1DescribeRuntimeVersionsCommandError = async (output, context) => {
@@ -948,7 +784,6 @@ const deserializeAws_restJson1DescribeRuntimeVersionsCommandError = async (outpu
948
784
  ...output,
949
785
  body: await parseBody(output.body, context),
950
786
  };
951
- let response;
952
787
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
953
788
  switch (errorCode) {
954
789
  case "InternalServerException":
@@ -959,25 +794,23 @@ const deserializeAws_restJson1DescribeRuntimeVersionsCommandError = async (outpu
959
794
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
960
795
  default:
961
796
  const parsedBody = parsedOutput.body;
962
- const $metadata = deserializeMetadata(output);
963
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
964
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
965
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
966
- $fault: "client",
967
- $metadata,
797
+ (0, smithy_client_1.throwDefaultError)({
798
+ output,
799
+ parsedBody,
800
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
801
+ errorCode,
968
802
  });
969
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
970
803
  }
971
804
  };
972
805
  const deserializeAws_restJson1DisassociateResourceCommand = async (output, context) => {
973
806
  if (output.statusCode !== 200 && output.statusCode >= 300) {
974
807
  return deserializeAws_restJson1DisassociateResourceCommandError(output, context);
975
808
  }
976
- const contents = {
809
+ const contents = map({
977
810
  $metadata: deserializeMetadata(output),
978
- };
811
+ });
979
812
  await collectBody(output.body, context);
980
- return Promise.resolve(contents);
813
+ return contents;
981
814
  };
982
815
  exports.deserializeAws_restJson1DisassociateResourceCommand = deserializeAws_restJson1DisassociateResourceCommand;
983
816
  const deserializeAws_restJson1DisassociateResourceCommandError = async (output, context) => {
@@ -985,7 +818,6 @@ const deserializeAws_restJson1DisassociateResourceCommandError = async (output,
985
818
  ...output,
986
819
  body: await parseBody(output.body, context),
987
820
  };
988
- let response;
989
821
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
990
822
  switch (errorCode) {
991
823
  case "ConflictException":
@@ -1002,29 +834,26 @@ const deserializeAws_restJson1DisassociateResourceCommandError = async (output,
1002
834
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1003
835
  default:
1004
836
  const parsedBody = parsedOutput.body;
1005
- const $metadata = deserializeMetadata(output);
1006
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1007
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1008
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1009
- $fault: "client",
1010
- $metadata,
837
+ (0, smithy_client_1.throwDefaultError)({
838
+ output,
839
+ parsedBody,
840
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
841
+ errorCode,
1011
842
  });
1012
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1013
843
  }
1014
844
  };
1015
845
  const deserializeAws_restJson1GetCanaryCommand = async (output, context) => {
1016
846
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1017
847
  return deserializeAws_restJson1GetCanaryCommandError(output, context);
1018
848
  }
1019
- const contents = {
849
+ const contents = map({
1020
850
  $metadata: deserializeMetadata(output),
1021
- Canary: undefined,
1022
- };
851
+ });
1023
852
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1024
- if (data.Canary !== undefined && data.Canary !== null) {
853
+ if (data.Canary != null) {
1025
854
  contents.Canary = deserializeAws_restJson1Canary(data.Canary, context);
1026
855
  }
1027
- return Promise.resolve(contents);
856
+ return contents;
1028
857
  };
1029
858
  exports.deserializeAws_restJson1GetCanaryCommand = deserializeAws_restJson1GetCanaryCommand;
1030
859
  const deserializeAws_restJson1GetCanaryCommandError = async (output, context) => {
@@ -1032,7 +861,6 @@ const deserializeAws_restJson1GetCanaryCommandError = async (output, context) =>
1032
861
  ...output,
1033
862
  body: await parseBody(output.body, context),
1034
863
  };
1035
- let response;
1036
864
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1037
865
  switch (errorCode) {
1038
866
  case "InternalServerException":
@@ -1043,33 +871,29 @@ const deserializeAws_restJson1GetCanaryCommandError = async (output, context) =>
1043
871
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1044
872
  default:
1045
873
  const parsedBody = parsedOutput.body;
1046
- const $metadata = deserializeMetadata(output);
1047
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1048
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1049
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1050
- $fault: "client",
1051
- $metadata,
874
+ (0, smithy_client_1.throwDefaultError)({
875
+ output,
876
+ parsedBody,
877
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
878
+ errorCode,
1052
879
  });
1053
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1054
880
  }
1055
881
  };
1056
882
  const deserializeAws_restJson1GetCanaryRunsCommand = async (output, context) => {
1057
883
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1058
884
  return deserializeAws_restJson1GetCanaryRunsCommandError(output, context);
1059
885
  }
1060
- const contents = {
886
+ const contents = map({
1061
887
  $metadata: deserializeMetadata(output),
1062
- CanaryRuns: undefined,
1063
- NextToken: undefined,
1064
- };
888
+ });
1065
889
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1066
- if (data.CanaryRuns !== undefined && data.CanaryRuns !== null) {
890
+ if (data.CanaryRuns != null) {
1067
891
  contents.CanaryRuns = deserializeAws_restJson1CanaryRuns(data.CanaryRuns, context);
1068
892
  }
1069
- if (data.NextToken !== undefined && data.NextToken !== null) {
893
+ if (data.NextToken != null) {
1070
894
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1071
895
  }
1072
- return Promise.resolve(contents);
896
+ return contents;
1073
897
  };
1074
898
  exports.deserializeAws_restJson1GetCanaryRunsCommand = deserializeAws_restJson1GetCanaryRunsCommand;
1075
899
  const deserializeAws_restJson1GetCanaryRunsCommandError = async (output, context) => {
@@ -1077,7 +901,6 @@ const deserializeAws_restJson1GetCanaryRunsCommandError = async (output, context
1077
901
  ...output,
1078
902
  body: await parseBody(output.body, context),
1079
903
  };
1080
- let response;
1081
904
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1082
905
  switch (errorCode) {
1083
906
  case "InternalServerException":
@@ -1091,29 +914,26 @@ const deserializeAws_restJson1GetCanaryRunsCommandError = async (output, context
1091
914
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1092
915
  default:
1093
916
  const parsedBody = parsedOutput.body;
1094
- const $metadata = deserializeMetadata(output);
1095
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1096
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1097
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1098
- $fault: "client",
1099
- $metadata,
917
+ (0, smithy_client_1.throwDefaultError)({
918
+ output,
919
+ parsedBody,
920
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
921
+ errorCode,
1100
922
  });
1101
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1102
923
  }
1103
924
  };
1104
925
  const deserializeAws_restJson1GetGroupCommand = async (output, context) => {
1105
926
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1106
927
  return deserializeAws_restJson1GetGroupCommandError(output, context);
1107
928
  }
1108
- const contents = {
929
+ const contents = map({
1109
930
  $metadata: deserializeMetadata(output),
1110
- Group: undefined,
1111
- };
931
+ });
1112
932
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1113
- if (data.Group !== undefined && data.Group !== null) {
933
+ if (data.Group != null) {
1114
934
  contents.Group = deserializeAws_restJson1Group(data.Group, context);
1115
935
  }
1116
- return Promise.resolve(contents);
936
+ return contents;
1117
937
  };
1118
938
  exports.deserializeAws_restJson1GetGroupCommand = deserializeAws_restJson1GetGroupCommand;
1119
939
  const deserializeAws_restJson1GetGroupCommandError = async (output, context) => {
@@ -1121,7 +941,6 @@ const deserializeAws_restJson1GetGroupCommandError = async (output, context) =>
1121
941
  ...output,
1122
942
  body: await parseBody(output.body, context),
1123
943
  };
1124
- let response;
1125
944
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1126
945
  switch (errorCode) {
1127
946
  case "ConflictException":
@@ -1138,33 +957,29 @@ const deserializeAws_restJson1GetGroupCommandError = async (output, context) =>
1138
957
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1139
958
  default:
1140
959
  const parsedBody = parsedOutput.body;
1141
- const $metadata = deserializeMetadata(output);
1142
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1143
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1144
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1145
- $fault: "client",
1146
- $metadata,
960
+ (0, smithy_client_1.throwDefaultError)({
961
+ output,
962
+ parsedBody,
963
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
964
+ errorCode,
1147
965
  });
1148
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1149
966
  }
1150
967
  };
1151
968
  const deserializeAws_restJson1ListAssociatedGroupsCommand = async (output, context) => {
1152
969
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1153
970
  return deserializeAws_restJson1ListAssociatedGroupsCommandError(output, context);
1154
971
  }
1155
- const contents = {
972
+ const contents = map({
1156
973
  $metadata: deserializeMetadata(output),
1157
- Groups: undefined,
1158
- NextToken: undefined,
1159
- };
974
+ });
1160
975
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1161
- if (data.Groups !== undefined && data.Groups !== null) {
976
+ if (data.Groups != null) {
1162
977
  contents.Groups = deserializeAws_restJson1GroupSummaryList(data.Groups, context);
1163
978
  }
1164
- if (data.NextToken !== undefined && data.NextToken !== null) {
979
+ if (data.NextToken != null) {
1165
980
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1166
981
  }
1167
- return Promise.resolve(contents);
982
+ return contents;
1168
983
  };
1169
984
  exports.deserializeAws_restJson1ListAssociatedGroupsCommand = deserializeAws_restJson1ListAssociatedGroupsCommand;
1170
985
  const deserializeAws_restJson1ListAssociatedGroupsCommandError = async (output, context) => {
@@ -1172,7 +987,6 @@ const deserializeAws_restJson1ListAssociatedGroupsCommandError = async (output,
1172
987
  ...output,
1173
988
  body: await parseBody(output.body, context),
1174
989
  };
1175
- let response;
1176
990
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1177
991
  switch (errorCode) {
1178
992
  case "InternalServerException":
@@ -1186,33 +1000,29 @@ const deserializeAws_restJson1ListAssociatedGroupsCommandError = async (output,
1186
1000
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1187
1001
  default:
1188
1002
  const parsedBody = parsedOutput.body;
1189
- const $metadata = deserializeMetadata(output);
1190
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1191
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1192
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1193
- $fault: "client",
1194
- $metadata,
1003
+ (0, smithy_client_1.throwDefaultError)({
1004
+ output,
1005
+ parsedBody,
1006
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1007
+ errorCode,
1195
1008
  });
1196
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1197
1009
  }
1198
1010
  };
1199
1011
  const deserializeAws_restJson1ListGroupResourcesCommand = async (output, context) => {
1200
1012
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1201
1013
  return deserializeAws_restJson1ListGroupResourcesCommandError(output, context);
1202
1014
  }
1203
- const contents = {
1015
+ const contents = map({
1204
1016
  $metadata: deserializeMetadata(output),
1205
- NextToken: undefined,
1206
- Resources: undefined,
1207
- };
1017
+ });
1208
1018
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1209
- if (data.NextToken !== undefined && data.NextToken !== null) {
1019
+ if (data.NextToken != null) {
1210
1020
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1211
1021
  }
1212
- if (data.Resources !== undefined && data.Resources !== null) {
1022
+ if (data.Resources != null) {
1213
1023
  contents.Resources = deserializeAws_restJson1StringList(data.Resources, context);
1214
1024
  }
1215
- return Promise.resolve(contents);
1025
+ return contents;
1216
1026
  };
1217
1027
  exports.deserializeAws_restJson1ListGroupResourcesCommand = deserializeAws_restJson1ListGroupResourcesCommand;
1218
1028
  const deserializeAws_restJson1ListGroupResourcesCommandError = async (output, context) => {
@@ -1220,7 +1030,6 @@ const deserializeAws_restJson1ListGroupResourcesCommandError = async (output, co
1220
1030
  ...output,
1221
1031
  body: await parseBody(output.body, context),
1222
1032
  };
1223
- let response;
1224
1033
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1225
1034
  switch (errorCode) {
1226
1035
  case "ConflictException":
@@ -1237,33 +1046,29 @@ const deserializeAws_restJson1ListGroupResourcesCommandError = async (output, co
1237
1046
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1238
1047
  default:
1239
1048
  const parsedBody = parsedOutput.body;
1240
- const $metadata = deserializeMetadata(output);
1241
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1242
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1243
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1244
- $fault: "client",
1245
- $metadata,
1049
+ (0, smithy_client_1.throwDefaultError)({
1050
+ output,
1051
+ parsedBody,
1052
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1053
+ errorCode,
1246
1054
  });
1247
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1248
1055
  }
1249
1056
  };
1250
1057
  const deserializeAws_restJson1ListGroupsCommand = async (output, context) => {
1251
1058
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1252
1059
  return deserializeAws_restJson1ListGroupsCommandError(output, context);
1253
1060
  }
1254
- const contents = {
1061
+ const contents = map({
1255
1062
  $metadata: deserializeMetadata(output),
1256
- Groups: undefined,
1257
- NextToken: undefined,
1258
- };
1063
+ });
1259
1064
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1260
- if (data.Groups !== undefined && data.Groups !== null) {
1065
+ if (data.Groups != null) {
1261
1066
  contents.Groups = deserializeAws_restJson1GroupSummaryList(data.Groups, context);
1262
1067
  }
1263
- if (data.NextToken !== undefined && data.NextToken !== null) {
1068
+ if (data.NextToken != null) {
1264
1069
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1265
1070
  }
1266
- return Promise.resolve(contents);
1071
+ return contents;
1267
1072
  };
1268
1073
  exports.deserializeAws_restJson1ListGroupsCommand = deserializeAws_restJson1ListGroupsCommand;
1269
1074
  const deserializeAws_restJson1ListGroupsCommandError = async (output, context) => {
@@ -1271,7 +1076,6 @@ const deserializeAws_restJson1ListGroupsCommandError = async (output, context) =
1271
1076
  ...output,
1272
1077
  body: await parseBody(output.body, context),
1273
1078
  };
1274
- let response;
1275
1079
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1276
1080
  switch (errorCode) {
1277
1081
  case "InternalServerException":
@@ -1282,29 +1086,26 @@ const deserializeAws_restJson1ListGroupsCommandError = async (output, context) =
1282
1086
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1283
1087
  default:
1284
1088
  const parsedBody = parsedOutput.body;
1285
- const $metadata = deserializeMetadata(output);
1286
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1287
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1288
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1289
- $fault: "client",
1290
- $metadata,
1089
+ (0, smithy_client_1.throwDefaultError)({
1090
+ output,
1091
+ parsedBody,
1092
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1093
+ errorCode,
1291
1094
  });
1292
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1293
1095
  }
1294
1096
  };
1295
1097
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1296
1098
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1297
1099
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1298
1100
  }
1299
- const contents = {
1101
+ const contents = map({
1300
1102
  $metadata: deserializeMetadata(output),
1301
- Tags: undefined,
1302
- };
1103
+ });
1303
1104
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1304
- if (data.Tags !== undefined && data.Tags !== null) {
1105
+ if (data.Tags != null) {
1305
1106
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1306
1107
  }
1307
- return Promise.resolve(contents);
1108
+ return contents;
1308
1109
  };
1309
1110
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1310
1111
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1312,7 +1113,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1312
1113
  ...output,
1313
1114
  body: await parseBody(output.body, context),
1314
1115
  };
1315
- let response;
1316
1116
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1317
1117
  switch (errorCode) {
1318
1118
  case "BadRequestException":
@@ -1332,25 +1132,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1332
1132
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1333
1133
  default:
1334
1134
  const parsedBody = parsedOutput.body;
1335
- const $metadata = deserializeMetadata(output);
1336
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1337
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1338
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1339
- $fault: "client",
1340
- $metadata,
1135
+ (0, smithy_client_1.throwDefaultError)({
1136
+ output,
1137
+ parsedBody,
1138
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1139
+ errorCode,
1341
1140
  });
1342
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1343
1141
  }
1344
1142
  };
1345
1143
  const deserializeAws_restJson1StartCanaryCommand = async (output, context) => {
1346
1144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1347
1145
  return deserializeAws_restJson1StartCanaryCommandError(output, context);
1348
1146
  }
1349
- const contents = {
1147
+ const contents = map({
1350
1148
  $metadata: deserializeMetadata(output),
1351
- };
1149
+ });
1352
1150
  await collectBody(output.body, context);
1353
- return Promise.resolve(contents);
1151
+ return contents;
1354
1152
  };
1355
1153
  exports.deserializeAws_restJson1StartCanaryCommand = deserializeAws_restJson1StartCanaryCommand;
1356
1154
  const deserializeAws_restJson1StartCanaryCommandError = async (output, context) => {
@@ -1358,7 +1156,6 @@ const deserializeAws_restJson1StartCanaryCommandError = async (output, context)
1358
1156
  ...output,
1359
1157
  body: await parseBody(output.body, context),
1360
1158
  };
1361
- let response;
1362
1159
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1363
1160
  switch (errorCode) {
1364
1161
  case "ConflictException":
@@ -1375,25 +1172,23 @@ const deserializeAws_restJson1StartCanaryCommandError = async (output, context)
1375
1172
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1376
1173
  default:
1377
1174
  const parsedBody = parsedOutput.body;
1378
- const $metadata = deserializeMetadata(output);
1379
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1380
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1381
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1382
- $fault: "client",
1383
- $metadata,
1175
+ (0, smithy_client_1.throwDefaultError)({
1176
+ output,
1177
+ parsedBody,
1178
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1179
+ errorCode,
1384
1180
  });
1385
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1386
1181
  }
1387
1182
  };
1388
1183
  const deserializeAws_restJson1StopCanaryCommand = async (output, context) => {
1389
1184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1390
1185
  return deserializeAws_restJson1StopCanaryCommandError(output, context);
1391
1186
  }
1392
- const contents = {
1187
+ const contents = map({
1393
1188
  $metadata: deserializeMetadata(output),
1394
- };
1189
+ });
1395
1190
  await collectBody(output.body, context);
1396
- return Promise.resolve(contents);
1191
+ return contents;
1397
1192
  };
1398
1193
  exports.deserializeAws_restJson1StopCanaryCommand = deserializeAws_restJson1StopCanaryCommand;
1399
1194
  const deserializeAws_restJson1StopCanaryCommandError = async (output, context) => {
@@ -1401,7 +1196,6 @@ const deserializeAws_restJson1StopCanaryCommandError = async (output, context) =
1401
1196
  ...output,
1402
1197
  body: await parseBody(output.body, context),
1403
1198
  };
1404
- let response;
1405
1199
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1406
1200
  switch (errorCode) {
1407
1201
  case "ConflictException":
@@ -1418,25 +1212,23 @@ const deserializeAws_restJson1StopCanaryCommandError = async (output, context) =
1418
1212
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1419
1213
  default:
1420
1214
  const parsedBody = parsedOutput.body;
1421
- const $metadata = deserializeMetadata(output);
1422
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1423
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1424
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1425
- $fault: "client",
1426
- $metadata,
1215
+ (0, smithy_client_1.throwDefaultError)({
1216
+ output,
1217
+ parsedBody,
1218
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1219
+ errorCode,
1427
1220
  });
1428
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1429
1221
  }
1430
1222
  };
1431
1223
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1432
1224
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1433
1225
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1434
1226
  }
1435
- const contents = {
1227
+ const contents = map({
1436
1228
  $metadata: deserializeMetadata(output),
1437
- };
1229
+ });
1438
1230
  await collectBody(output.body, context);
1439
- return Promise.resolve(contents);
1231
+ return contents;
1440
1232
  };
1441
1233
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1442
1234
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1444,7 +1236,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1444
1236
  ...output,
1445
1237
  body: await parseBody(output.body, context),
1446
1238
  };
1447
- let response;
1448
1239
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1449
1240
  switch (errorCode) {
1450
1241
  case "BadRequestException":
@@ -1464,25 +1255,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1464
1255
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1465
1256
  default:
1466
1257
  const parsedBody = parsedOutput.body;
1467
- const $metadata = deserializeMetadata(output);
1468
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1469
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1470
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1471
- $fault: "client",
1472
- $metadata,
1258
+ (0, smithy_client_1.throwDefaultError)({
1259
+ output,
1260
+ parsedBody,
1261
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1262
+ errorCode,
1473
1263
  });
1474
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1475
1264
  }
1476
1265
  };
1477
1266
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1478
1267
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1479
1268
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1480
1269
  }
1481
- const contents = {
1270
+ const contents = map({
1482
1271
  $metadata: deserializeMetadata(output),
1483
- };
1272
+ });
1484
1273
  await collectBody(output.body, context);
1485
- return Promise.resolve(contents);
1274
+ return contents;
1486
1275
  };
1487
1276
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1488
1277
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1490,7 +1279,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1490
1279
  ...output,
1491
1280
  body: await parseBody(output.body, context),
1492
1281
  };
1493
- let response;
1494
1282
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1495
1283
  switch (errorCode) {
1496
1284
  case "BadRequestException":
@@ -1510,25 +1298,23 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1510
1298
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1511
1299
  default:
1512
1300
  const parsedBody = parsedOutput.body;
1513
- const $metadata = deserializeMetadata(output);
1514
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1515
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1516
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1517
- $fault: "client",
1518
- $metadata,
1301
+ (0, smithy_client_1.throwDefaultError)({
1302
+ output,
1303
+ parsedBody,
1304
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1305
+ errorCode,
1519
1306
  });
1520
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1521
1307
  }
1522
1308
  };
1523
1309
  const deserializeAws_restJson1UpdateCanaryCommand = async (output, context) => {
1524
1310
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1525
1311
  return deserializeAws_restJson1UpdateCanaryCommandError(output, context);
1526
1312
  }
1527
- const contents = {
1313
+ const contents = map({
1528
1314
  $metadata: deserializeMetadata(output),
1529
- };
1315
+ });
1530
1316
  await collectBody(output.body, context);
1531
- return Promise.resolve(contents);
1317
+ return contents;
1532
1318
  };
1533
1319
  exports.deserializeAws_restJson1UpdateCanaryCommand = deserializeAws_restJson1UpdateCanaryCommand;
1534
1320
  const deserializeAws_restJson1UpdateCanaryCommandError = async (output, context) => {
@@ -1536,7 +1322,6 @@ const deserializeAws_restJson1UpdateCanaryCommandError = async (output, context)
1536
1322
  ...output,
1537
1323
  body: await parseBody(output.body, context),
1538
1324
  };
1539
- let response;
1540
1325
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1541
1326
  switch (errorCode) {
1542
1327
  case "ConflictException":
@@ -1556,20 +1341,19 @@ const deserializeAws_restJson1UpdateCanaryCommandError = async (output, context)
1556
1341
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1557
1342
  default:
1558
1343
  const parsedBody = parsedOutput.body;
1559
- const $metadata = deserializeMetadata(output);
1560
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1561
- response = new SyntheticsServiceException_1.SyntheticsServiceException({
1562
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1563
- $fault: "client",
1564
- $metadata,
1344
+ (0, smithy_client_1.throwDefaultError)({
1345
+ output,
1346
+ parsedBody,
1347
+ exceptionCtor: SyntheticsServiceException_1.SyntheticsServiceException,
1348
+ errorCode,
1565
1349
  });
1566
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1567
1350
  }
1568
1351
  };
1352
+ const map = smithy_client_1.map;
1569
1353
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1570
- const contents = {};
1354
+ const contents = map({});
1571
1355
  const data = parsedOutput.body;
1572
- if (data.Message !== undefined && data.Message !== null) {
1356
+ if (data.Message != null) {
1573
1357
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1574
1358
  }
1575
1359
  const exception = new models_0_1.BadRequestException({
@@ -1579,9 +1363,9 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
1579
1363
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1580
1364
  };
1581
1365
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1582
- const contents = {};
1366
+ const contents = map({});
1583
1367
  const data = parsedOutput.body;
1584
- if (data.Message !== undefined && data.Message !== null) {
1368
+ if (data.Message != null) {
1585
1369
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1586
1370
  }
1587
1371
  const exception = new models_0_1.ConflictException({
@@ -1591,9 +1375,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1591
1375
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1592
1376
  };
1593
1377
  const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
1594
- const contents = {};
1378
+ const contents = map({});
1595
1379
  const data = parsedOutput.body;
1596
- if (data.Message !== undefined && data.Message !== null) {
1380
+ if (data.Message != null) {
1597
1381
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1598
1382
  }
1599
1383
  const exception = new models_0_1.InternalFailureException({
@@ -1603,9 +1387,9 @@ const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOu
1603
1387
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1604
1388
  };
1605
1389
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1606
- const contents = {};
1390
+ const contents = map({});
1607
1391
  const data = parsedOutput.body;
1608
- if (data.Message !== undefined && data.Message !== null) {
1392
+ if (data.Message != null) {
1609
1393
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1610
1394
  }
1611
1395
  const exception = new models_0_1.InternalServerException({
@@ -1615,9 +1399,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
1615
1399
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1616
1400
  };
1617
1401
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1618
- const contents = {};
1402
+ const contents = map({});
1619
1403
  const data = parsedOutput.body;
1620
- if (data.Message !== undefined && data.Message !== null) {
1404
+ if (data.Message != null) {
1621
1405
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1622
1406
  }
1623
1407
  const exception = new models_0_1.NotFoundException({
@@ -1627,9 +1411,9 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
1627
1411
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1628
1412
  };
1629
1413
  const deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = async (parsedOutput, context) => {
1630
- const contents = {};
1414
+ const contents = map({});
1631
1415
  const data = parsedOutput.body;
1632
- if (data.Message !== undefined && data.Message !== null) {
1416
+ if (data.Message != null) {
1633
1417
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1634
1418
  }
1635
1419
  const exception = new models_0_1.RequestEntityTooLargeException({
@@ -1639,9 +1423,9 @@ const deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = async (pa
1639
1423
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1640
1424
  };
1641
1425
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1642
- const contents = {};
1426
+ const contents = map({});
1643
1427
  const data = parsedOutput.body;
1644
- if (data.Message !== undefined && data.Message !== null) {
1428
+ if (data.Message != null) {
1645
1429
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1646
1430
  }
1647
1431
  const exception = new models_0_1.ResourceNotFoundException({
@@ -1651,9 +1435,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
1651
1435
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1652
1436
  };
1653
1437
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1654
- const contents = {};
1438
+ const contents = map({});
1655
1439
  const data = parsedOutput.body;
1656
- if (data.Message !== undefined && data.Message !== null) {
1440
+ if (data.Message != null) {
1657
1441
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1658
1442
  }
1659
1443
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -1663,9 +1447,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
1663
1447
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1664
1448
  };
1665
1449
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1666
- const contents = {};
1450
+ const contents = map({});
1667
1451
  const data = parsedOutput.body;
1668
- if (data.Message !== undefined && data.Message !== null) {
1452
+ if (data.Message != null) {
1669
1453
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1670
1454
  }
1671
1455
  const exception = new models_0_1.TooManyRequestsException({
@@ -1675,9 +1459,9 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
1675
1459
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1676
1460
  };
1677
1461
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1678
- const contents = {};
1462
+ const contents = map({});
1679
1463
  const data = parsedOutput.body;
1680
- if (data.Message !== undefined && data.Message !== null) {
1464
+ if (data.Message != null) {
1681
1465
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
1682
1466
  }
1683
1467
  const exception = new models_0_1.ValidationException({
@@ -1705,9 +1489,6 @@ const serializeAws_restJson1BaseScreenshotIgnoreCoordinates = (input, context) =
1705
1489
  return input
1706
1490
  .filter((e) => e != null)
1707
1491
  .map((entry) => {
1708
- if (entry === null) {
1709
- return null;
1710
- }
1711
1492
  return entry;
1712
1493
  });
1713
1494
  };
@@ -1715,9 +1496,6 @@ const serializeAws_restJson1BaseScreenshots = (input, context) => {
1715
1496
  return input
1716
1497
  .filter((e) => e != null)
1717
1498
  .map((entry) => {
1718
- if (entry === null) {
1719
- return null;
1720
- }
1721
1499
  return serializeAws_restJson1BaseScreenshot(entry, context);
1722
1500
  });
1723
1501
  };
@@ -1750,9 +1528,6 @@ const serializeAws_restJson1DescribeCanariesLastRunNameFilter = (input, context)
1750
1528
  return input
1751
1529
  .filter((e) => e != null)
1752
1530
  .map((entry) => {
1753
- if (entry === null) {
1754
- return null;
1755
- }
1756
1531
  return entry;
1757
1532
  });
1758
1533
  };
@@ -1760,9 +1535,6 @@ const serializeAws_restJson1DescribeCanariesNameFilter = (input, context) => {
1760
1535
  return input
1761
1536
  .filter((e) => e != null)
1762
1537
  .map((entry) => {
1763
- if (entry === null) {
1764
- return null;
1765
- }
1766
1538
  return entry;
1767
1539
  });
1768
1540
  };
@@ -1787,9 +1559,6 @@ const serializeAws_restJson1SecurityGroupIds = (input, context) => {
1787
1559
  return input
1788
1560
  .filter((e) => e != null)
1789
1561
  .map((entry) => {
1790
- if (entry === null) {
1791
- return null;
1792
- }
1793
1562
  return entry;
1794
1563
  });
1795
1564
  };
@@ -1797,9 +1566,6 @@ const serializeAws_restJson1SubnetIds = (input, context) => {
1797
1566
  return input
1798
1567
  .filter((e) => e != null)
1799
1568
  .map((entry) => {
1800
- if (entry === null) {
1801
- return null;
1802
- }
1803
1569
  return entry;
1804
1570
  });
1805
1571
  };