@aws-sdk/client-location 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,16 +14,7 @@ const serializeAws_restJson1AssociateTrackerConsumerCommand = async (input, cont
14
14
  };
15
15
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
16
16
  "/tracking/v0/trackers/{TrackerName}/consumers";
17
- if (input.TrackerName !== undefined) {
18
- const labelValue = input.TrackerName;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
21
- }
22
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: TrackerName.");
26
- }
17
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
27
18
  let body;
28
19
  body = JSON.stringify({
29
20
  ...(input.ConsumerArn != null && { ConsumerArn: input.ConsumerArn }),
@@ -53,16 +44,7 @@ const serializeAws_restJson1BatchDeleteDevicePositionHistoryCommand = async (inp
53
44
  };
54
45
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
55
46
  "/tracking/v0/trackers/{TrackerName}/delete-positions";
56
- if (input.TrackerName !== undefined) {
57
- const labelValue = input.TrackerName;
58
- if (labelValue.length <= 0) {
59
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
60
- }
61
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
62
- }
63
- else {
64
- throw new Error("No value provided for input HTTP label: TrackerName.");
65
- }
47
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
66
48
  let body;
67
49
  body = JSON.stringify({
68
50
  ...(input.DeviceIds != null && { DeviceIds: serializeAws_restJson1DeviceIdsList(input.DeviceIds, context) }),
@@ -92,16 +74,7 @@ const serializeAws_restJson1BatchDeleteGeofenceCommand = async (input, context)
92
74
  };
93
75
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
94
76
  "/geofencing/v0/collections/{CollectionName}/delete-geofences";
95
- if (input.CollectionName !== undefined) {
96
- const labelValue = input.CollectionName;
97
- if (labelValue.length <= 0) {
98
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
99
- }
100
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
101
- }
102
- else {
103
- throw new Error("No value provided for input HTTP label: CollectionName.");
104
- }
77
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
105
78
  let body;
106
79
  body = JSON.stringify({
107
80
  ...(input.GeofenceIds != null && { GeofenceIds: serializeAws_restJson1IdList(input.GeofenceIds, context) }),
@@ -131,16 +104,7 @@ const serializeAws_restJson1BatchEvaluateGeofencesCommand = async (input, contex
131
104
  };
132
105
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
133
106
  "/geofencing/v0/collections/{CollectionName}/positions";
134
- if (input.CollectionName !== undefined) {
135
- const labelValue = input.CollectionName;
136
- if (labelValue.length <= 0) {
137
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
138
- }
139
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
140
- }
141
- else {
142
- throw new Error("No value provided for input HTTP label: CollectionName.");
143
- }
107
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
144
108
  let body;
145
109
  body = JSON.stringify({
146
110
  ...(input.DevicePositionUpdates != null && {
@@ -172,16 +136,7 @@ const serializeAws_restJson1BatchGetDevicePositionCommand = async (input, contex
172
136
  };
173
137
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
174
138
  "/tracking/v0/trackers/{TrackerName}/get-positions";
175
- if (input.TrackerName !== undefined) {
176
- const labelValue = input.TrackerName;
177
- if (labelValue.length <= 0) {
178
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
179
- }
180
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
181
- }
182
- else {
183
- throw new Error("No value provided for input HTTP label: TrackerName.");
184
- }
139
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
185
140
  let body;
186
141
  body = JSON.stringify({
187
142
  ...(input.DeviceIds != null && { DeviceIds: serializeAws_restJson1IdList(input.DeviceIds, context) }),
@@ -211,16 +166,7 @@ const serializeAws_restJson1BatchPutGeofenceCommand = async (input, context) =>
211
166
  };
212
167
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
213
168
  "/geofencing/v0/collections/{CollectionName}/put-geofences";
214
- if (input.CollectionName !== undefined) {
215
- const labelValue = input.CollectionName;
216
- if (labelValue.length <= 0) {
217
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
218
- }
219
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
220
- }
221
- else {
222
- throw new Error("No value provided for input HTTP label: CollectionName.");
223
- }
169
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
224
170
  let body;
225
171
  body = JSON.stringify({
226
172
  ...(input.Entries != null && {
@@ -252,16 +198,7 @@ const serializeAws_restJson1BatchUpdateDevicePositionCommand = async (input, con
252
198
  };
253
199
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
254
200
  "/tracking/v0/trackers/{TrackerName}/positions";
255
- if (input.TrackerName !== undefined) {
256
- const labelValue = input.TrackerName;
257
- if (labelValue.length <= 0) {
258
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
259
- }
260
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
261
- }
262
- else {
263
- throw new Error("No value provided for input HTTP label: TrackerName.");
264
- }
201
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
265
202
  let body;
266
203
  body = JSON.stringify({
267
204
  ...(input.Updates != null && { Updates: serializeAws_restJson1DevicePositionUpdateList(input.Updates, context) }),
@@ -291,16 +228,7 @@ const serializeAws_restJson1CalculateRouteCommand = async (input, context) => {
291
228
  };
292
229
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
293
230
  "/routes/v0/calculators/{CalculatorName}/calculate/route";
294
- if (input.CalculatorName !== undefined) {
295
- const labelValue = input.CalculatorName;
296
- if (labelValue.length <= 0) {
297
- throw new Error("Empty value provided for input HTTP label: CalculatorName.");
298
- }
299
- resolvedPath = resolvedPath.replace("{CalculatorName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
300
- }
301
- else {
302
- throw new Error("No value provided for input HTTP label: CalculatorName.");
303
- }
231
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CalculatorName", () => input.CalculatorName, "{CalculatorName}", false);
304
232
  let body;
305
233
  body = JSON.stringify({
306
234
  ...(input.CarModeOptions != null && {
@@ -349,16 +277,7 @@ const serializeAws_restJson1CalculateRouteMatrixCommand = async (input, context)
349
277
  };
350
278
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
351
279
  "/routes/v0/calculators/{CalculatorName}/calculate/route-matrix";
352
- if (input.CalculatorName !== undefined) {
353
- const labelValue = input.CalculatorName;
354
- if (labelValue.length <= 0) {
355
- throw new Error("Empty value provided for input HTTP label: CalculatorName.");
356
- }
357
- resolvedPath = resolvedPath.replace("{CalculatorName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
358
- }
359
- else {
360
- throw new Error("No value provided for input HTTP label: CalculatorName.");
361
- }
280
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CalculatorName", () => input.CalculatorName, "{CalculatorName}", false);
362
281
  let body;
363
282
  body = JSON.stringify({
364
283
  ...(input.CarModeOptions != null && {
@@ -569,16 +488,7 @@ const serializeAws_restJson1DeleteGeofenceCollectionCommand = async (input, cont
569
488
  const headers = {};
570
489
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
571
490
  "/geofencing/v0/collections/{CollectionName}";
572
- if (input.CollectionName !== undefined) {
573
- const labelValue = input.CollectionName;
574
- if (labelValue.length <= 0) {
575
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
576
- }
577
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
578
- }
579
- else {
580
- throw new Error("No value provided for input HTTP label: CollectionName.");
581
- }
491
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
582
492
  let body;
583
493
  let { hostname: resolvedHostname } = await context.endpoint();
584
494
  if (context.disableHostPrefix !== true) {
@@ -602,16 +512,7 @@ const serializeAws_restJson1DeleteMapCommand = async (input, context) => {
602
512
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
603
513
  const headers = {};
604
514
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}";
605
- if (input.MapName !== undefined) {
606
- const labelValue = input.MapName;
607
- if (labelValue.length <= 0) {
608
- throw new Error("Empty value provided for input HTTP label: MapName.");
609
- }
610
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
611
- }
612
- else {
613
- throw new Error("No value provided for input HTTP label: MapName.");
614
- }
515
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
615
516
  let body;
616
517
  let { hostname: resolvedHostname } = await context.endpoint();
617
518
  if (context.disableHostPrefix !== true) {
@@ -635,16 +536,7 @@ const serializeAws_restJson1DeletePlaceIndexCommand = async (input, context) =>
635
536
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
636
537
  const headers = {};
637
538
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/places/v0/indexes/{IndexName}";
638
- if (input.IndexName !== undefined) {
639
- const labelValue = input.IndexName;
640
- if (labelValue.length <= 0) {
641
- throw new Error("Empty value provided for input HTTP label: IndexName.");
642
- }
643
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
644
- }
645
- else {
646
- throw new Error("No value provided for input HTTP label: IndexName.");
647
- }
539
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
648
540
  let body;
649
541
  let { hostname: resolvedHostname } = await context.endpoint();
650
542
  if (context.disableHostPrefix !== true) {
@@ -668,16 +560,7 @@ const serializeAws_restJson1DeleteRouteCalculatorCommand = async (input, context
668
560
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
669
561
  const headers = {};
670
562
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/routes/v0/calculators/{CalculatorName}";
671
- if (input.CalculatorName !== undefined) {
672
- const labelValue = input.CalculatorName;
673
- if (labelValue.length <= 0) {
674
- throw new Error("Empty value provided for input HTTP label: CalculatorName.");
675
- }
676
- resolvedPath = resolvedPath.replace("{CalculatorName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
677
- }
678
- else {
679
- throw new Error("No value provided for input HTTP label: CalculatorName.");
680
- }
563
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CalculatorName", () => input.CalculatorName, "{CalculatorName}", false);
681
564
  let body;
682
565
  let { hostname: resolvedHostname } = await context.endpoint();
683
566
  if (context.disableHostPrefix !== true) {
@@ -701,16 +584,7 @@ const serializeAws_restJson1DeleteTrackerCommand = async (input, context) => {
701
584
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
702
585
  const headers = {};
703
586
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tracking/v0/trackers/{TrackerName}";
704
- if (input.TrackerName !== undefined) {
705
- const labelValue = input.TrackerName;
706
- if (labelValue.length <= 0) {
707
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
708
- }
709
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
710
- }
711
- else {
712
- throw new Error("No value provided for input HTTP label: TrackerName.");
713
- }
587
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
714
588
  let body;
715
589
  let { hostname: resolvedHostname } = await context.endpoint();
716
590
  if (context.disableHostPrefix !== true) {
@@ -735,16 +609,7 @@ const serializeAws_restJson1DescribeGeofenceCollectionCommand = async (input, co
735
609
  const headers = {};
736
610
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
737
611
  "/geofencing/v0/collections/{CollectionName}";
738
- if (input.CollectionName !== undefined) {
739
- const labelValue = input.CollectionName;
740
- if (labelValue.length <= 0) {
741
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
742
- }
743
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
744
- }
745
- else {
746
- throw new Error("No value provided for input HTTP label: CollectionName.");
747
- }
612
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
748
613
  let body;
749
614
  let { hostname: resolvedHostname } = await context.endpoint();
750
615
  if (context.disableHostPrefix !== true) {
@@ -768,16 +633,7 @@ const serializeAws_restJson1DescribeMapCommand = async (input, context) => {
768
633
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
769
634
  const headers = {};
770
635
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}";
771
- if (input.MapName !== undefined) {
772
- const labelValue = input.MapName;
773
- if (labelValue.length <= 0) {
774
- throw new Error("Empty value provided for input HTTP label: MapName.");
775
- }
776
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
777
- }
778
- else {
779
- throw new Error("No value provided for input HTTP label: MapName.");
780
- }
636
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
781
637
  let body;
782
638
  let { hostname: resolvedHostname } = await context.endpoint();
783
639
  if (context.disableHostPrefix !== true) {
@@ -801,16 +657,7 @@ const serializeAws_restJson1DescribePlaceIndexCommand = async (input, context) =
801
657
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
802
658
  const headers = {};
803
659
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/places/v0/indexes/{IndexName}";
804
- if (input.IndexName !== undefined) {
805
- const labelValue = input.IndexName;
806
- if (labelValue.length <= 0) {
807
- throw new Error("Empty value provided for input HTTP label: IndexName.");
808
- }
809
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
810
- }
811
- else {
812
- throw new Error("No value provided for input HTTP label: IndexName.");
813
- }
660
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
814
661
  let body;
815
662
  let { hostname: resolvedHostname } = await context.endpoint();
816
663
  if (context.disableHostPrefix !== true) {
@@ -834,16 +681,7 @@ const serializeAws_restJson1DescribeRouteCalculatorCommand = async (input, conte
834
681
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
835
682
  const headers = {};
836
683
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/routes/v0/calculators/{CalculatorName}";
837
- if (input.CalculatorName !== undefined) {
838
- const labelValue = input.CalculatorName;
839
- if (labelValue.length <= 0) {
840
- throw new Error("Empty value provided for input HTTP label: CalculatorName.");
841
- }
842
- resolvedPath = resolvedPath.replace("{CalculatorName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
843
- }
844
- else {
845
- throw new Error("No value provided for input HTTP label: CalculatorName.");
846
- }
684
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CalculatorName", () => input.CalculatorName, "{CalculatorName}", false);
847
685
  let body;
848
686
  let { hostname: resolvedHostname } = await context.endpoint();
849
687
  if (context.disableHostPrefix !== true) {
@@ -867,16 +705,7 @@ const serializeAws_restJson1DescribeTrackerCommand = async (input, context) => {
867
705
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
868
706
  const headers = {};
869
707
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tracking/v0/trackers/{TrackerName}";
870
- if (input.TrackerName !== undefined) {
871
- const labelValue = input.TrackerName;
872
- if (labelValue.length <= 0) {
873
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
874
- }
875
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
876
- }
877
- else {
878
- throw new Error("No value provided for input HTTP label: TrackerName.");
879
- }
708
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
880
709
  let body;
881
710
  let { hostname: resolvedHostname } = await context.endpoint();
882
711
  if (context.disableHostPrefix !== true) {
@@ -901,26 +730,8 @@ const serializeAws_restJson1DisassociateTrackerConsumerCommand = async (input, c
901
730
  const headers = {};
902
731
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
903
732
  "/tracking/v0/trackers/{TrackerName}/consumers/{ConsumerArn}";
904
- if (input.TrackerName !== undefined) {
905
- const labelValue = input.TrackerName;
906
- if (labelValue.length <= 0) {
907
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
908
- }
909
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
910
- }
911
- else {
912
- throw new Error("No value provided for input HTTP label: TrackerName.");
913
- }
914
- if (input.ConsumerArn !== undefined) {
915
- const labelValue = input.ConsumerArn;
916
- if (labelValue.length <= 0) {
917
- throw new Error("Empty value provided for input HTTP label: ConsumerArn.");
918
- }
919
- resolvedPath = resolvedPath.replace("{ConsumerArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
920
- }
921
- else {
922
- throw new Error("No value provided for input HTTP label: ConsumerArn.");
923
- }
733
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
734
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConsumerArn", () => input.ConsumerArn, "{ConsumerArn}", false);
924
735
  let body;
925
736
  let { hostname: resolvedHostname } = await context.endpoint();
926
737
  if (context.disableHostPrefix !== true) {
@@ -945,26 +756,8 @@ const serializeAws_restJson1GetDevicePositionCommand = async (input, context) =>
945
756
  const headers = {};
946
757
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
947
758
  "/tracking/v0/trackers/{TrackerName}/devices/{DeviceId}/positions/latest";
948
- if (input.TrackerName !== undefined) {
949
- const labelValue = input.TrackerName;
950
- if (labelValue.length <= 0) {
951
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
952
- }
953
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
954
- }
955
- else {
956
- throw new Error("No value provided for input HTTP label: TrackerName.");
957
- }
958
- if (input.DeviceId !== undefined) {
959
- const labelValue = input.DeviceId;
960
- if (labelValue.length <= 0) {
961
- throw new Error("Empty value provided for input HTTP label: DeviceId.");
962
- }
963
- resolvedPath = resolvedPath.replace("{DeviceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
964
- }
965
- else {
966
- throw new Error("No value provided for input HTTP label: DeviceId.");
967
- }
759
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
760
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeviceId", () => input.DeviceId, "{DeviceId}", false);
968
761
  let body;
969
762
  let { hostname: resolvedHostname } = await context.endpoint();
970
763
  if (context.disableHostPrefix !== true) {
@@ -991,26 +784,8 @@ const serializeAws_restJson1GetDevicePositionHistoryCommand = async (input, cont
991
784
  };
992
785
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
993
786
  "/tracking/v0/trackers/{TrackerName}/devices/{DeviceId}/list-positions";
994
- if (input.TrackerName !== undefined) {
995
- const labelValue = input.TrackerName;
996
- if (labelValue.length <= 0) {
997
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
998
- }
999
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1000
- }
1001
- else {
1002
- throw new Error("No value provided for input HTTP label: TrackerName.");
1003
- }
1004
- if (input.DeviceId !== undefined) {
1005
- const labelValue = input.DeviceId;
1006
- if (labelValue.length <= 0) {
1007
- throw new Error("Empty value provided for input HTTP label: DeviceId.");
1008
- }
1009
- resolvedPath = resolvedPath.replace("{DeviceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1010
- }
1011
- else {
1012
- throw new Error("No value provided for input HTTP label: DeviceId.");
1013
- }
787
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
788
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DeviceId", () => input.DeviceId, "{DeviceId}", false);
1014
789
  let body;
1015
790
  body = JSON.stringify({
1016
791
  ...(input.EndTimeExclusive != null && {
@@ -1045,26 +820,8 @@ const serializeAws_restJson1GetGeofenceCommand = async (input, context) => {
1045
820
  const headers = {};
1046
821
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1047
822
  "/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}";
1048
- if (input.CollectionName !== undefined) {
1049
- const labelValue = input.CollectionName;
1050
- if (labelValue.length <= 0) {
1051
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
1052
- }
1053
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1054
- }
1055
- else {
1056
- throw new Error("No value provided for input HTTP label: CollectionName.");
1057
- }
1058
- if (input.GeofenceId !== undefined) {
1059
- const labelValue = input.GeofenceId;
1060
- if (labelValue.length <= 0) {
1061
- throw new Error("Empty value provided for input HTTP label: GeofenceId.");
1062
- }
1063
- resolvedPath = resolvedPath.replace("{GeofenceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1064
- }
1065
- else {
1066
- throw new Error("No value provided for input HTTP label: GeofenceId.");
1067
- }
823
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
824
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GeofenceId", () => input.GeofenceId, "{GeofenceId}", false);
1068
825
  let body;
1069
826
  let { hostname: resolvedHostname } = await context.endpoint();
1070
827
  if (context.disableHostPrefix !== true) {
@@ -1089,36 +846,9 @@ const serializeAws_restJson1GetMapGlyphsCommand = async (input, context) => {
1089
846
  const headers = {};
1090
847
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1091
848
  "/maps/v0/maps/{MapName}/glyphs/{FontStack}/{FontUnicodeRange}";
1092
- if (input.MapName !== undefined) {
1093
- const labelValue = input.MapName;
1094
- if (labelValue.length <= 0) {
1095
- throw new Error("Empty value provided for input HTTP label: MapName.");
1096
- }
1097
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1098
- }
1099
- else {
1100
- throw new Error("No value provided for input HTTP label: MapName.");
1101
- }
1102
- if (input.FontStack !== undefined) {
1103
- const labelValue = input.FontStack;
1104
- if (labelValue.length <= 0) {
1105
- throw new Error("Empty value provided for input HTTP label: FontStack.");
1106
- }
1107
- resolvedPath = resolvedPath.replace("{FontStack}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1108
- }
1109
- else {
1110
- throw new Error("No value provided for input HTTP label: FontStack.");
1111
- }
1112
- if (input.FontUnicodeRange !== undefined) {
1113
- const labelValue = input.FontUnicodeRange;
1114
- if (labelValue.length <= 0) {
1115
- throw new Error("Empty value provided for input HTTP label: FontUnicodeRange.");
1116
- }
1117
- resolvedPath = resolvedPath.replace("{FontUnicodeRange}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1118
- }
1119
- else {
1120
- throw new Error("No value provided for input HTTP label: FontUnicodeRange.");
1121
- }
849
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
850
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FontStack", () => input.FontStack, "{FontStack}", false);
851
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FontUnicodeRange", () => input.FontUnicodeRange, "{FontUnicodeRange}", false);
1122
852
  let body;
1123
853
  let { hostname: resolvedHostname } = await context.endpoint();
1124
854
  if (context.disableHostPrefix !== true) {
@@ -1143,26 +873,8 @@ const serializeAws_restJson1GetMapSpritesCommand = async (input, context) => {
1143
873
  const headers = {};
1144
874
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1145
875
  "/maps/v0/maps/{MapName}/sprites/{FileName}";
1146
- if (input.MapName !== undefined) {
1147
- const labelValue = input.MapName;
1148
- if (labelValue.length <= 0) {
1149
- throw new Error("Empty value provided for input HTTP label: MapName.");
1150
- }
1151
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1152
- }
1153
- else {
1154
- throw new Error("No value provided for input HTTP label: MapName.");
1155
- }
1156
- if (input.FileName !== undefined) {
1157
- const labelValue = input.FileName;
1158
- if (labelValue.length <= 0) {
1159
- throw new Error("Empty value provided for input HTTP label: FileName.");
1160
- }
1161
- resolvedPath = resolvedPath.replace("{FileName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1162
- }
1163
- else {
1164
- throw new Error("No value provided for input HTTP label: FileName.");
1165
- }
876
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
877
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileName", () => input.FileName, "{FileName}", false);
1166
878
  let body;
1167
879
  let { hostname: resolvedHostname } = await context.endpoint();
1168
880
  if (context.disableHostPrefix !== true) {
@@ -1186,16 +898,7 @@ const serializeAws_restJson1GetMapStyleDescriptorCommand = async (input, context
1186
898
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1187
899
  const headers = {};
1188
900
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}/style-descriptor";
1189
- if (input.MapName !== undefined) {
1190
- const labelValue = input.MapName;
1191
- if (labelValue.length <= 0) {
1192
- throw new Error("Empty value provided for input HTTP label: MapName.");
1193
- }
1194
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1195
- }
1196
- else {
1197
- throw new Error("No value provided for input HTTP label: MapName.");
1198
- }
901
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
1199
902
  let body;
1200
903
  let { hostname: resolvedHostname } = await context.endpoint();
1201
904
  if (context.disableHostPrefix !== true) {
@@ -1219,46 +922,10 @@ const serializeAws_restJson1GetMapTileCommand = async (input, context) => {
1219
922
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1220
923
  const headers = {};
1221
924
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}/tiles/{Z}/{X}/{Y}";
1222
- if (input.MapName !== undefined) {
1223
- const labelValue = input.MapName;
1224
- if (labelValue.length <= 0) {
1225
- throw new Error("Empty value provided for input HTTP label: MapName.");
1226
- }
1227
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1228
- }
1229
- else {
1230
- throw new Error("No value provided for input HTTP label: MapName.");
1231
- }
1232
- if (input.Z !== undefined) {
1233
- const labelValue = input.Z;
1234
- if (labelValue.length <= 0) {
1235
- throw new Error("Empty value provided for input HTTP label: Z.");
1236
- }
1237
- resolvedPath = resolvedPath.replace("{Z}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1238
- }
1239
- else {
1240
- throw new Error("No value provided for input HTTP label: Z.");
1241
- }
1242
- if (input.X !== undefined) {
1243
- const labelValue = input.X;
1244
- if (labelValue.length <= 0) {
1245
- throw new Error("Empty value provided for input HTTP label: X.");
1246
- }
1247
- resolvedPath = resolvedPath.replace("{X}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1248
- }
1249
- else {
1250
- throw new Error("No value provided for input HTTP label: X.");
1251
- }
1252
- if (input.Y !== undefined) {
1253
- const labelValue = input.Y;
1254
- if (labelValue.length <= 0) {
1255
- throw new Error("Empty value provided for input HTTP label: Y.");
1256
- }
1257
- resolvedPath = resolvedPath.replace("{Y}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1258
- }
1259
- else {
1260
- throw new Error("No value provided for input HTTP label: Y.");
1261
- }
925
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
926
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Z", () => input.Z, "{Z}", false);
927
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "X", () => input.X, "{X}", false);
928
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Y", () => input.Y, "{Y}", false);
1262
929
  let body;
1263
930
  let { hostname: resolvedHostname } = await context.endpoint();
1264
931
  if (context.disableHostPrefix !== true) {
@@ -1285,16 +952,7 @@ const serializeAws_restJson1ListDevicePositionsCommand = async (input, context)
1285
952
  };
1286
953
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1287
954
  "/tracking/v0/trackers/{TrackerName}/list-positions";
1288
- if (input.TrackerName !== undefined) {
1289
- const labelValue = input.TrackerName;
1290
- if (labelValue.length <= 0) {
1291
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
1292
- }
1293
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1294
- }
1295
- else {
1296
- throw new Error("No value provided for input HTTP label: TrackerName.");
1297
- }
955
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
1298
956
  let body;
1299
957
  body = JSON.stringify({
1300
958
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -1354,16 +1012,7 @@ const serializeAws_restJson1ListGeofencesCommand = async (input, context) => {
1354
1012
  };
1355
1013
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1356
1014
  "/geofencing/v0/collections/{CollectionName}/list-geofences";
1357
- if (input.CollectionName !== undefined) {
1358
- const labelValue = input.CollectionName;
1359
- if (labelValue.length <= 0) {
1360
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
1361
- }
1362
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1363
- }
1364
- else {
1365
- throw new Error("No value provided for input HTTP label: CollectionName.");
1366
- }
1015
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
1367
1016
  let body;
1368
1017
  body = JSON.stringify({
1369
1018
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -1478,16 +1127,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
1478
1127
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1479
1128
  const headers = {};
1480
1129
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1481
- if (input.ResourceArn !== undefined) {
1482
- const labelValue = input.ResourceArn;
1483
- if (labelValue.length <= 0) {
1484
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1485
- }
1486
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1487
- }
1488
- else {
1489
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1490
- }
1130
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
1491
1131
  let body;
1492
1132
  let { hostname: resolvedHostname } = await context.endpoint();
1493
1133
  if (context.disableHostPrefix !== true) {
@@ -1514,16 +1154,7 @@ const serializeAws_restJson1ListTrackerConsumersCommand = async (input, context)
1514
1154
  };
1515
1155
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1516
1156
  "/tracking/v0/trackers/{TrackerName}/list-consumers";
1517
- if (input.TrackerName !== undefined) {
1518
- const labelValue = input.TrackerName;
1519
- if (labelValue.length <= 0) {
1520
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
1521
- }
1522
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1523
- }
1524
- else {
1525
- throw new Error("No value provided for input HTTP label: TrackerName.");
1526
- }
1157
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
1527
1158
  let body;
1528
1159
  body = JSON.stringify({
1529
1160
  ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
@@ -1583,26 +1214,8 @@ const serializeAws_restJson1PutGeofenceCommand = async (input, context) => {
1583
1214
  };
1584
1215
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1585
1216
  "/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}";
1586
- if (input.CollectionName !== undefined) {
1587
- const labelValue = input.CollectionName;
1588
- if (labelValue.length <= 0) {
1589
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
1590
- }
1591
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1592
- }
1593
- else {
1594
- throw new Error("No value provided for input HTTP label: CollectionName.");
1595
- }
1596
- if (input.GeofenceId !== undefined) {
1597
- const labelValue = input.GeofenceId;
1598
- if (labelValue.length <= 0) {
1599
- throw new Error("Empty value provided for input HTTP label: GeofenceId.");
1600
- }
1601
- resolvedPath = resolvedPath.replace("{GeofenceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1602
- }
1603
- else {
1604
- throw new Error("No value provided for input HTTP label: GeofenceId.");
1605
- }
1217
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
1218
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "GeofenceId", () => input.GeofenceId, "{GeofenceId}", false);
1606
1219
  let body;
1607
1220
  body = JSON.stringify({
1608
1221
  ...(input.Geometry != null && { Geometry: serializeAws_restJson1GeofenceGeometry(input.Geometry, context) }),
@@ -1632,16 +1245,7 @@ const serializeAws_restJson1SearchPlaceIndexForPositionCommand = async (input, c
1632
1245
  };
1633
1246
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1634
1247
  "/places/v0/indexes/{IndexName}/search/position";
1635
- if (input.IndexName !== undefined) {
1636
- const labelValue = input.IndexName;
1637
- if (labelValue.length <= 0) {
1638
- throw new Error("Empty value provided for input HTTP label: IndexName.");
1639
- }
1640
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1641
- }
1642
- else {
1643
- throw new Error("No value provided for input HTTP label: IndexName.");
1644
- }
1248
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
1645
1249
  let body;
1646
1250
  body = JSON.stringify({
1647
1251
  ...(input.Language != null && { Language: input.Language }),
@@ -1673,16 +1277,7 @@ const serializeAws_restJson1SearchPlaceIndexForSuggestionsCommand = async (input
1673
1277
  };
1674
1278
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1675
1279
  "/places/v0/indexes/{IndexName}/search/suggestions";
1676
- if (input.IndexName !== undefined) {
1677
- const labelValue = input.IndexName;
1678
- if (labelValue.length <= 0) {
1679
- throw new Error("Empty value provided for input HTTP label: IndexName.");
1680
- }
1681
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1682
- }
1683
- else {
1684
- throw new Error("No value provided for input HTTP label: IndexName.");
1685
- }
1280
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
1686
1281
  let body;
1687
1282
  body = JSON.stringify({
1688
1283
  ...(input.BiasPosition != null && { BiasPosition: serializeAws_restJson1Position(input.BiasPosition, context) }),
@@ -1719,16 +1314,7 @@ const serializeAws_restJson1SearchPlaceIndexForTextCommand = async (input, conte
1719
1314
  };
1720
1315
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1721
1316
  "/places/v0/indexes/{IndexName}/search/text";
1722
- if (input.IndexName !== undefined) {
1723
- const labelValue = input.IndexName;
1724
- if (labelValue.length <= 0) {
1725
- throw new Error("Empty value provided for input HTTP label: IndexName.");
1726
- }
1727
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1728
- }
1729
- else {
1730
- throw new Error("No value provided for input HTTP label: IndexName.");
1731
- }
1317
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
1732
1318
  let body;
1733
1319
  body = JSON.stringify({
1734
1320
  ...(input.BiasPosition != null && { BiasPosition: serializeAws_restJson1Position(input.BiasPosition, context) }),
@@ -1764,16 +1350,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
1764
1350
  "content-type": "application/json",
1765
1351
  };
1766
1352
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1767
- if (input.ResourceArn !== undefined) {
1768
- const labelValue = input.ResourceArn;
1769
- if (labelValue.length <= 0) {
1770
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1771
- }
1772
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1773
- }
1774
- else {
1775
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1776
- }
1353
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
1777
1354
  let body;
1778
1355
  body = JSON.stringify({
1779
1356
  ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
@@ -1800,19 +1377,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
1800
1377
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1801
1378
  const headers = {};
1802
1379
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
1803
- if (input.ResourceArn !== undefined) {
1804
- const labelValue = input.ResourceArn;
1805
- if (labelValue.length <= 0) {
1806
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1807
- }
1808
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1809
- }
1810
- else {
1811
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1812
- }
1813
- const query = {
1814
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
1815
- };
1380
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
1381
+ const query = map({
1382
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
1383
+ });
1816
1384
  let body;
1817
1385
  let { hostname: resolvedHostname } = await context.endpoint();
1818
1386
  if (context.disableHostPrefix !== true) {
@@ -1840,16 +1408,7 @@ const serializeAws_restJson1UpdateGeofenceCollectionCommand = async (input, cont
1840
1408
  };
1841
1409
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1842
1410
  "/geofencing/v0/collections/{CollectionName}";
1843
- if (input.CollectionName !== undefined) {
1844
- const labelValue = input.CollectionName;
1845
- if (labelValue.length <= 0) {
1846
- throw new Error("Empty value provided for input HTTP label: CollectionName.");
1847
- }
1848
- resolvedPath = resolvedPath.replace("{CollectionName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1849
- }
1850
- else {
1851
- throw new Error("No value provided for input HTTP label: CollectionName.");
1852
- }
1411
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CollectionName", () => input.CollectionName, "{CollectionName}", false);
1853
1412
  let body;
1854
1413
  body = JSON.stringify({
1855
1414
  ...(input.Description != null && { Description: input.Description }),
@@ -1880,16 +1439,7 @@ const serializeAws_restJson1UpdateMapCommand = async (input, context) => {
1880
1439
  "content-type": "application/json",
1881
1440
  };
1882
1441
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}";
1883
- if (input.MapName !== undefined) {
1884
- const labelValue = input.MapName;
1885
- if (labelValue.length <= 0) {
1886
- throw new Error("Empty value provided for input HTTP label: MapName.");
1887
- }
1888
- resolvedPath = resolvedPath.replace("{MapName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1889
- }
1890
- else {
1891
- throw new Error("No value provided for input HTTP label: MapName.");
1892
- }
1442
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
1893
1443
  let body;
1894
1444
  body = JSON.stringify({
1895
1445
  ...(input.Description != null && { Description: input.Description }),
@@ -1919,16 +1469,7 @@ const serializeAws_restJson1UpdatePlaceIndexCommand = async (input, context) =>
1919
1469
  "content-type": "application/json",
1920
1470
  };
1921
1471
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/places/v0/indexes/{IndexName}";
1922
- if (input.IndexName !== undefined) {
1923
- const labelValue = input.IndexName;
1924
- if (labelValue.length <= 0) {
1925
- throw new Error("Empty value provided for input HTTP label: IndexName.");
1926
- }
1927
- resolvedPath = resolvedPath.replace("{IndexName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1928
- }
1929
- else {
1930
- throw new Error("No value provided for input HTTP label: IndexName.");
1931
- }
1472
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IndexName", () => input.IndexName, "{IndexName}", false);
1932
1473
  let body;
1933
1474
  body = JSON.stringify({
1934
1475
  ...(input.DataSourceConfiguration != null && {
@@ -1961,16 +1502,7 @@ const serializeAws_restJson1UpdateRouteCalculatorCommand = async (input, context
1961
1502
  "content-type": "application/json",
1962
1503
  };
1963
1504
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/routes/v0/calculators/{CalculatorName}";
1964
- if (input.CalculatorName !== undefined) {
1965
- const labelValue = input.CalculatorName;
1966
- if (labelValue.length <= 0) {
1967
- throw new Error("Empty value provided for input HTTP label: CalculatorName.");
1968
- }
1969
- resolvedPath = resolvedPath.replace("{CalculatorName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1970
- }
1971
- else {
1972
- throw new Error("No value provided for input HTTP label: CalculatorName.");
1973
- }
1505
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "CalculatorName", () => input.CalculatorName, "{CalculatorName}", false);
1974
1506
  let body;
1975
1507
  body = JSON.stringify({
1976
1508
  ...(input.Description != null && { Description: input.Description }),
@@ -2000,16 +1532,7 @@ const serializeAws_restJson1UpdateTrackerCommand = async (input, context) => {
2000
1532
  "content-type": "application/json",
2001
1533
  };
2002
1534
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tracking/v0/trackers/{TrackerName}";
2003
- if (input.TrackerName !== undefined) {
2004
- const labelValue = input.TrackerName;
2005
- if (labelValue.length <= 0) {
2006
- throw new Error("Empty value provided for input HTTP label: TrackerName.");
2007
- }
2008
- resolvedPath = resolvedPath.replace("{TrackerName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
2009
- }
2010
- else {
2011
- throw new Error("No value provided for input HTTP label: TrackerName.");
2012
- }
1535
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "TrackerName", () => input.TrackerName, "{TrackerName}", false);
2013
1536
  let body;
2014
1537
  body = JSON.stringify({
2015
1538
  ...(input.Description != null && { Description: input.Description }),
@@ -2039,11 +1562,11 @@ const deserializeAws_restJson1AssociateTrackerConsumerCommand = async (output, c
2039
1562
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2040
1563
  return deserializeAws_restJson1AssociateTrackerConsumerCommandError(output, context);
2041
1564
  }
2042
- const contents = {
1565
+ const contents = map({
2043
1566
  $metadata: deserializeMetadata(output),
2044
- };
1567
+ });
2045
1568
  await collectBody(output.body, context);
2046
- return Promise.resolve(contents);
1569
+ return contents;
2047
1570
  };
2048
1571
  exports.deserializeAws_restJson1AssociateTrackerConsumerCommand = deserializeAws_restJson1AssociateTrackerConsumerCommand;
2049
1572
  const deserializeAws_restJson1AssociateTrackerConsumerCommandError = async (output, context) => {
@@ -2051,7 +1574,6 @@ const deserializeAws_restJson1AssociateTrackerConsumerCommandError = async (outp
2051
1574
  ...output,
2052
1575
  body: await parseBody(output.body, context),
2053
1576
  };
2054
- let response;
2055
1577
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2056
1578
  switch (errorCode) {
2057
1579
  case "AccessDeniedException":
@@ -2077,29 +1599,26 @@ const deserializeAws_restJson1AssociateTrackerConsumerCommandError = async (outp
2077
1599
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2078
1600
  default:
2079
1601
  const parsedBody = parsedOutput.body;
2080
- const $metadata = deserializeMetadata(output);
2081
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2082
- response = new LocationServiceException_1.LocationServiceException({
2083
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2084
- $fault: "client",
2085
- $metadata,
1602
+ (0, smithy_client_1.throwDefaultError)({
1603
+ output,
1604
+ parsedBody,
1605
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1606
+ errorCode,
2086
1607
  });
2087
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2088
1608
  }
2089
1609
  };
2090
1610
  const deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommand = async (output, context) => {
2091
1611
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2092
1612
  return deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError(output, context);
2093
1613
  }
2094
- const contents = {
1614
+ const contents = map({
2095
1615
  $metadata: deserializeMetadata(output),
2096
- Errors: undefined,
2097
- };
1616
+ });
2098
1617
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2099
- if (data.Errors !== undefined && data.Errors !== null) {
1618
+ if (data.Errors != null) {
2100
1619
  contents.Errors = deserializeAws_restJson1BatchDeleteDevicePositionHistoryErrorList(data.Errors, context);
2101
1620
  }
2102
- return Promise.resolve(contents);
1621
+ return contents;
2103
1622
  };
2104
1623
  exports.deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommand = deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommand;
2105
1624
  const deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError = async (output, context) => {
@@ -2107,7 +1626,6 @@ const deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError = asy
2107
1626
  ...output,
2108
1627
  body: await parseBody(output.body, context),
2109
1628
  };
2110
- let response;
2111
1629
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2112
1630
  switch (errorCode) {
2113
1631
  case "AccessDeniedException":
@@ -2127,29 +1645,26 @@ const deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError = asy
2127
1645
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2128
1646
  default:
2129
1647
  const parsedBody = parsedOutput.body;
2130
- const $metadata = deserializeMetadata(output);
2131
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2132
- response = new LocationServiceException_1.LocationServiceException({
2133
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2134
- $fault: "client",
2135
- $metadata,
1648
+ (0, smithy_client_1.throwDefaultError)({
1649
+ output,
1650
+ parsedBody,
1651
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1652
+ errorCode,
2136
1653
  });
2137
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2138
1654
  }
2139
1655
  };
2140
1656
  const deserializeAws_restJson1BatchDeleteGeofenceCommand = async (output, context) => {
2141
1657
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2142
1658
  return deserializeAws_restJson1BatchDeleteGeofenceCommandError(output, context);
2143
1659
  }
2144
- const contents = {
1660
+ const contents = map({
2145
1661
  $metadata: deserializeMetadata(output),
2146
- Errors: undefined,
2147
- };
1662
+ });
2148
1663
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2149
- if (data.Errors !== undefined && data.Errors !== null) {
1664
+ if (data.Errors != null) {
2150
1665
  contents.Errors = deserializeAws_restJson1BatchDeleteGeofenceErrorList(data.Errors, context);
2151
1666
  }
2152
- return Promise.resolve(contents);
1667
+ return contents;
2153
1668
  };
2154
1669
  exports.deserializeAws_restJson1BatchDeleteGeofenceCommand = deserializeAws_restJson1BatchDeleteGeofenceCommand;
2155
1670
  const deserializeAws_restJson1BatchDeleteGeofenceCommandError = async (output, context) => {
@@ -2157,7 +1672,6 @@ const deserializeAws_restJson1BatchDeleteGeofenceCommandError = async (output, c
2157
1672
  ...output,
2158
1673
  body: await parseBody(output.body, context),
2159
1674
  };
2160
- let response;
2161
1675
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2162
1676
  switch (errorCode) {
2163
1677
  case "AccessDeniedException":
@@ -2177,29 +1691,26 @@ const deserializeAws_restJson1BatchDeleteGeofenceCommandError = async (output, c
2177
1691
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2178
1692
  default:
2179
1693
  const parsedBody = parsedOutput.body;
2180
- const $metadata = deserializeMetadata(output);
2181
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2182
- response = new LocationServiceException_1.LocationServiceException({
2183
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2184
- $fault: "client",
2185
- $metadata,
1694
+ (0, smithy_client_1.throwDefaultError)({
1695
+ output,
1696
+ parsedBody,
1697
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1698
+ errorCode,
2186
1699
  });
2187
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2188
1700
  }
2189
1701
  };
2190
1702
  const deserializeAws_restJson1BatchEvaluateGeofencesCommand = async (output, context) => {
2191
1703
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2192
1704
  return deserializeAws_restJson1BatchEvaluateGeofencesCommandError(output, context);
2193
1705
  }
2194
- const contents = {
1706
+ const contents = map({
2195
1707
  $metadata: deserializeMetadata(output),
2196
- Errors: undefined,
2197
- };
1708
+ });
2198
1709
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2199
- if (data.Errors !== undefined && data.Errors !== null) {
1710
+ if (data.Errors != null) {
2200
1711
  contents.Errors = deserializeAws_restJson1BatchEvaluateGeofencesErrorList(data.Errors, context);
2201
1712
  }
2202
- return Promise.resolve(contents);
1713
+ return contents;
2203
1714
  };
2204
1715
  exports.deserializeAws_restJson1BatchEvaluateGeofencesCommand = deserializeAws_restJson1BatchEvaluateGeofencesCommand;
2205
1716
  const deserializeAws_restJson1BatchEvaluateGeofencesCommandError = async (output, context) => {
@@ -2207,7 +1718,6 @@ const deserializeAws_restJson1BatchEvaluateGeofencesCommandError = async (output
2207
1718
  ...output,
2208
1719
  body: await parseBody(output.body, context),
2209
1720
  };
2210
- let response;
2211
1721
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2212
1722
  switch (errorCode) {
2213
1723
  case "AccessDeniedException":
@@ -2227,33 +1737,29 @@ const deserializeAws_restJson1BatchEvaluateGeofencesCommandError = async (output
2227
1737
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2228
1738
  default:
2229
1739
  const parsedBody = parsedOutput.body;
2230
- const $metadata = deserializeMetadata(output);
2231
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2232
- response = new LocationServiceException_1.LocationServiceException({
2233
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2234
- $fault: "client",
2235
- $metadata,
1740
+ (0, smithy_client_1.throwDefaultError)({
1741
+ output,
1742
+ parsedBody,
1743
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1744
+ errorCode,
2236
1745
  });
2237
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2238
1746
  }
2239
1747
  };
2240
1748
  const deserializeAws_restJson1BatchGetDevicePositionCommand = async (output, context) => {
2241
1749
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2242
1750
  return deserializeAws_restJson1BatchGetDevicePositionCommandError(output, context);
2243
1751
  }
2244
- const contents = {
1752
+ const contents = map({
2245
1753
  $metadata: deserializeMetadata(output),
2246
- DevicePositions: undefined,
2247
- Errors: undefined,
2248
- };
1754
+ });
2249
1755
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2250
- if (data.DevicePositions !== undefined && data.DevicePositions !== null) {
1756
+ if (data.DevicePositions != null) {
2251
1757
  contents.DevicePositions = deserializeAws_restJson1DevicePositionList(data.DevicePositions, context);
2252
1758
  }
2253
- if (data.Errors !== undefined && data.Errors !== null) {
1759
+ if (data.Errors != null) {
2254
1760
  contents.Errors = deserializeAws_restJson1BatchGetDevicePositionErrorList(data.Errors, context);
2255
1761
  }
2256
- return Promise.resolve(contents);
1762
+ return contents;
2257
1763
  };
2258
1764
  exports.deserializeAws_restJson1BatchGetDevicePositionCommand = deserializeAws_restJson1BatchGetDevicePositionCommand;
2259
1765
  const deserializeAws_restJson1BatchGetDevicePositionCommandError = async (output, context) => {
@@ -2261,7 +1767,6 @@ const deserializeAws_restJson1BatchGetDevicePositionCommandError = async (output
2261
1767
  ...output,
2262
1768
  body: await parseBody(output.body, context),
2263
1769
  };
2264
- let response;
2265
1770
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2266
1771
  switch (errorCode) {
2267
1772
  case "AccessDeniedException":
@@ -2281,33 +1786,29 @@ const deserializeAws_restJson1BatchGetDevicePositionCommandError = async (output
2281
1786
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2282
1787
  default:
2283
1788
  const parsedBody = parsedOutput.body;
2284
- const $metadata = deserializeMetadata(output);
2285
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2286
- response = new LocationServiceException_1.LocationServiceException({
2287
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2288
- $fault: "client",
2289
- $metadata,
1789
+ (0, smithy_client_1.throwDefaultError)({
1790
+ output,
1791
+ parsedBody,
1792
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1793
+ errorCode,
2290
1794
  });
2291
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2292
1795
  }
2293
1796
  };
2294
1797
  const deserializeAws_restJson1BatchPutGeofenceCommand = async (output, context) => {
2295
1798
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2296
1799
  return deserializeAws_restJson1BatchPutGeofenceCommandError(output, context);
2297
1800
  }
2298
- const contents = {
1801
+ const contents = map({
2299
1802
  $metadata: deserializeMetadata(output),
2300
- Errors: undefined,
2301
- Successes: undefined,
2302
- };
1803
+ });
2303
1804
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2304
- if (data.Errors !== undefined && data.Errors !== null) {
1805
+ if (data.Errors != null) {
2305
1806
  contents.Errors = deserializeAws_restJson1BatchPutGeofenceErrorList(data.Errors, context);
2306
1807
  }
2307
- if (data.Successes !== undefined && data.Successes !== null) {
1808
+ if (data.Successes != null) {
2308
1809
  contents.Successes = deserializeAws_restJson1BatchPutGeofenceSuccessList(data.Successes, context);
2309
1810
  }
2310
- return Promise.resolve(contents);
1811
+ return contents;
2311
1812
  };
2312
1813
  exports.deserializeAws_restJson1BatchPutGeofenceCommand = deserializeAws_restJson1BatchPutGeofenceCommand;
2313
1814
  const deserializeAws_restJson1BatchPutGeofenceCommandError = async (output, context) => {
@@ -2315,7 +1816,6 @@ const deserializeAws_restJson1BatchPutGeofenceCommandError = async (output, cont
2315
1816
  ...output,
2316
1817
  body: await parseBody(output.body, context),
2317
1818
  };
2318
- let response;
2319
1819
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2320
1820
  switch (errorCode) {
2321
1821
  case "AccessDeniedException":
@@ -2335,29 +1835,26 @@ const deserializeAws_restJson1BatchPutGeofenceCommandError = async (output, cont
2335
1835
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2336
1836
  default:
2337
1837
  const parsedBody = parsedOutput.body;
2338
- const $metadata = deserializeMetadata(output);
2339
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2340
- response = new LocationServiceException_1.LocationServiceException({
2341
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2342
- $fault: "client",
2343
- $metadata,
1838
+ (0, smithy_client_1.throwDefaultError)({
1839
+ output,
1840
+ parsedBody,
1841
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1842
+ errorCode,
2344
1843
  });
2345
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2346
1844
  }
2347
1845
  };
2348
1846
  const deserializeAws_restJson1BatchUpdateDevicePositionCommand = async (output, context) => {
2349
1847
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2350
1848
  return deserializeAws_restJson1BatchUpdateDevicePositionCommandError(output, context);
2351
1849
  }
2352
- const contents = {
1850
+ const contents = map({
2353
1851
  $metadata: deserializeMetadata(output),
2354
- Errors: undefined,
2355
- };
1852
+ });
2356
1853
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2357
- if (data.Errors !== undefined && data.Errors !== null) {
1854
+ if (data.Errors != null) {
2358
1855
  contents.Errors = deserializeAws_restJson1BatchUpdateDevicePositionErrorList(data.Errors, context);
2359
1856
  }
2360
- return Promise.resolve(contents);
1857
+ return contents;
2361
1858
  };
2362
1859
  exports.deserializeAws_restJson1BatchUpdateDevicePositionCommand = deserializeAws_restJson1BatchUpdateDevicePositionCommand;
2363
1860
  const deserializeAws_restJson1BatchUpdateDevicePositionCommandError = async (output, context) => {
@@ -2365,7 +1862,6 @@ const deserializeAws_restJson1BatchUpdateDevicePositionCommandError = async (out
2365
1862
  ...output,
2366
1863
  body: await parseBody(output.body, context),
2367
1864
  };
2368
- let response;
2369
1865
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2370
1866
  switch (errorCode) {
2371
1867
  case "AccessDeniedException":
@@ -2385,33 +1881,29 @@ const deserializeAws_restJson1BatchUpdateDevicePositionCommandError = async (out
2385
1881
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2386
1882
  default:
2387
1883
  const parsedBody = parsedOutput.body;
2388
- const $metadata = deserializeMetadata(output);
2389
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2390
- response = new LocationServiceException_1.LocationServiceException({
2391
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2392
- $fault: "client",
2393
- $metadata,
1884
+ (0, smithy_client_1.throwDefaultError)({
1885
+ output,
1886
+ parsedBody,
1887
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1888
+ errorCode,
2394
1889
  });
2395
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2396
1890
  }
2397
1891
  };
2398
1892
  const deserializeAws_restJson1CalculateRouteCommand = async (output, context) => {
2399
1893
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2400
1894
  return deserializeAws_restJson1CalculateRouteCommandError(output, context);
2401
1895
  }
2402
- const contents = {
1896
+ const contents = map({
2403
1897
  $metadata: deserializeMetadata(output),
2404
- Legs: undefined,
2405
- Summary: undefined,
2406
- };
1898
+ });
2407
1899
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2408
- if (data.Legs !== undefined && data.Legs !== null) {
1900
+ if (data.Legs != null) {
2409
1901
  contents.Legs = deserializeAws_restJson1LegList(data.Legs, context);
2410
1902
  }
2411
- if (data.Summary !== undefined && data.Summary !== null) {
1903
+ if (data.Summary != null) {
2412
1904
  contents.Summary = deserializeAws_restJson1CalculateRouteSummary(data.Summary, context);
2413
1905
  }
2414
- return Promise.resolve(contents);
1906
+ return contents;
2415
1907
  };
2416
1908
  exports.deserializeAws_restJson1CalculateRouteCommand = deserializeAws_restJson1CalculateRouteCommand;
2417
1909
  const deserializeAws_restJson1CalculateRouteCommandError = async (output, context) => {
@@ -2419,7 +1911,6 @@ const deserializeAws_restJson1CalculateRouteCommandError = async (output, contex
2419
1911
  ...output,
2420
1912
  body: await parseBody(output.body, context),
2421
1913
  };
2422
- let response;
2423
1914
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2424
1915
  switch (errorCode) {
2425
1916
  case "AccessDeniedException":
@@ -2439,41 +1930,35 @@ const deserializeAws_restJson1CalculateRouteCommandError = async (output, contex
2439
1930
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2440
1931
  default:
2441
1932
  const parsedBody = parsedOutput.body;
2442
- const $metadata = deserializeMetadata(output);
2443
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2444
- response = new LocationServiceException_1.LocationServiceException({
2445
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2446
- $fault: "client",
2447
- $metadata,
1933
+ (0, smithy_client_1.throwDefaultError)({
1934
+ output,
1935
+ parsedBody,
1936
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1937
+ errorCode,
2448
1938
  });
2449
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2450
1939
  }
2451
1940
  };
2452
1941
  const deserializeAws_restJson1CalculateRouteMatrixCommand = async (output, context) => {
2453
1942
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2454
1943
  return deserializeAws_restJson1CalculateRouteMatrixCommandError(output, context);
2455
1944
  }
2456
- const contents = {
1945
+ const contents = map({
2457
1946
  $metadata: deserializeMetadata(output),
2458
- RouteMatrix: undefined,
2459
- SnappedDeparturePositions: undefined,
2460
- SnappedDestinationPositions: undefined,
2461
- Summary: undefined,
2462
- };
1947
+ });
2463
1948
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2464
- if (data.RouteMatrix !== undefined && data.RouteMatrix !== null) {
1949
+ if (data.RouteMatrix != null) {
2465
1950
  contents.RouteMatrix = deserializeAws_restJson1RouteMatrix(data.RouteMatrix, context);
2466
1951
  }
2467
- if (data.SnappedDeparturePositions !== undefined && data.SnappedDeparturePositions !== null) {
1952
+ if (data.SnappedDeparturePositions != null) {
2468
1953
  contents.SnappedDeparturePositions = deserializeAws_restJson1PositionList(data.SnappedDeparturePositions, context);
2469
1954
  }
2470
- if (data.SnappedDestinationPositions !== undefined && data.SnappedDestinationPositions !== null) {
1955
+ if (data.SnappedDestinationPositions != null) {
2471
1956
  contents.SnappedDestinationPositions = deserializeAws_restJson1PositionList(data.SnappedDestinationPositions, context);
2472
1957
  }
2473
- if (data.Summary !== undefined && data.Summary !== null) {
1958
+ if (data.Summary != null) {
2474
1959
  contents.Summary = deserializeAws_restJson1CalculateRouteMatrixSummary(data.Summary, context);
2475
1960
  }
2476
- return Promise.resolve(contents);
1961
+ return contents;
2477
1962
  };
2478
1963
  exports.deserializeAws_restJson1CalculateRouteMatrixCommand = deserializeAws_restJson1CalculateRouteMatrixCommand;
2479
1964
  const deserializeAws_restJson1CalculateRouteMatrixCommandError = async (output, context) => {
@@ -2481,7 +1966,6 @@ const deserializeAws_restJson1CalculateRouteMatrixCommandError = async (output,
2481
1966
  ...output,
2482
1967
  body: await parseBody(output.body, context),
2483
1968
  };
2484
- let response;
2485
1969
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2486
1970
  switch (errorCode) {
2487
1971
  case "AccessDeniedException":
@@ -2501,37 +1985,32 @@ const deserializeAws_restJson1CalculateRouteMatrixCommandError = async (output,
2501
1985
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2502
1986
  default:
2503
1987
  const parsedBody = parsedOutput.body;
2504
- const $metadata = deserializeMetadata(output);
2505
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2506
- response = new LocationServiceException_1.LocationServiceException({
2507
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2508
- $fault: "client",
2509
- $metadata,
1988
+ (0, smithy_client_1.throwDefaultError)({
1989
+ output,
1990
+ parsedBody,
1991
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
1992
+ errorCode,
2510
1993
  });
2511
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2512
1994
  }
2513
1995
  };
2514
1996
  const deserializeAws_restJson1CreateGeofenceCollectionCommand = async (output, context) => {
2515
1997
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2516
1998
  return deserializeAws_restJson1CreateGeofenceCollectionCommandError(output, context);
2517
1999
  }
2518
- const contents = {
2000
+ const contents = map({
2519
2001
  $metadata: deserializeMetadata(output),
2520
- CollectionArn: undefined,
2521
- CollectionName: undefined,
2522
- CreateTime: undefined,
2523
- };
2002
+ });
2524
2003
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2525
- if (data.CollectionArn !== undefined && data.CollectionArn !== null) {
2004
+ if (data.CollectionArn != null) {
2526
2005
  contents.CollectionArn = (0, smithy_client_1.expectString)(data.CollectionArn);
2527
2006
  }
2528
- if (data.CollectionName !== undefined && data.CollectionName !== null) {
2007
+ if (data.CollectionName != null) {
2529
2008
  contents.CollectionName = (0, smithy_client_1.expectString)(data.CollectionName);
2530
2009
  }
2531
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2010
+ if (data.CreateTime != null) {
2532
2011
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
2533
2012
  }
2534
- return Promise.resolve(contents);
2013
+ return contents;
2535
2014
  };
2536
2015
  exports.deserializeAws_restJson1CreateGeofenceCollectionCommand = deserializeAws_restJson1CreateGeofenceCollectionCommand;
2537
2016
  const deserializeAws_restJson1CreateGeofenceCollectionCommandError = async (output, context) => {
@@ -2539,7 +2018,6 @@ const deserializeAws_restJson1CreateGeofenceCollectionCommandError = async (outp
2539
2018
  ...output,
2540
2019
  body: await parseBody(output.body, context),
2541
2020
  };
2542
- let response;
2543
2021
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2544
2022
  switch (errorCode) {
2545
2023
  case "AccessDeniedException":
@@ -2559,37 +2037,32 @@ const deserializeAws_restJson1CreateGeofenceCollectionCommandError = async (outp
2559
2037
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2560
2038
  default:
2561
2039
  const parsedBody = parsedOutput.body;
2562
- const $metadata = deserializeMetadata(output);
2563
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2564
- response = new LocationServiceException_1.LocationServiceException({
2565
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2566
- $fault: "client",
2567
- $metadata,
2040
+ (0, smithy_client_1.throwDefaultError)({
2041
+ output,
2042
+ parsedBody,
2043
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2044
+ errorCode,
2568
2045
  });
2569
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2570
2046
  }
2571
2047
  };
2572
2048
  const deserializeAws_restJson1CreateMapCommand = async (output, context) => {
2573
2049
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2574
2050
  return deserializeAws_restJson1CreateMapCommandError(output, context);
2575
2051
  }
2576
- const contents = {
2052
+ const contents = map({
2577
2053
  $metadata: deserializeMetadata(output),
2578
- CreateTime: undefined,
2579
- MapArn: undefined,
2580
- MapName: undefined,
2581
- };
2054
+ });
2582
2055
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2583
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2056
+ if (data.CreateTime != null) {
2584
2057
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
2585
2058
  }
2586
- if (data.MapArn !== undefined && data.MapArn !== null) {
2059
+ if (data.MapArn != null) {
2587
2060
  contents.MapArn = (0, smithy_client_1.expectString)(data.MapArn);
2588
2061
  }
2589
- if (data.MapName !== undefined && data.MapName !== null) {
2062
+ if (data.MapName != null) {
2590
2063
  contents.MapName = (0, smithy_client_1.expectString)(data.MapName);
2591
2064
  }
2592
- return Promise.resolve(contents);
2065
+ return contents;
2593
2066
  };
2594
2067
  exports.deserializeAws_restJson1CreateMapCommand = deserializeAws_restJson1CreateMapCommand;
2595
2068
  const deserializeAws_restJson1CreateMapCommandError = async (output, context) => {
@@ -2597,7 +2070,6 @@ const deserializeAws_restJson1CreateMapCommandError = async (output, context) =>
2597
2070
  ...output,
2598
2071
  body: await parseBody(output.body, context),
2599
2072
  };
2600
- let response;
2601
2073
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2602
2074
  switch (errorCode) {
2603
2075
  case "AccessDeniedException":
@@ -2617,37 +2089,32 @@ const deserializeAws_restJson1CreateMapCommandError = async (output, context) =>
2617
2089
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2618
2090
  default:
2619
2091
  const parsedBody = parsedOutput.body;
2620
- const $metadata = deserializeMetadata(output);
2621
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2622
- response = new LocationServiceException_1.LocationServiceException({
2623
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2624
- $fault: "client",
2625
- $metadata,
2092
+ (0, smithy_client_1.throwDefaultError)({
2093
+ output,
2094
+ parsedBody,
2095
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2096
+ errorCode,
2626
2097
  });
2627
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2628
2098
  }
2629
2099
  };
2630
2100
  const deserializeAws_restJson1CreatePlaceIndexCommand = async (output, context) => {
2631
2101
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2632
2102
  return deserializeAws_restJson1CreatePlaceIndexCommandError(output, context);
2633
2103
  }
2634
- const contents = {
2104
+ const contents = map({
2635
2105
  $metadata: deserializeMetadata(output),
2636
- CreateTime: undefined,
2637
- IndexArn: undefined,
2638
- IndexName: undefined,
2639
- };
2106
+ });
2640
2107
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2641
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2108
+ if (data.CreateTime != null) {
2642
2109
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
2643
2110
  }
2644
- if (data.IndexArn !== undefined && data.IndexArn !== null) {
2111
+ if (data.IndexArn != null) {
2645
2112
  contents.IndexArn = (0, smithy_client_1.expectString)(data.IndexArn);
2646
2113
  }
2647
- if (data.IndexName !== undefined && data.IndexName !== null) {
2114
+ if (data.IndexName != null) {
2648
2115
  contents.IndexName = (0, smithy_client_1.expectString)(data.IndexName);
2649
2116
  }
2650
- return Promise.resolve(contents);
2117
+ return contents;
2651
2118
  };
2652
2119
  exports.deserializeAws_restJson1CreatePlaceIndexCommand = deserializeAws_restJson1CreatePlaceIndexCommand;
2653
2120
  const deserializeAws_restJson1CreatePlaceIndexCommandError = async (output, context) => {
@@ -2655,7 +2122,6 @@ const deserializeAws_restJson1CreatePlaceIndexCommandError = async (output, cont
2655
2122
  ...output,
2656
2123
  body: await parseBody(output.body, context),
2657
2124
  };
2658
- let response;
2659
2125
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2660
2126
  switch (errorCode) {
2661
2127
  case "AccessDeniedException":
@@ -2675,37 +2141,32 @@ const deserializeAws_restJson1CreatePlaceIndexCommandError = async (output, cont
2675
2141
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2676
2142
  default:
2677
2143
  const parsedBody = parsedOutput.body;
2678
- const $metadata = deserializeMetadata(output);
2679
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2680
- response = new LocationServiceException_1.LocationServiceException({
2681
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2682
- $fault: "client",
2683
- $metadata,
2144
+ (0, smithy_client_1.throwDefaultError)({
2145
+ output,
2146
+ parsedBody,
2147
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2148
+ errorCode,
2684
2149
  });
2685
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2686
2150
  }
2687
2151
  };
2688
2152
  const deserializeAws_restJson1CreateRouteCalculatorCommand = async (output, context) => {
2689
2153
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2690
2154
  return deserializeAws_restJson1CreateRouteCalculatorCommandError(output, context);
2691
2155
  }
2692
- const contents = {
2156
+ const contents = map({
2693
2157
  $metadata: deserializeMetadata(output),
2694
- CalculatorArn: undefined,
2695
- CalculatorName: undefined,
2696
- CreateTime: undefined,
2697
- };
2158
+ });
2698
2159
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2699
- if (data.CalculatorArn !== undefined && data.CalculatorArn !== null) {
2160
+ if (data.CalculatorArn != null) {
2700
2161
  contents.CalculatorArn = (0, smithy_client_1.expectString)(data.CalculatorArn);
2701
2162
  }
2702
- if (data.CalculatorName !== undefined && data.CalculatorName !== null) {
2163
+ if (data.CalculatorName != null) {
2703
2164
  contents.CalculatorName = (0, smithy_client_1.expectString)(data.CalculatorName);
2704
2165
  }
2705
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2166
+ if (data.CreateTime != null) {
2706
2167
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
2707
2168
  }
2708
- return Promise.resolve(contents);
2169
+ return contents;
2709
2170
  };
2710
2171
  exports.deserializeAws_restJson1CreateRouteCalculatorCommand = deserializeAws_restJson1CreateRouteCalculatorCommand;
2711
2172
  const deserializeAws_restJson1CreateRouteCalculatorCommandError = async (output, context) => {
@@ -2713,7 +2174,6 @@ const deserializeAws_restJson1CreateRouteCalculatorCommandError = async (output,
2713
2174
  ...output,
2714
2175
  body: await parseBody(output.body, context),
2715
2176
  };
2716
- let response;
2717
2177
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2718
2178
  switch (errorCode) {
2719
2179
  case "AccessDeniedException":
@@ -2733,37 +2193,32 @@ const deserializeAws_restJson1CreateRouteCalculatorCommandError = async (output,
2733
2193
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2734
2194
  default:
2735
2195
  const parsedBody = parsedOutput.body;
2736
- const $metadata = deserializeMetadata(output);
2737
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2738
- response = new LocationServiceException_1.LocationServiceException({
2739
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2740
- $fault: "client",
2741
- $metadata,
2196
+ (0, smithy_client_1.throwDefaultError)({
2197
+ output,
2198
+ parsedBody,
2199
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2200
+ errorCode,
2742
2201
  });
2743
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2744
2202
  }
2745
2203
  };
2746
2204
  const deserializeAws_restJson1CreateTrackerCommand = async (output, context) => {
2747
2205
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2748
2206
  return deserializeAws_restJson1CreateTrackerCommandError(output, context);
2749
2207
  }
2750
- const contents = {
2208
+ const contents = map({
2751
2209
  $metadata: deserializeMetadata(output),
2752
- CreateTime: undefined,
2753
- TrackerArn: undefined,
2754
- TrackerName: undefined,
2755
- };
2210
+ });
2756
2211
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2757
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2212
+ if (data.CreateTime != null) {
2758
2213
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
2759
2214
  }
2760
- if (data.TrackerArn !== undefined && data.TrackerArn !== null) {
2215
+ if (data.TrackerArn != null) {
2761
2216
  contents.TrackerArn = (0, smithy_client_1.expectString)(data.TrackerArn);
2762
2217
  }
2763
- if (data.TrackerName !== undefined && data.TrackerName !== null) {
2218
+ if (data.TrackerName != null) {
2764
2219
  contents.TrackerName = (0, smithy_client_1.expectString)(data.TrackerName);
2765
2220
  }
2766
- return Promise.resolve(contents);
2221
+ return contents;
2767
2222
  };
2768
2223
  exports.deserializeAws_restJson1CreateTrackerCommand = deserializeAws_restJson1CreateTrackerCommand;
2769
2224
  const deserializeAws_restJson1CreateTrackerCommandError = async (output, context) => {
@@ -2771,7 +2226,6 @@ const deserializeAws_restJson1CreateTrackerCommandError = async (output, context
2771
2226
  ...output,
2772
2227
  body: await parseBody(output.body, context),
2773
2228
  };
2774
- let response;
2775
2229
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2776
2230
  switch (errorCode) {
2777
2231
  case "AccessDeniedException":
@@ -2791,25 +2245,23 @@ const deserializeAws_restJson1CreateTrackerCommandError = async (output, context
2791
2245
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2792
2246
  default:
2793
2247
  const parsedBody = parsedOutput.body;
2794
- const $metadata = deserializeMetadata(output);
2795
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2796
- response = new LocationServiceException_1.LocationServiceException({
2797
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2798
- $fault: "client",
2799
- $metadata,
2248
+ (0, smithy_client_1.throwDefaultError)({
2249
+ output,
2250
+ parsedBody,
2251
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2252
+ errorCode,
2800
2253
  });
2801
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2802
2254
  }
2803
2255
  };
2804
2256
  const deserializeAws_restJson1DeleteGeofenceCollectionCommand = async (output, context) => {
2805
2257
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2806
2258
  return deserializeAws_restJson1DeleteGeofenceCollectionCommandError(output, context);
2807
2259
  }
2808
- const contents = {
2260
+ const contents = map({
2809
2261
  $metadata: deserializeMetadata(output),
2810
- };
2262
+ });
2811
2263
  await collectBody(output.body, context);
2812
- return Promise.resolve(contents);
2264
+ return contents;
2813
2265
  };
2814
2266
  exports.deserializeAws_restJson1DeleteGeofenceCollectionCommand = deserializeAws_restJson1DeleteGeofenceCollectionCommand;
2815
2267
  const deserializeAws_restJson1DeleteGeofenceCollectionCommandError = async (output, context) => {
@@ -2817,7 +2269,6 @@ const deserializeAws_restJson1DeleteGeofenceCollectionCommandError = async (outp
2817
2269
  ...output,
2818
2270
  body: await parseBody(output.body, context),
2819
2271
  };
2820
- let response;
2821
2272
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2822
2273
  switch (errorCode) {
2823
2274
  case "AccessDeniedException":
@@ -2837,25 +2288,23 @@ const deserializeAws_restJson1DeleteGeofenceCollectionCommandError = async (outp
2837
2288
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2838
2289
  default:
2839
2290
  const parsedBody = parsedOutput.body;
2840
- const $metadata = deserializeMetadata(output);
2841
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2842
- response = new LocationServiceException_1.LocationServiceException({
2843
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2844
- $fault: "client",
2845
- $metadata,
2291
+ (0, smithy_client_1.throwDefaultError)({
2292
+ output,
2293
+ parsedBody,
2294
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2295
+ errorCode,
2846
2296
  });
2847
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2848
2297
  }
2849
2298
  };
2850
2299
  const deserializeAws_restJson1DeleteMapCommand = async (output, context) => {
2851
2300
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2852
2301
  return deserializeAws_restJson1DeleteMapCommandError(output, context);
2853
2302
  }
2854
- const contents = {
2303
+ const contents = map({
2855
2304
  $metadata: deserializeMetadata(output),
2856
- };
2305
+ });
2857
2306
  await collectBody(output.body, context);
2858
- return Promise.resolve(contents);
2307
+ return contents;
2859
2308
  };
2860
2309
  exports.deserializeAws_restJson1DeleteMapCommand = deserializeAws_restJson1DeleteMapCommand;
2861
2310
  const deserializeAws_restJson1DeleteMapCommandError = async (output, context) => {
@@ -2863,7 +2312,6 @@ const deserializeAws_restJson1DeleteMapCommandError = async (output, context) =>
2863
2312
  ...output,
2864
2313
  body: await parseBody(output.body, context),
2865
2314
  };
2866
- let response;
2867
2315
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2868
2316
  switch (errorCode) {
2869
2317
  case "AccessDeniedException":
@@ -2883,25 +2331,23 @@ const deserializeAws_restJson1DeleteMapCommandError = async (output, context) =>
2883
2331
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2884
2332
  default:
2885
2333
  const parsedBody = parsedOutput.body;
2886
- const $metadata = deserializeMetadata(output);
2887
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2888
- response = new LocationServiceException_1.LocationServiceException({
2889
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2890
- $fault: "client",
2891
- $metadata,
2334
+ (0, smithy_client_1.throwDefaultError)({
2335
+ output,
2336
+ parsedBody,
2337
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2338
+ errorCode,
2892
2339
  });
2893
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2894
2340
  }
2895
2341
  };
2896
2342
  const deserializeAws_restJson1DeletePlaceIndexCommand = async (output, context) => {
2897
2343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2898
2344
  return deserializeAws_restJson1DeletePlaceIndexCommandError(output, context);
2899
2345
  }
2900
- const contents = {
2346
+ const contents = map({
2901
2347
  $metadata: deserializeMetadata(output),
2902
- };
2348
+ });
2903
2349
  await collectBody(output.body, context);
2904
- return Promise.resolve(contents);
2350
+ return contents;
2905
2351
  };
2906
2352
  exports.deserializeAws_restJson1DeletePlaceIndexCommand = deserializeAws_restJson1DeletePlaceIndexCommand;
2907
2353
  const deserializeAws_restJson1DeletePlaceIndexCommandError = async (output, context) => {
@@ -2909,7 +2355,6 @@ const deserializeAws_restJson1DeletePlaceIndexCommandError = async (output, cont
2909
2355
  ...output,
2910
2356
  body: await parseBody(output.body, context),
2911
2357
  };
2912
- let response;
2913
2358
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2914
2359
  switch (errorCode) {
2915
2360
  case "AccessDeniedException":
@@ -2929,25 +2374,23 @@ const deserializeAws_restJson1DeletePlaceIndexCommandError = async (output, cont
2929
2374
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2930
2375
  default:
2931
2376
  const parsedBody = parsedOutput.body;
2932
- const $metadata = deserializeMetadata(output);
2933
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2934
- response = new LocationServiceException_1.LocationServiceException({
2935
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2936
- $fault: "client",
2937
- $metadata,
2377
+ (0, smithy_client_1.throwDefaultError)({
2378
+ output,
2379
+ parsedBody,
2380
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2381
+ errorCode,
2938
2382
  });
2939
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2940
2383
  }
2941
2384
  };
2942
2385
  const deserializeAws_restJson1DeleteRouteCalculatorCommand = async (output, context) => {
2943
2386
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2944
2387
  return deserializeAws_restJson1DeleteRouteCalculatorCommandError(output, context);
2945
2388
  }
2946
- const contents = {
2389
+ const contents = map({
2947
2390
  $metadata: deserializeMetadata(output),
2948
- };
2391
+ });
2949
2392
  await collectBody(output.body, context);
2950
- return Promise.resolve(contents);
2393
+ return contents;
2951
2394
  };
2952
2395
  exports.deserializeAws_restJson1DeleteRouteCalculatorCommand = deserializeAws_restJson1DeleteRouteCalculatorCommand;
2953
2396
  const deserializeAws_restJson1DeleteRouteCalculatorCommandError = async (output, context) => {
@@ -2955,7 +2398,6 @@ const deserializeAws_restJson1DeleteRouteCalculatorCommandError = async (output,
2955
2398
  ...output,
2956
2399
  body: await parseBody(output.body, context),
2957
2400
  };
2958
- let response;
2959
2401
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2960
2402
  switch (errorCode) {
2961
2403
  case "AccessDeniedException":
@@ -2975,25 +2417,23 @@ const deserializeAws_restJson1DeleteRouteCalculatorCommandError = async (output,
2975
2417
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2976
2418
  default:
2977
2419
  const parsedBody = parsedOutput.body;
2978
- const $metadata = deserializeMetadata(output);
2979
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2980
- response = new LocationServiceException_1.LocationServiceException({
2981
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2982
- $fault: "client",
2983
- $metadata,
2420
+ (0, smithy_client_1.throwDefaultError)({
2421
+ output,
2422
+ parsedBody,
2423
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2424
+ errorCode,
2984
2425
  });
2985
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2986
2426
  }
2987
2427
  };
2988
2428
  const deserializeAws_restJson1DeleteTrackerCommand = async (output, context) => {
2989
2429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2990
2430
  return deserializeAws_restJson1DeleteTrackerCommandError(output, context);
2991
2431
  }
2992
- const contents = {
2432
+ const contents = map({
2993
2433
  $metadata: deserializeMetadata(output),
2994
- };
2434
+ });
2995
2435
  await collectBody(output.body, context);
2996
- return Promise.resolve(contents);
2436
+ return contents;
2997
2437
  };
2998
2438
  exports.deserializeAws_restJson1DeleteTrackerCommand = deserializeAws_restJson1DeleteTrackerCommand;
2999
2439
  const deserializeAws_restJson1DeleteTrackerCommandError = async (output, context) => {
@@ -3001,7 +2441,6 @@ const deserializeAws_restJson1DeleteTrackerCommandError = async (output, context
3001
2441
  ...output,
3002
2442
  body: await parseBody(output.body, context),
3003
2443
  };
3004
- let response;
3005
2444
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3006
2445
  switch (errorCode) {
3007
2446
  case "AccessDeniedException":
@@ -3021,61 +2460,50 @@ const deserializeAws_restJson1DeleteTrackerCommandError = async (output, context
3021
2460
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3022
2461
  default:
3023
2462
  const parsedBody = parsedOutput.body;
3024
- const $metadata = deserializeMetadata(output);
3025
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3026
- response = new LocationServiceException_1.LocationServiceException({
3027
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3028
- $fault: "client",
3029
- $metadata,
2463
+ (0, smithy_client_1.throwDefaultError)({
2464
+ output,
2465
+ parsedBody,
2466
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2467
+ errorCode,
3030
2468
  });
3031
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3032
2469
  }
3033
2470
  };
3034
2471
  const deserializeAws_restJson1DescribeGeofenceCollectionCommand = async (output, context) => {
3035
2472
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3036
2473
  return deserializeAws_restJson1DescribeGeofenceCollectionCommandError(output, context);
3037
2474
  }
3038
- const contents = {
2475
+ const contents = map({
3039
2476
  $metadata: deserializeMetadata(output),
3040
- CollectionArn: undefined,
3041
- CollectionName: undefined,
3042
- CreateTime: undefined,
3043
- Description: undefined,
3044
- KmsKeyId: undefined,
3045
- PricingPlan: undefined,
3046
- PricingPlanDataSource: undefined,
3047
- Tags: undefined,
3048
- UpdateTime: undefined,
3049
- };
2477
+ });
3050
2478
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3051
- if (data.CollectionArn !== undefined && data.CollectionArn !== null) {
2479
+ if (data.CollectionArn != null) {
3052
2480
  contents.CollectionArn = (0, smithy_client_1.expectString)(data.CollectionArn);
3053
2481
  }
3054
- if (data.CollectionName !== undefined && data.CollectionName !== null) {
2482
+ if (data.CollectionName != null) {
3055
2483
  contents.CollectionName = (0, smithy_client_1.expectString)(data.CollectionName);
3056
2484
  }
3057
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2485
+ if (data.CreateTime != null) {
3058
2486
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3059
2487
  }
3060
- if (data.Description !== undefined && data.Description !== null) {
2488
+ if (data.Description != null) {
3061
2489
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3062
2490
  }
3063
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
2491
+ if (data.KmsKeyId != null) {
3064
2492
  contents.KmsKeyId = (0, smithy_client_1.expectString)(data.KmsKeyId);
3065
2493
  }
3066
- if (data.PricingPlan !== undefined && data.PricingPlan !== null) {
2494
+ if (data.PricingPlan != null) {
3067
2495
  contents.PricingPlan = (0, smithy_client_1.expectString)(data.PricingPlan);
3068
2496
  }
3069
- if (data.PricingPlanDataSource !== undefined && data.PricingPlanDataSource !== null) {
2497
+ if (data.PricingPlanDataSource != null) {
3070
2498
  contents.PricingPlanDataSource = (0, smithy_client_1.expectString)(data.PricingPlanDataSource);
3071
2499
  }
3072
- if (data.Tags !== undefined && data.Tags !== null) {
2500
+ if (data.Tags != null) {
3073
2501
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3074
2502
  }
3075
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2503
+ if (data.UpdateTime != null) {
3076
2504
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3077
2505
  }
3078
- return Promise.resolve(contents);
2506
+ return contents;
3079
2507
  };
3080
2508
  exports.deserializeAws_restJson1DescribeGeofenceCollectionCommand = deserializeAws_restJson1DescribeGeofenceCollectionCommand;
3081
2509
  const deserializeAws_restJson1DescribeGeofenceCollectionCommandError = async (output, context) => {
@@ -3083,7 +2511,6 @@ const deserializeAws_restJson1DescribeGeofenceCollectionCommandError = async (ou
3083
2511
  ...output,
3084
2512
  body: await parseBody(output.body, context),
3085
2513
  };
3086
- let response;
3087
2514
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3088
2515
  switch (errorCode) {
3089
2516
  case "AccessDeniedException":
@@ -3103,61 +2530,50 @@ const deserializeAws_restJson1DescribeGeofenceCollectionCommandError = async (ou
3103
2530
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3104
2531
  default:
3105
2532
  const parsedBody = parsedOutput.body;
3106
- const $metadata = deserializeMetadata(output);
3107
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3108
- response = new LocationServiceException_1.LocationServiceException({
3109
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3110
- $fault: "client",
3111
- $metadata,
2533
+ (0, smithy_client_1.throwDefaultError)({
2534
+ output,
2535
+ parsedBody,
2536
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2537
+ errorCode,
3112
2538
  });
3113
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3114
2539
  }
3115
2540
  };
3116
2541
  const deserializeAws_restJson1DescribeMapCommand = async (output, context) => {
3117
2542
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3118
2543
  return deserializeAws_restJson1DescribeMapCommandError(output, context);
3119
2544
  }
3120
- const contents = {
2545
+ const contents = map({
3121
2546
  $metadata: deserializeMetadata(output),
3122
- Configuration: undefined,
3123
- CreateTime: undefined,
3124
- DataSource: undefined,
3125
- Description: undefined,
3126
- MapArn: undefined,
3127
- MapName: undefined,
3128
- PricingPlan: undefined,
3129
- Tags: undefined,
3130
- UpdateTime: undefined,
3131
- };
2547
+ });
3132
2548
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3133
- if (data.Configuration !== undefined && data.Configuration !== null) {
2549
+ if (data.Configuration != null) {
3134
2550
  contents.Configuration = deserializeAws_restJson1MapConfiguration(data.Configuration, context);
3135
2551
  }
3136
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2552
+ if (data.CreateTime != null) {
3137
2553
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3138
2554
  }
3139
- if (data.DataSource !== undefined && data.DataSource !== null) {
2555
+ if (data.DataSource != null) {
3140
2556
  contents.DataSource = (0, smithy_client_1.expectString)(data.DataSource);
3141
2557
  }
3142
- if (data.Description !== undefined && data.Description !== null) {
2558
+ if (data.Description != null) {
3143
2559
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3144
2560
  }
3145
- if (data.MapArn !== undefined && data.MapArn !== null) {
2561
+ if (data.MapArn != null) {
3146
2562
  contents.MapArn = (0, smithy_client_1.expectString)(data.MapArn);
3147
2563
  }
3148
- if (data.MapName !== undefined && data.MapName !== null) {
2564
+ if (data.MapName != null) {
3149
2565
  contents.MapName = (0, smithy_client_1.expectString)(data.MapName);
3150
2566
  }
3151
- if (data.PricingPlan !== undefined && data.PricingPlan !== null) {
2567
+ if (data.PricingPlan != null) {
3152
2568
  contents.PricingPlan = (0, smithy_client_1.expectString)(data.PricingPlan);
3153
2569
  }
3154
- if (data.Tags !== undefined && data.Tags !== null) {
2570
+ if (data.Tags != null) {
3155
2571
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3156
2572
  }
3157
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2573
+ if (data.UpdateTime != null) {
3158
2574
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3159
2575
  }
3160
- return Promise.resolve(contents);
2576
+ return contents;
3161
2577
  };
3162
2578
  exports.deserializeAws_restJson1DescribeMapCommand = deserializeAws_restJson1DescribeMapCommand;
3163
2579
  const deserializeAws_restJson1DescribeMapCommandError = async (output, context) => {
@@ -3165,7 +2581,6 @@ const deserializeAws_restJson1DescribeMapCommandError = async (output, context)
3165
2581
  ...output,
3166
2582
  body: await parseBody(output.body, context),
3167
2583
  };
3168
- let response;
3169
2584
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3170
2585
  switch (errorCode) {
3171
2586
  case "AccessDeniedException":
@@ -3185,61 +2600,50 @@ const deserializeAws_restJson1DescribeMapCommandError = async (output, context)
3185
2600
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3186
2601
  default:
3187
2602
  const parsedBody = parsedOutput.body;
3188
- const $metadata = deserializeMetadata(output);
3189
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3190
- response = new LocationServiceException_1.LocationServiceException({
3191
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3192
- $fault: "client",
3193
- $metadata,
2603
+ (0, smithy_client_1.throwDefaultError)({
2604
+ output,
2605
+ parsedBody,
2606
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2607
+ errorCode,
3194
2608
  });
3195
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3196
2609
  }
3197
2610
  };
3198
2611
  const deserializeAws_restJson1DescribePlaceIndexCommand = async (output, context) => {
3199
2612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3200
2613
  return deserializeAws_restJson1DescribePlaceIndexCommandError(output, context);
3201
2614
  }
3202
- const contents = {
2615
+ const contents = map({
3203
2616
  $metadata: deserializeMetadata(output),
3204
- CreateTime: undefined,
3205
- DataSource: undefined,
3206
- DataSourceConfiguration: undefined,
3207
- Description: undefined,
3208
- IndexArn: undefined,
3209
- IndexName: undefined,
3210
- PricingPlan: undefined,
3211
- Tags: undefined,
3212
- UpdateTime: undefined,
3213
- };
2617
+ });
3214
2618
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3215
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2619
+ if (data.CreateTime != null) {
3216
2620
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3217
2621
  }
3218
- if (data.DataSource !== undefined && data.DataSource !== null) {
2622
+ if (data.DataSource != null) {
3219
2623
  contents.DataSource = (0, smithy_client_1.expectString)(data.DataSource);
3220
2624
  }
3221
- if (data.DataSourceConfiguration !== undefined && data.DataSourceConfiguration !== null) {
2625
+ if (data.DataSourceConfiguration != null) {
3222
2626
  contents.DataSourceConfiguration = deserializeAws_restJson1DataSourceConfiguration(data.DataSourceConfiguration, context);
3223
2627
  }
3224
- if (data.Description !== undefined && data.Description !== null) {
2628
+ if (data.Description != null) {
3225
2629
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3226
2630
  }
3227
- if (data.IndexArn !== undefined && data.IndexArn !== null) {
2631
+ if (data.IndexArn != null) {
3228
2632
  contents.IndexArn = (0, smithy_client_1.expectString)(data.IndexArn);
3229
2633
  }
3230
- if (data.IndexName !== undefined && data.IndexName !== null) {
2634
+ if (data.IndexName != null) {
3231
2635
  contents.IndexName = (0, smithy_client_1.expectString)(data.IndexName);
3232
2636
  }
3233
- if (data.PricingPlan !== undefined && data.PricingPlan !== null) {
2637
+ if (data.PricingPlan != null) {
3234
2638
  contents.PricingPlan = (0, smithy_client_1.expectString)(data.PricingPlan);
3235
2639
  }
3236
- if (data.Tags !== undefined && data.Tags !== null) {
2640
+ if (data.Tags != null) {
3237
2641
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3238
2642
  }
3239
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2643
+ if (data.UpdateTime != null) {
3240
2644
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3241
2645
  }
3242
- return Promise.resolve(contents);
2646
+ return contents;
3243
2647
  };
3244
2648
  exports.deserializeAws_restJson1DescribePlaceIndexCommand = deserializeAws_restJson1DescribePlaceIndexCommand;
3245
2649
  const deserializeAws_restJson1DescribePlaceIndexCommandError = async (output, context) => {
@@ -3247,7 +2651,6 @@ const deserializeAws_restJson1DescribePlaceIndexCommandError = async (output, co
3247
2651
  ...output,
3248
2652
  body: await parseBody(output.body, context),
3249
2653
  };
3250
- let response;
3251
2654
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3252
2655
  switch (errorCode) {
3253
2656
  case "AccessDeniedException":
@@ -3267,57 +2670,47 @@ const deserializeAws_restJson1DescribePlaceIndexCommandError = async (output, co
3267
2670
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3268
2671
  default:
3269
2672
  const parsedBody = parsedOutput.body;
3270
- const $metadata = deserializeMetadata(output);
3271
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3272
- response = new LocationServiceException_1.LocationServiceException({
3273
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3274
- $fault: "client",
3275
- $metadata,
2673
+ (0, smithy_client_1.throwDefaultError)({
2674
+ output,
2675
+ parsedBody,
2676
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2677
+ errorCode,
3276
2678
  });
3277
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3278
2679
  }
3279
2680
  };
3280
2681
  const deserializeAws_restJson1DescribeRouteCalculatorCommand = async (output, context) => {
3281
2682
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3282
2683
  return deserializeAws_restJson1DescribeRouteCalculatorCommandError(output, context);
3283
2684
  }
3284
- const contents = {
2685
+ const contents = map({
3285
2686
  $metadata: deserializeMetadata(output),
3286
- CalculatorArn: undefined,
3287
- CalculatorName: undefined,
3288
- CreateTime: undefined,
3289
- DataSource: undefined,
3290
- Description: undefined,
3291
- PricingPlan: undefined,
3292
- Tags: undefined,
3293
- UpdateTime: undefined,
3294
- };
2687
+ });
3295
2688
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3296
- if (data.CalculatorArn !== undefined && data.CalculatorArn !== null) {
2689
+ if (data.CalculatorArn != null) {
3297
2690
  contents.CalculatorArn = (0, smithy_client_1.expectString)(data.CalculatorArn);
3298
2691
  }
3299
- if (data.CalculatorName !== undefined && data.CalculatorName !== null) {
2692
+ if (data.CalculatorName != null) {
3300
2693
  contents.CalculatorName = (0, smithy_client_1.expectString)(data.CalculatorName);
3301
2694
  }
3302
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2695
+ if (data.CreateTime != null) {
3303
2696
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3304
2697
  }
3305
- if (data.DataSource !== undefined && data.DataSource !== null) {
2698
+ if (data.DataSource != null) {
3306
2699
  contents.DataSource = (0, smithy_client_1.expectString)(data.DataSource);
3307
2700
  }
3308
- if (data.Description !== undefined && data.Description !== null) {
2701
+ if (data.Description != null) {
3309
2702
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3310
2703
  }
3311
- if (data.PricingPlan !== undefined && data.PricingPlan !== null) {
2704
+ if (data.PricingPlan != null) {
3312
2705
  contents.PricingPlan = (0, smithy_client_1.expectString)(data.PricingPlan);
3313
2706
  }
3314
- if (data.Tags !== undefined && data.Tags !== null) {
2707
+ if (data.Tags != null) {
3315
2708
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3316
2709
  }
3317
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2710
+ if (data.UpdateTime != null) {
3318
2711
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3319
2712
  }
3320
- return Promise.resolve(contents);
2713
+ return contents;
3321
2714
  };
3322
2715
  exports.deserializeAws_restJson1DescribeRouteCalculatorCommand = deserializeAws_restJson1DescribeRouteCalculatorCommand;
3323
2716
  const deserializeAws_restJson1DescribeRouteCalculatorCommandError = async (output, context) => {
@@ -3325,7 +2718,6 @@ const deserializeAws_restJson1DescribeRouteCalculatorCommandError = async (outpu
3325
2718
  ...output,
3326
2719
  body: await parseBody(output.body, context),
3327
2720
  };
3328
- let response;
3329
2721
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3330
2722
  switch (errorCode) {
3331
2723
  case "AccessDeniedException":
@@ -3345,65 +2737,53 @@ const deserializeAws_restJson1DescribeRouteCalculatorCommandError = async (outpu
3345
2737
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3346
2738
  default:
3347
2739
  const parsedBody = parsedOutput.body;
3348
- const $metadata = deserializeMetadata(output);
3349
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3350
- response = new LocationServiceException_1.LocationServiceException({
3351
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3352
- $fault: "client",
3353
- $metadata,
2740
+ (0, smithy_client_1.throwDefaultError)({
2741
+ output,
2742
+ parsedBody,
2743
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2744
+ errorCode,
3354
2745
  });
3355
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3356
2746
  }
3357
2747
  };
3358
2748
  const deserializeAws_restJson1DescribeTrackerCommand = async (output, context) => {
3359
2749
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3360
2750
  return deserializeAws_restJson1DescribeTrackerCommandError(output, context);
3361
2751
  }
3362
- const contents = {
2752
+ const contents = map({
3363
2753
  $metadata: deserializeMetadata(output),
3364
- CreateTime: undefined,
3365
- Description: undefined,
3366
- KmsKeyId: undefined,
3367
- PositionFiltering: undefined,
3368
- PricingPlan: undefined,
3369
- PricingPlanDataSource: undefined,
3370
- Tags: undefined,
3371
- TrackerArn: undefined,
3372
- TrackerName: undefined,
3373
- UpdateTime: undefined,
3374
- };
2754
+ });
3375
2755
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3376
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2756
+ if (data.CreateTime != null) {
3377
2757
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3378
2758
  }
3379
- if (data.Description !== undefined && data.Description !== null) {
2759
+ if (data.Description != null) {
3380
2760
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
3381
2761
  }
3382
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
2762
+ if (data.KmsKeyId != null) {
3383
2763
  contents.KmsKeyId = (0, smithy_client_1.expectString)(data.KmsKeyId);
3384
2764
  }
3385
- if (data.PositionFiltering !== undefined && data.PositionFiltering !== null) {
2765
+ if (data.PositionFiltering != null) {
3386
2766
  contents.PositionFiltering = (0, smithy_client_1.expectString)(data.PositionFiltering);
3387
2767
  }
3388
- if (data.PricingPlan !== undefined && data.PricingPlan !== null) {
2768
+ if (data.PricingPlan != null) {
3389
2769
  contents.PricingPlan = (0, smithy_client_1.expectString)(data.PricingPlan);
3390
2770
  }
3391
- if (data.PricingPlanDataSource !== undefined && data.PricingPlanDataSource !== null) {
2771
+ if (data.PricingPlanDataSource != null) {
3392
2772
  contents.PricingPlanDataSource = (0, smithy_client_1.expectString)(data.PricingPlanDataSource);
3393
2773
  }
3394
- if (data.Tags !== undefined && data.Tags !== null) {
2774
+ if (data.Tags != null) {
3395
2775
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
3396
2776
  }
3397
- if (data.TrackerArn !== undefined && data.TrackerArn !== null) {
2777
+ if (data.TrackerArn != null) {
3398
2778
  contents.TrackerArn = (0, smithy_client_1.expectString)(data.TrackerArn);
3399
2779
  }
3400
- if (data.TrackerName !== undefined && data.TrackerName !== null) {
2780
+ if (data.TrackerName != null) {
3401
2781
  contents.TrackerName = (0, smithy_client_1.expectString)(data.TrackerName);
3402
2782
  }
3403
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2783
+ if (data.UpdateTime != null) {
3404
2784
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3405
2785
  }
3406
- return Promise.resolve(contents);
2786
+ return contents;
3407
2787
  };
3408
2788
  exports.deserializeAws_restJson1DescribeTrackerCommand = deserializeAws_restJson1DescribeTrackerCommand;
3409
2789
  const deserializeAws_restJson1DescribeTrackerCommandError = async (output, context) => {
@@ -3411,7 +2791,6 @@ const deserializeAws_restJson1DescribeTrackerCommandError = async (output, conte
3411
2791
  ...output,
3412
2792
  body: await parseBody(output.body, context),
3413
2793
  };
3414
- let response;
3415
2794
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3416
2795
  switch (errorCode) {
3417
2796
  case "AccessDeniedException":
@@ -3431,25 +2810,23 @@ const deserializeAws_restJson1DescribeTrackerCommandError = async (output, conte
3431
2810
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3432
2811
  default:
3433
2812
  const parsedBody = parsedOutput.body;
3434
- const $metadata = deserializeMetadata(output);
3435
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3436
- response = new LocationServiceException_1.LocationServiceException({
3437
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3438
- $fault: "client",
3439
- $metadata,
2813
+ (0, smithy_client_1.throwDefaultError)({
2814
+ output,
2815
+ parsedBody,
2816
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2817
+ errorCode,
3440
2818
  });
3441
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3442
2819
  }
3443
2820
  };
3444
2821
  const deserializeAws_restJson1DisassociateTrackerConsumerCommand = async (output, context) => {
3445
2822
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3446
2823
  return deserializeAws_restJson1DisassociateTrackerConsumerCommandError(output, context);
3447
2824
  }
3448
- const contents = {
2825
+ const contents = map({
3449
2826
  $metadata: deserializeMetadata(output),
3450
- };
2827
+ });
3451
2828
  await collectBody(output.body, context);
3452
- return Promise.resolve(contents);
2829
+ return contents;
3453
2830
  };
3454
2831
  exports.deserializeAws_restJson1DisassociateTrackerConsumerCommand = deserializeAws_restJson1DisassociateTrackerConsumerCommand;
3455
2832
  const deserializeAws_restJson1DisassociateTrackerConsumerCommandError = async (output, context) => {
@@ -3457,7 +2834,6 @@ const deserializeAws_restJson1DisassociateTrackerConsumerCommandError = async (o
3457
2834
  ...output,
3458
2835
  body: await parseBody(output.body, context),
3459
2836
  };
3460
- let response;
3461
2837
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3462
2838
  switch (errorCode) {
3463
2839
  case "AccessDeniedException":
@@ -3477,49 +2853,41 @@ const deserializeAws_restJson1DisassociateTrackerConsumerCommandError = async (o
3477
2853
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3478
2854
  default:
3479
2855
  const parsedBody = parsedOutput.body;
3480
- const $metadata = deserializeMetadata(output);
3481
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3482
- response = new LocationServiceException_1.LocationServiceException({
3483
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3484
- $fault: "client",
3485
- $metadata,
2856
+ (0, smithy_client_1.throwDefaultError)({
2857
+ output,
2858
+ parsedBody,
2859
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2860
+ errorCode,
3486
2861
  });
3487
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3488
2862
  }
3489
2863
  };
3490
2864
  const deserializeAws_restJson1GetDevicePositionCommand = async (output, context) => {
3491
2865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3492
2866
  return deserializeAws_restJson1GetDevicePositionCommandError(output, context);
3493
2867
  }
3494
- const contents = {
2868
+ const contents = map({
3495
2869
  $metadata: deserializeMetadata(output),
3496
- Accuracy: undefined,
3497
- DeviceId: undefined,
3498
- Position: undefined,
3499
- PositionProperties: undefined,
3500
- ReceivedTime: undefined,
3501
- SampleTime: undefined,
3502
- };
2870
+ });
3503
2871
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3504
- if (data.Accuracy !== undefined && data.Accuracy !== null) {
2872
+ if (data.Accuracy != null) {
3505
2873
  contents.Accuracy = deserializeAws_restJson1PositionalAccuracy(data.Accuracy, context);
3506
2874
  }
3507
- if (data.DeviceId !== undefined && data.DeviceId !== null) {
2875
+ if (data.DeviceId != null) {
3508
2876
  contents.DeviceId = (0, smithy_client_1.expectString)(data.DeviceId);
3509
2877
  }
3510
- if (data.Position !== undefined && data.Position !== null) {
2878
+ if (data.Position != null) {
3511
2879
  contents.Position = deserializeAws_restJson1Position(data.Position, context);
3512
2880
  }
3513
- if (data.PositionProperties !== undefined && data.PositionProperties !== null) {
2881
+ if (data.PositionProperties != null) {
3514
2882
  contents.PositionProperties = deserializeAws_restJson1PropertyMap(data.PositionProperties, context);
3515
2883
  }
3516
- if (data.ReceivedTime !== undefined && data.ReceivedTime !== null) {
2884
+ if (data.ReceivedTime != null) {
3517
2885
  contents.ReceivedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.ReceivedTime));
3518
2886
  }
3519
- if (data.SampleTime !== undefined && data.SampleTime !== null) {
2887
+ if (data.SampleTime != null) {
3520
2888
  contents.SampleTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.SampleTime));
3521
2889
  }
3522
- return Promise.resolve(contents);
2890
+ return contents;
3523
2891
  };
3524
2892
  exports.deserializeAws_restJson1GetDevicePositionCommand = deserializeAws_restJson1GetDevicePositionCommand;
3525
2893
  const deserializeAws_restJson1GetDevicePositionCommandError = async (output, context) => {
@@ -3527,7 +2895,6 @@ const deserializeAws_restJson1GetDevicePositionCommandError = async (output, con
3527
2895
  ...output,
3528
2896
  body: await parseBody(output.body, context),
3529
2897
  };
3530
- let response;
3531
2898
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3532
2899
  switch (errorCode) {
3533
2900
  case "AccessDeniedException":
@@ -3547,33 +2914,29 @@ const deserializeAws_restJson1GetDevicePositionCommandError = async (output, con
3547
2914
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3548
2915
  default:
3549
2916
  const parsedBody = parsedOutput.body;
3550
- const $metadata = deserializeMetadata(output);
3551
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3552
- response = new LocationServiceException_1.LocationServiceException({
3553
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3554
- $fault: "client",
3555
- $metadata,
2917
+ (0, smithy_client_1.throwDefaultError)({
2918
+ output,
2919
+ parsedBody,
2920
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2921
+ errorCode,
3556
2922
  });
3557
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3558
2923
  }
3559
2924
  };
3560
2925
  const deserializeAws_restJson1GetDevicePositionHistoryCommand = async (output, context) => {
3561
2926
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3562
2927
  return deserializeAws_restJson1GetDevicePositionHistoryCommandError(output, context);
3563
2928
  }
3564
- const contents = {
2929
+ const contents = map({
3565
2930
  $metadata: deserializeMetadata(output),
3566
- DevicePositions: undefined,
3567
- NextToken: undefined,
3568
- };
2931
+ });
3569
2932
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3570
- if (data.DevicePositions !== undefined && data.DevicePositions !== null) {
2933
+ if (data.DevicePositions != null) {
3571
2934
  contents.DevicePositions = deserializeAws_restJson1DevicePositionList(data.DevicePositions, context);
3572
2935
  }
3573
- if (data.NextToken !== undefined && data.NextToken !== null) {
2936
+ if (data.NextToken != null) {
3574
2937
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3575
2938
  }
3576
- return Promise.resolve(contents);
2939
+ return contents;
3577
2940
  };
3578
2941
  exports.deserializeAws_restJson1GetDevicePositionHistoryCommand = deserializeAws_restJson1GetDevicePositionHistoryCommand;
3579
2942
  const deserializeAws_restJson1GetDevicePositionHistoryCommandError = async (output, context) => {
@@ -3581,7 +2944,6 @@ const deserializeAws_restJson1GetDevicePositionHistoryCommandError = async (outp
3581
2944
  ...output,
3582
2945
  body: await parseBody(output.body, context),
3583
2946
  };
3584
- let response;
3585
2947
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3586
2948
  switch (errorCode) {
3587
2949
  case "AccessDeniedException":
@@ -3601,45 +2963,38 @@ const deserializeAws_restJson1GetDevicePositionHistoryCommandError = async (outp
3601
2963
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3602
2964
  default:
3603
2965
  const parsedBody = parsedOutput.body;
3604
- const $metadata = deserializeMetadata(output);
3605
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3606
- response = new LocationServiceException_1.LocationServiceException({
3607
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3608
- $fault: "client",
3609
- $metadata,
2966
+ (0, smithy_client_1.throwDefaultError)({
2967
+ output,
2968
+ parsedBody,
2969
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
2970
+ errorCode,
3610
2971
  });
3611
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3612
2972
  }
3613
2973
  };
3614
2974
  const deserializeAws_restJson1GetGeofenceCommand = async (output, context) => {
3615
2975
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3616
2976
  return deserializeAws_restJson1GetGeofenceCommandError(output, context);
3617
2977
  }
3618
- const contents = {
2978
+ const contents = map({
3619
2979
  $metadata: deserializeMetadata(output),
3620
- CreateTime: undefined,
3621
- GeofenceId: undefined,
3622
- Geometry: undefined,
3623
- Status: undefined,
3624
- UpdateTime: undefined,
3625
- };
2980
+ });
3626
2981
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3627
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
2982
+ if (data.CreateTime != null) {
3628
2983
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
3629
2984
  }
3630
- if (data.GeofenceId !== undefined && data.GeofenceId !== null) {
2985
+ if (data.GeofenceId != null) {
3631
2986
  contents.GeofenceId = (0, smithy_client_1.expectString)(data.GeofenceId);
3632
2987
  }
3633
- if (data.Geometry !== undefined && data.Geometry !== null) {
2988
+ if (data.Geometry != null) {
3634
2989
  contents.Geometry = deserializeAws_restJson1GeofenceGeometry(data.Geometry, context);
3635
2990
  }
3636
- if (data.Status !== undefined && data.Status !== null) {
2991
+ if (data.Status != null) {
3637
2992
  contents.Status = (0, smithy_client_1.expectString)(data.Status);
3638
2993
  }
3639
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
2994
+ if (data.UpdateTime != null) {
3640
2995
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
3641
2996
  }
3642
- return Promise.resolve(contents);
2997
+ return contents;
3643
2998
  };
3644
2999
  exports.deserializeAws_restJson1GetGeofenceCommand = deserializeAws_restJson1GetGeofenceCommand;
3645
3000
  const deserializeAws_restJson1GetGeofenceCommandError = async (output, context) => {
@@ -3647,7 +3002,6 @@ const deserializeAws_restJson1GetGeofenceCommandError = async (output, context)
3647
3002
  ...output,
3648
3003
  body: await parseBody(output.body, context),
3649
3004
  };
3650
- let response;
3651
3005
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3652
3006
  switch (errorCode) {
3653
3007
  case "AccessDeniedException":
@@ -3667,31 +3021,25 @@ const deserializeAws_restJson1GetGeofenceCommandError = async (output, context)
3667
3021
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3668
3022
  default:
3669
3023
  const parsedBody = parsedOutput.body;
3670
- const $metadata = deserializeMetadata(output);
3671
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3672
- response = new LocationServiceException_1.LocationServiceException({
3673
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3674
- $fault: "client",
3675
- $metadata,
3024
+ (0, smithy_client_1.throwDefaultError)({
3025
+ output,
3026
+ parsedBody,
3027
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3028
+ errorCode,
3676
3029
  });
3677
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3678
3030
  }
3679
3031
  };
3680
3032
  const deserializeAws_restJson1GetMapGlyphsCommand = async (output, context) => {
3681
3033
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3682
3034
  return deserializeAws_restJson1GetMapGlyphsCommandError(output, context);
3683
3035
  }
3684
- const contents = {
3036
+ const contents = map({
3685
3037
  $metadata: deserializeMetadata(output),
3686
- Blob: undefined,
3687
- ContentType: undefined,
3688
- };
3689
- if (output.headers["content-type"] !== undefined) {
3690
- contents.ContentType = output.headers["content-type"];
3691
- }
3038
+ ContentType: [, output.headers["content-type"]],
3039
+ });
3692
3040
  const data = await collectBody(output.body, context);
3693
3041
  contents.Blob = data;
3694
- return Promise.resolve(contents);
3042
+ return contents;
3695
3043
  };
3696
3044
  exports.deserializeAws_restJson1GetMapGlyphsCommand = deserializeAws_restJson1GetMapGlyphsCommand;
3697
3045
  const deserializeAws_restJson1GetMapGlyphsCommandError = async (output, context) => {
@@ -3699,7 +3047,6 @@ const deserializeAws_restJson1GetMapGlyphsCommandError = async (output, context)
3699
3047
  ...output,
3700
3048
  body: await parseBody(output.body, context),
3701
3049
  };
3702
- let response;
3703
3050
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3704
3051
  switch (errorCode) {
3705
3052
  case "AccessDeniedException":
@@ -3719,31 +3066,25 @@ const deserializeAws_restJson1GetMapGlyphsCommandError = async (output, context)
3719
3066
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3720
3067
  default:
3721
3068
  const parsedBody = parsedOutput.body;
3722
- const $metadata = deserializeMetadata(output);
3723
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3724
- response = new LocationServiceException_1.LocationServiceException({
3725
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3726
- $fault: "client",
3727
- $metadata,
3069
+ (0, smithy_client_1.throwDefaultError)({
3070
+ output,
3071
+ parsedBody,
3072
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3073
+ errorCode,
3728
3074
  });
3729
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3730
3075
  }
3731
3076
  };
3732
3077
  const deserializeAws_restJson1GetMapSpritesCommand = async (output, context) => {
3733
3078
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3734
3079
  return deserializeAws_restJson1GetMapSpritesCommandError(output, context);
3735
3080
  }
3736
- const contents = {
3081
+ const contents = map({
3737
3082
  $metadata: deserializeMetadata(output),
3738
- Blob: undefined,
3739
- ContentType: undefined,
3740
- };
3741
- if (output.headers["content-type"] !== undefined) {
3742
- contents.ContentType = output.headers["content-type"];
3743
- }
3083
+ ContentType: [, output.headers["content-type"]],
3084
+ });
3744
3085
  const data = await collectBody(output.body, context);
3745
3086
  contents.Blob = data;
3746
- return Promise.resolve(contents);
3087
+ return contents;
3747
3088
  };
3748
3089
  exports.deserializeAws_restJson1GetMapSpritesCommand = deserializeAws_restJson1GetMapSpritesCommand;
3749
3090
  const deserializeAws_restJson1GetMapSpritesCommandError = async (output, context) => {
@@ -3751,7 +3092,6 @@ const deserializeAws_restJson1GetMapSpritesCommandError = async (output, context
3751
3092
  ...output,
3752
3093
  body: await parseBody(output.body, context),
3753
3094
  };
3754
- let response;
3755
3095
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3756
3096
  switch (errorCode) {
3757
3097
  case "AccessDeniedException":
@@ -3771,31 +3111,25 @@ const deserializeAws_restJson1GetMapSpritesCommandError = async (output, context
3771
3111
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3772
3112
  default:
3773
3113
  const parsedBody = parsedOutput.body;
3774
- const $metadata = deserializeMetadata(output);
3775
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3776
- response = new LocationServiceException_1.LocationServiceException({
3777
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3778
- $fault: "client",
3779
- $metadata,
3114
+ (0, smithy_client_1.throwDefaultError)({
3115
+ output,
3116
+ parsedBody,
3117
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3118
+ errorCode,
3780
3119
  });
3781
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3782
3120
  }
3783
3121
  };
3784
3122
  const deserializeAws_restJson1GetMapStyleDescriptorCommand = async (output, context) => {
3785
3123
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3786
3124
  return deserializeAws_restJson1GetMapStyleDescriptorCommandError(output, context);
3787
3125
  }
3788
- const contents = {
3126
+ const contents = map({
3789
3127
  $metadata: deserializeMetadata(output),
3790
- Blob: undefined,
3791
- ContentType: undefined,
3792
- };
3793
- if (output.headers["content-type"] !== undefined) {
3794
- contents.ContentType = output.headers["content-type"];
3795
- }
3128
+ ContentType: [, output.headers["content-type"]],
3129
+ });
3796
3130
  const data = await collectBody(output.body, context);
3797
3131
  contents.Blob = data;
3798
- return Promise.resolve(contents);
3132
+ return contents;
3799
3133
  };
3800
3134
  exports.deserializeAws_restJson1GetMapStyleDescriptorCommand = deserializeAws_restJson1GetMapStyleDescriptorCommand;
3801
3135
  const deserializeAws_restJson1GetMapStyleDescriptorCommandError = async (output, context) => {
@@ -3803,7 +3137,6 @@ const deserializeAws_restJson1GetMapStyleDescriptorCommandError = async (output,
3803
3137
  ...output,
3804
3138
  body: await parseBody(output.body, context),
3805
3139
  };
3806
- let response;
3807
3140
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3808
3141
  switch (errorCode) {
3809
3142
  case "AccessDeniedException":
@@ -3823,31 +3156,25 @@ const deserializeAws_restJson1GetMapStyleDescriptorCommandError = async (output,
3823
3156
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3824
3157
  default:
3825
3158
  const parsedBody = parsedOutput.body;
3826
- const $metadata = deserializeMetadata(output);
3827
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3828
- response = new LocationServiceException_1.LocationServiceException({
3829
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3830
- $fault: "client",
3831
- $metadata,
3159
+ (0, smithy_client_1.throwDefaultError)({
3160
+ output,
3161
+ parsedBody,
3162
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3163
+ errorCode,
3832
3164
  });
3833
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3834
3165
  }
3835
3166
  };
3836
3167
  const deserializeAws_restJson1GetMapTileCommand = async (output, context) => {
3837
3168
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3838
3169
  return deserializeAws_restJson1GetMapTileCommandError(output, context);
3839
3170
  }
3840
- const contents = {
3171
+ const contents = map({
3841
3172
  $metadata: deserializeMetadata(output),
3842
- Blob: undefined,
3843
- ContentType: undefined,
3844
- };
3845
- if (output.headers["content-type"] !== undefined) {
3846
- contents.ContentType = output.headers["content-type"];
3847
- }
3173
+ ContentType: [, output.headers["content-type"]],
3174
+ });
3848
3175
  const data = await collectBody(output.body, context);
3849
3176
  contents.Blob = data;
3850
- return Promise.resolve(contents);
3177
+ return contents;
3851
3178
  };
3852
3179
  exports.deserializeAws_restJson1GetMapTileCommand = deserializeAws_restJson1GetMapTileCommand;
3853
3180
  const deserializeAws_restJson1GetMapTileCommandError = async (output, context) => {
@@ -3855,7 +3182,6 @@ const deserializeAws_restJson1GetMapTileCommandError = async (output, context) =
3855
3182
  ...output,
3856
3183
  body: await parseBody(output.body, context),
3857
3184
  };
3858
- let response;
3859
3185
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3860
3186
  switch (errorCode) {
3861
3187
  case "AccessDeniedException":
@@ -3875,33 +3201,29 @@ const deserializeAws_restJson1GetMapTileCommandError = async (output, context) =
3875
3201
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3876
3202
  default:
3877
3203
  const parsedBody = parsedOutput.body;
3878
- const $metadata = deserializeMetadata(output);
3879
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3880
- response = new LocationServiceException_1.LocationServiceException({
3881
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3882
- $fault: "client",
3883
- $metadata,
3204
+ (0, smithy_client_1.throwDefaultError)({
3205
+ output,
3206
+ parsedBody,
3207
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3208
+ errorCode,
3884
3209
  });
3885
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3886
3210
  }
3887
3211
  };
3888
3212
  const deserializeAws_restJson1ListDevicePositionsCommand = async (output, context) => {
3889
3213
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3890
3214
  return deserializeAws_restJson1ListDevicePositionsCommandError(output, context);
3891
3215
  }
3892
- const contents = {
3216
+ const contents = map({
3893
3217
  $metadata: deserializeMetadata(output),
3894
- Entries: undefined,
3895
- NextToken: undefined,
3896
- };
3218
+ });
3897
3219
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3898
- if (data.Entries !== undefined && data.Entries !== null) {
3220
+ if (data.Entries != null) {
3899
3221
  contents.Entries = deserializeAws_restJson1ListDevicePositionsResponseEntryList(data.Entries, context);
3900
3222
  }
3901
- if (data.NextToken !== undefined && data.NextToken !== null) {
3223
+ if (data.NextToken != null) {
3902
3224
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3903
3225
  }
3904
- return Promise.resolve(contents);
3226
+ return contents;
3905
3227
  };
3906
3228
  exports.deserializeAws_restJson1ListDevicePositionsCommand = deserializeAws_restJson1ListDevicePositionsCommand;
3907
3229
  const deserializeAws_restJson1ListDevicePositionsCommandError = async (output, context) => {
@@ -3909,7 +3231,6 @@ const deserializeAws_restJson1ListDevicePositionsCommandError = async (output, c
3909
3231
  ...output,
3910
3232
  body: await parseBody(output.body, context),
3911
3233
  };
3912
- let response;
3913
3234
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3914
3235
  switch (errorCode) {
3915
3236
  case "AccessDeniedException":
@@ -3926,33 +3247,29 @@ const deserializeAws_restJson1ListDevicePositionsCommandError = async (output, c
3926
3247
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3927
3248
  default:
3928
3249
  const parsedBody = parsedOutput.body;
3929
- const $metadata = deserializeMetadata(output);
3930
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3931
- response = new LocationServiceException_1.LocationServiceException({
3932
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3933
- $fault: "client",
3934
- $metadata,
3250
+ (0, smithy_client_1.throwDefaultError)({
3251
+ output,
3252
+ parsedBody,
3253
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3254
+ errorCode,
3935
3255
  });
3936
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3937
3256
  }
3938
3257
  };
3939
3258
  const deserializeAws_restJson1ListGeofenceCollectionsCommand = async (output, context) => {
3940
3259
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3941
3260
  return deserializeAws_restJson1ListGeofenceCollectionsCommandError(output, context);
3942
3261
  }
3943
- const contents = {
3262
+ const contents = map({
3944
3263
  $metadata: deserializeMetadata(output),
3945
- Entries: undefined,
3946
- NextToken: undefined,
3947
- };
3264
+ });
3948
3265
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
3949
- if (data.Entries !== undefined && data.Entries !== null) {
3266
+ if (data.Entries != null) {
3950
3267
  contents.Entries = deserializeAws_restJson1ListGeofenceCollectionsResponseEntryList(data.Entries, context);
3951
3268
  }
3952
- if (data.NextToken !== undefined && data.NextToken !== null) {
3269
+ if (data.NextToken != null) {
3953
3270
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
3954
3271
  }
3955
- return Promise.resolve(contents);
3272
+ return contents;
3956
3273
  };
3957
3274
  exports.deserializeAws_restJson1ListGeofenceCollectionsCommand = deserializeAws_restJson1ListGeofenceCollectionsCommand;
3958
3275
  const deserializeAws_restJson1ListGeofenceCollectionsCommandError = async (output, context) => {
@@ -3960,7 +3277,6 @@ const deserializeAws_restJson1ListGeofenceCollectionsCommandError = async (outpu
3960
3277
  ...output,
3961
3278
  body: await parseBody(output.body, context),
3962
3279
  };
3963
- let response;
3964
3280
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3965
3281
  switch (errorCode) {
3966
3282
  case "AccessDeniedException":
@@ -3977,33 +3293,29 @@ const deserializeAws_restJson1ListGeofenceCollectionsCommandError = async (outpu
3977
3293
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3978
3294
  default:
3979
3295
  const parsedBody = parsedOutput.body;
3980
- const $metadata = deserializeMetadata(output);
3981
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3982
- response = new LocationServiceException_1.LocationServiceException({
3983
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3984
- $fault: "client",
3985
- $metadata,
3296
+ (0, smithy_client_1.throwDefaultError)({
3297
+ output,
3298
+ parsedBody,
3299
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3300
+ errorCode,
3986
3301
  });
3987
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3988
3302
  }
3989
3303
  };
3990
3304
  const deserializeAws_restJson1ListGeofencesCommand = async (output, context) => {
3991
3305
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3992
3306
  return deserializeAws_restJson1ListGeofencesCommandError(output, context);
3993
3307
  }
3994
- const contents = {
3308
+ const contents = map({
3995
3309
  $metadata: deserializeMetadata(output),
3996
- Entries: undefined,
3997
- NextToken: undefined,
3998
- };
3310
+ });
3999
3311
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4000
- if (data.Entries !== undefined && data.Entries !== null) {
3312
+ if (data.Entries != null) {
4001
3313
  contents.Entries = deserializeAws_restJson1ListGeofenceResponseEntryList(data.Entries, context);
4002
3314
  }
4003
- if (data.NextToken !== undefined && data.NextToken !== null) {
3315
+ if (data.NextToken != null) {
4004
3316
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4005
3317
  }
4006
- return Promise.resolve(contents);
3318
+ return contents;
4007
3319
  };
4008
3320
  exports.deserializeAws_restJson1ListGeofencesCommand = deserializeAws_restJson1ListGeofencesCommand;
4009
3321
  const deserializeAws_restJson1ListGeofencesCommandError = async (output, context) => {
@@ -4011,7 +3323,6 @@ const deserializeAws_restJson1ListGeofencesCommandError = async (output, context
4011
3323
  ...output,
4012
3324
  body: await parseBody(output.body, context),
4013
3325
  };
4014
- let response;
4015
3326
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4016
3327
  switch (errorCode) {
4017
3328
  case "AccessDeniedException":
@@ -4031,33 +3342,29 @@ const deserializeAws_restJson1ListGeofencesCommandError = async (output, context
4031
3342
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4032
3343
  default:
4033
3344
  const parsedBody = parsedOutput.body;
4034
- const $metadata = deserializeMetadata(output);
4035
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4036
- response = new LocationServiceException_1.LocationServiceException({
4037
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4038
- $fault: "client",
4039
- $metadata,
3345
+ (0, smithy_client_1.throwDefaultError)({
3346
+ output,
3347
+ parsedBody,
3348
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3349
+ errorCode,
4040
3350
  });
4041
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4042
3351
  }
4043
3352
  };
4044
3353
  const deserializeAws_restJson1ListMapsCommand = async (output, context) => {
4045
3354
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4046
3355
  return deserializeAws_restJson1ListMapsCommandError(output, context);
4047
3356
  }
4048
- const contents = {
3357
+ const contents = map({
4049
3358
  $metadata: deserializeMetadata(output),
4050
- Entries: undefined,
4051
- NextToken: undefined,
4052
- };
3359
+ });
4053
3360
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4054
- if (data.Entries !== undefined && data.Entries !== null) {
3361
+ if (data.Entries != null) {
4055
3362
  contents.Entries = deserializeAws_restJson1ListMapsResponseEntryList(data.Entries, context);
4056
3363
  }
4057
- if (data.NextToken !== undefined && data.NextToken !== null) {
3364
+ if (data.NextToken != null) {
4058
3365
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4059
3366
  }
4060
- return Promise.resolve(contents);
3367
+ return contents;
4061
3368
  };
4062
3369
  exports.deserializeAws_restJson1ListMapsCommand = deserializeAws_restJson1ListMapsCommand;
4063
3370
  const deserializeAws_restJson1ListMapsCommandError = async (output, context) => {
@@ -4065,7 +3372,6 @@ const deserializeAws_restJson1ListMapsCommandError = async (output, context) =>
4065
3372
  ...output,
4066
3373
  body: await parseBody(output.body, context),
4067
3374
  };
4068
- let response;
4069
3375
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4070
3376
  switch (errorCode) {
4071
3377
  case "AccessDeniedException":
@@ -4082,33 +3388,29 @@ const deserializeAws_restJson1ListMapsCommandError = async (output, context) =>
4082
3388
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4083
3389
  default:
4084
3390
  const parsedBody = parsedOutput.body;
4085
- const $metadata = deserializeMetadata(output);
4086
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4087
- response = new LocationServiceException_1.LocationServiceException({
4088
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4089
- $fault: "client",
4090
- $metadata,
3391
+ (0, smithy_client_1.throwDefaultError)({
3392
+ output,
3393
+ parsedBody,
3394
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3395
+ errorCode,
4091
3396
  });
4092
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4093
3397
  }
4094
3398
  };
4095
3399
  const deserializeAws_restJson1ListPlaceIndexesCommand = async (output, context) => {
4096
3400
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4097
3401
  return deserializeAws_restJson1ListPlaceIndexesCommandError(output, context);
4098
3402
  }
4099
- const contents = {
3403
+ const contents = map({
4100
3404
  $metadata: deserializeMetadata(output),
4101
- Entries: undefined,
4102
- NextToken: undefined,
4103
- };
3405
+ });
4104
3406
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4105
- if (data.Entries !== undefined && data.Entries !== null) {
3407
+ if (data.Entries != null) {
4106
3408
  contents.Entries = deserializeAws_restJson1ListPlaceIndexesResponseEntryList(data.Entries, context);
4107
3409
  }
4108
- if (data.NextToken !== undefined && data.NextToken !== null) {
3410
+ if (data.NextToken != null) {
4109
3411
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4110
3412
  }
4111
- return Promise.resolve(contents);
3413
+ return contents;
4112
3414
  };
4113
3415
  exports.deserializeAws_restJson1ListPlaceIndexesCommand = deserializeAws_restJson1ListPlaceIndexesCommand;
4114
3416
  const deserializeAws_restJson1ListPlaceIndexesCommandError = async (output, context) => {
@@ -4116,7 +3418,6 @@ const deserializeAws_restJson1ListPlaceIndexesCommandError = async (output, cont
4116
3418
  ...output,
4117
3419
  body: await parseBody(output.body, context),
4118
3420
  };
4119
- let response;
4120
3421
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4121
3422
  switch (errorCode) {
4122
3423
  case "AccessDeniedException":
@@ -4133,33 +3434,29 @@ const deserializeAws_restJson1ListPlaceIndexesCommandError = async (output, cont
4133
3434
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4134
3435
  default:
4135
3436
  const parsedBody = parsedOutput.body;
4136
- const $metadata = deserializeMetadata(output);
4137
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4138
- response = new LocationServiceException_1.LocationServiceException({
4139
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4140
- $fault: "client",
4141
- $metadata,
3437
+ (0, smithy_client_1.throwDefaultError)({
3438
+ output,
3439
+ parsedBody,
3440
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3441
+ errorCode,
4142
3442
  });
4143
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4144
3443
  }
4145
3444
  };
4146
3445
  const deserializeAws_restJson1ListRouteCalculatorsCommand = async (output, context) => {
4147
3446
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4148
3447
  return deserializeAws_restJson1ListRouteCalculatorsCommandError(output, context);
4149
3448
  }
4150
- const contents = {
3449
+ const contents = map({
4151
3450
  $metadata: deserializeMetadata(output),
4152
- Entries: undefined,
4153
- NextToken: undefined,
4154
- };
3451
+ });
4155
3452
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4156
- if (data.Entries !== undefined && data.Entries !== null) {
3453
+ if (data.Entries != null) {
4157
3454
  contents.Entries = deserializeAws_restJson1ListRouteCalculatorsResponseEntryList(data.Entries, context);
4158
3455
  }
4159
- if (data.NextToken !== undefined && data.NextToken !== null) {
3456
+ if (data.NextToken != null) {
4160
3457
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4161
3458
  }
4162
- return Promise.resolve(contents);
3459
+ return contents;
4163
3460
  };
4164
3461
  exports.deserializeAws_restJson1ListRouteCalculatorsCommand = deserializeAws_restJson1ListRouteCalculatorsCommand;
4165
3462
  const deserializeAws_restJson1ListRouteCalculatorsCommandError = async (output, context) => {
@@ -4167,7 +3464,6 @@ const deserializeAws_restJson1ListRouteCalculatorsCommandError = async (output,
4167
3464
  ...output,
4168
3465
  body: await parseBody(output.body, context),
4169
3466
  };
4170
- let response;
4171
3467
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4172
3468
  switch (errorCode) {
4173
3469
  case "AccessDeniedException":
@@ -4184,29 +3480,26 @@ const deserializeAws_restJson1ListRouteCalculatorsCommandError = async (output,
4184
3480
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4185
3481
  default:
4186
3482
  const parsedBody = parsedOutput.body;
4187
- const $metadata = deserializeMetadata(output);
4188
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4189
- response = new LocationServiceException_1.LocationServiceException({
4190
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4191
- $fault: "client",
4192
- $metadata,
3483
+ (0, smithy_client_1.throwDefaultError)({
3484
+ output,
3485
+ parsedBody,
3486
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3487
+ errorCode,
4193
3488
  });
4194
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4195
3489
  }
4196
3490
  };
4197
3491
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
4198
3492
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4199
3493
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
4200
3494
  }
4201
- const contents = {
3495
+ const contents = map({
4202
3496
  $metadata: deserializeMetadata(output),
4203
- Tags: undefined,
4204
- };
3497
+ });
4205
3498
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4206
- if (data.Tags !== undefined && data.Tags !== null) {
3499
+ if (data.Tags != null) {
4207
3500
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
4208
3501
  }
4209
- return Promise.resolve(contents);
3502
+ return contents;
4210
3503
  };
4211
3504
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
4212
3505
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -4214,7 +3507,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
4214
3507
  ...output,
4215
3508
  body: await parseBody(output.body, context),
4216
3509
  };
4217
- let response;
4218
3510
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4219
3511
  switch (errorCode) {
4220
3512
  case "AccessDeniedException":
@@ -4234,33 +3526,29 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
4234
3526
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4235
3527
  default:
4236
3528
  const parsedBody = parsedOutput.body;
4237
- const $metadata = deserializeMetadata(output);
4238
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4239
- response = new LocationServiceException_1.LocationServiceException({
4240
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4241
- $fault: "client",
4242
- $metadata,
3529
+ (0, smithy_client_1.throwDefaultError)({
3530
+ output,
3531
+ parsedBody,
3532
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3533
+ errorCode,
4243
3534
  });
4244
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4245
3535
  }
4246
3536
  };
4247
3537
  const deserializeAws_restJson1ListTrackerConsumersCommand = async (output, context) => {
4248
3538
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4249
3539
  return deserializeAws_restJson1ListTrackerConsumersCommandError(output, context);
4250
3540
  }
4251
- const contents = {
3541
+ const contents = map({
4252
3542
  $metadata: deserializeMetadata(output),
4253
- ConsumerArns: undefined,
4254
- NextToken: undefined,
4255
- };
3543
+ });
4256
3544
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4257
- if (data.ConsumerArns !== undefined && data.ConsumerArns !== null) {
3545
+ if (data.ConsumerArns != null) {
4258
3546
  contents.ConsumerArns = deserializeAws_restJson1ArnList(data.ConsumerArns, context);
4259
3547
  }
4260
- if (data.NextToken !== undefined && data.NextToken !== null) {
3548
+ if (data.NextToken != null) {
4261
3549
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4262
3550
  }
4263
- return Promise.resolve(contents);
3551
+ return contents;
4264
3552
  };
4265
3553
  exports.deserializeAws_restJson1ListTrackerConsumersCommand = deserializeAws_restJson1ListTrackerConsumersCommand;
4266
3554
  const deserializeAws_restJson1ListTrackerConsumersCommandError = async (output, context) => {
@@ -4268,7 +3556,6 @@ const deserializeAws_restJson1ListTrackerConsumersCommandError = async (output,
4268
3556
  ...output,
4269
3557
  body: await parseBody(output.body, context),
4270
3558
  };
4271
- let response;
4272
3559
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4273
3560
  switch (errorCode) {
4274
3561
  case "AccessDeniedException":
@@ -4288,33 +3575,29 @@ const deserializeAws_restJson1ListTrackerConsumersCommandError = async (output,
4288
3575
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4289
3576
  default:
4290
3577
  const parsedBody = parsedOutput.body;
4291
- const $metadata = deserializeMetadata(output);
4292
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4293
- response = new LocationServiceException_1.LocationServiceException({
4294
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4295
- $fault: "client",
4296
- $metadata,
3578
+ (0, smithy_client_1.throwDefaultError)({
3579
+ output,
3580
+ parsedBody,
3581
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3582
+ errorCode,
4297
3583
  });
4298
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4299
3584
  }
4300
3585
  };
4301
3586
  const deserializeAws_restJson1ListTrackersCommand = async (output, context) => {
4302
3587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4303
3588
  return deserializeAws_restJson1ListTrackersCommandError(output, context);
4304
3589
  }
4305
- const contents = {
3590
+ const contents = map({
4306
3591
  $metadata: deserializeMetadata(output),
4307
- Entries: undefined,
4308
- NextToken: undefined,
4309
- };
3592
+ });
4310
3593
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4311
- if (data.Entries !== undefined && data.Entries !== null) {
3594
+ if (data.Entries != null) {
4312
3595
  contents.Entries = deserializeAws_restJson1ListTrackersResponseEntryList(data.Entries, context);
4313
3596
  }
4314
- if (data.NextToken !== undefined && data.NextToken !== null) {
3597
+ if (data.NextToken != null) {
4315
3598
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
4316
3599
  }
4317
- return Promise.resolve(contents);
3600
+ return contents;
4318
3601
  };
4319
3602
  exports.deserializeAws_restJson1ListTrackersCommand = deserializeAws_restJson1ListTrackersCommand;
4320
3603
  const deserializeAws_restJson1ListTrackersCommandError = async (output, context) => {
@@ -4322,7 +3605,6 @@ const deserializeAws_restJson1ListTrackersCommandError = async (output, context)
4322
3605
  ...output,
4323
3606
  body: await parseBody(output.body, context),
4324
3607
  };
4325
- let response;
4326
3608
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4327
3609
  switch (errorCode) {
4328
3610
  case "AccessDeniedException":
@@ -4339,37 +3621,32 @@ const deserializeAws_restJson1ListTrackersCommandError = async (output, context)
4339
3621
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4340
3622
  default:
4341
3623
  const parsedBody = parsedOutput.body;
4342
- const $metadata = deserializeMetadata(output);
4343
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4344
- response = new LocationServiceException_1.LocationServiceException({
4345
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4346
- $fault: "client",
4347
- $metadata,
3624
+ (0, smithy_client_1.throwDefaultError)({
3625
+ output,
3626
+ parsedBody,
3627
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3628
+ errorCode,
4348
3629
  });
4349
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4350
3630
  }
4351
3631
  };
4352
3632
  const deserializeAws_restJson1PutGeofenceCommand = async (output, context) => {
4353
3633
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4354
3634
  return deserializeAws_restJson1PutGeofenceCommandError(output, context);
4355
3635
  }
4356
- const contents = {
3636
+ const contents = map({
4357
3637
  $metadata: deserializeMetadata(output),
4358
- CreateTime: undefined,
4359
- GeofenceId: undefined,
4360
- UpdateTime: undefined,
4361
- };
3638
+ });
4362
3639
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4363
- if (data.CreateTime !== undefined && data.CreateTime !== null) {
3640
+ if (data.CreateTime != null) {
4364
3641
  contents.CreateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.CreateTime));
4365
3642
  }
4366
- if (data.GeofenceId !== undefined && data.GeofenceId !== null) {
3643
+ if (data.GeofenceId != null) {
4367
3644
  contents.GeofenceId = (0, smithy_client_1.expectString)(data.GeofenceId);
4368
3645
  }
4369
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
3646
+ if (data.UpdateTime != null) {
4370
3647
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4371
3648
  }
4372
- return Promise.resolve(contents);
3649
+ return contents;
4373
3650
  };
4374
3651
  exports.deserializeAws_restJson1PutGeofenceCommand = deserializeAws_restJson1PutGeofenceCommand;
4375
3652
  const deserializeAws_restJson1PutGeofenceCommandError = async (output, context) => {
@@ -4377,7 +3654,6 @@ const deserializeAws_restJson1PutGeofenceCommandError = async (output, context)
4377
3654
  ...output,
4378
3655
  body: await parseBody(output.body, context),
4379
3656
  };
4380
- let response;
4381
3657
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4382
3658
  switch (errorCode) {
4383
3659
  case "AccessDeniedException":
@@ -4400,33 +3676,29 @@ const deserializeAws_restJson1PutGeofenceCommandError = async (output, context)
4400
3676
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4401
3677
  default:
4402
3678
  const parsedBody = parsedOutput.body;
4403
- const $metadata = deserializeMetadata(output);
4404
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4405
- response = new LocationServiceException_1.LocationServiceException({
4406
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4407
- $fault: "client",
4408
- $metadata,
3679
+ (0, smithy_client_1.throwDefaultError)({
3680
+ output,
3681
+ parsedBody,
3682
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3683
+ errorCode,
4409
3684
  });
4410
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4411
3685
  }
4412
3686
  };
4413
3687
  const deserializeAws_restJson1SearchPlaceIndexForPositionCommand = async (output, context) => {
4414
3688
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4415
3689
  return deserializeAws_restJson1SearchPlaceIndexForPositionCommandError(output, context);
4416
3690
  }
4417
- const contents = {
3691
+ const contents = map({
4418
3692
  $metadata: deserializeMetadata(output),
4419
- Results: undefined,
4420
- Summary: undefined,
4421
- };
3693
+ });
4422
3694
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4423
- if (data.Results !== undefined && data.Results !== null) {
3695
+ if (data.Results != null) {
4424
3696
  contents.Results = deserializeAws_restJson1SearchForPositionResultList(data.Results, context);
4425
3697
  }
4426
- if (data.Summary !== undefined && data.Summary !== null) {
3698
+ if (data.Summary != null) {
4427
3699
  contents.Summary = deserializeAws_restJson1SearchPlaceIndexForPositionSummary(data.Summary, context);
4428
3700
  }
4429
- return Promise.resolve(contents);
3701
+ return contents;
4430
3702
  };
4431
3703
  exports.deserializeAws_restJson1SearchPlaceIndexForPositionCommand = deserializeAws_restJson1SearchPlaceIndexForPositionCommand;
4432
3704
  const deserializeAws_restJson1SearchPlaceIndexForPositionCommandError = async (output, context) => {
@@ -4434,7 +3706,6 @@ const deserializeAws_restJson1SearchPlaceIndexForPositionCommandError = async (o
4434
3706
  ...output,
4435
3707
  body: await parseBody(output.body, context),
4436
3708
  };
4437
- let response;
4438
3709
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4439
3710
  switch (errorCode) {
4440
3711
  case "AccessDeniedException":
@@ -4454,33 +3725,29 @@ const deserializeAws_restJson1SearchPlaceIndexForPositionCommandError = async (o
4454
3725
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4455
3726
  default:
4456
3727
  const parsedBody = parsedOutput.body;
4457
- const $metadata = deserializeMetadata(output);
4458
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4459
- response = new LocationServiceException_1.LocationServiceException({
4460
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4461
- $fault: "client",
4462
- $metadata,
3728
+ (0, smithy_client_1.throwDefaultError)({
3729
+ output,
3730
+ parsedBody,
3731
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3732
+ errorCode,
4463
3733
  });
4464
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4465
3734
  }
4466
3735
  };
4467
3736
  const deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommand = async (output, context) => {
4468
3737
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4469
3738
  return deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError(output, context);
4470
3739
  }
4471
- const contents = {
3740
+ const contents = map({
4472
3741
  $metadata: deserializeMetadata(output),
4473
- Results: undefined,
4474
- Summary: undefined,
4475
- };
3742
+ });
4476
3743
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4477
- if (data.Results !== undefined && data.Results !== null) {
3744
+ if (data.Results != null) {
4478
3745
  contents.Results = deserializeAws_restJson1SearchForSuggestionsResultList(data.Results, context);
4479
3746
  }
4480
- if (data.Summary !== undefined && data.Summary !== null) {
3747
+ if (data.Summary != null) {
4481
3748
  contents.Summary = deserializeAws_restJson1SearchPlaceIndexForSuggestionsSummary(data.Summary, context);
4482
3749
  }
4483
- return Promise.resolve(contents);
3750
+ return contents;
4484
3751
  };
4485
3752
  exports.deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommand = deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommand;
4486
3753
  const deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError = async (output, context) => {
@@ -4488,7 +3755,6 @@ const deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError = async
4488
3755
  ...output,
4489
3756
  body: await parseBody(output.body, context),
4490
3757
  };
4491
- let response;
4492
3758
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4493
3759
  switch (errorCode) {
4494
3760
  case "AccessDeniedException":
@@ -4508,33 +3774,29 @@ const deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError = async
4508
3774
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4509
3775
  default:
4510
3776
  const parsedBody = parsedOutput.body;
4511
- const $metadata = deserializeMetadata(output);
4512
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4513
- response = new LocationServiceException_1.LocationServiceException({
4514
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4515
- $fault: "client",
4516
- $metadata,
3777
+ (0, smithy_client_1.throwDefaultError)({
3778
+ output,
3779
+ parsedBody,
3780
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3781
+ errorCode,
4517
3782
  });
4518
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4519
3783
  }
4520
3784
  };
4521
3785
  const deserializeAws_restJson1SearchPlaceIndexForTextCommand = async (output, context) => {
4522
3786
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4523
3787
  return deserializeAws_restJson1SearchPlaceIndexForTextCommandError(output, context);
4524
3788
  }
4525
- const contents = {
3789
+ const contents = map({
4526
3790
  $metadata: deserializeMetadata(output),
4527
- Results: undefined,
4528
- Summary: undefined,
4529
- };
3791
+ });
4530
3792
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4531
- if (data.Results !== undefined && data.Results !== null) {
3793
+ if (data.Results != null) {
4532
3794
  contents.Results = deserializeAws_restJson1SearchForTextResultList(data.Results, context);
4533
3795
  }
4534
- if (data.Summary !== undefined && data.Summary !== null) {
3796
+ if (data.Summary != null) {
4535
3797
  contents.Summary = deserializeAws_restJson1SearchPlaceIndexForTextSummary(data.Summary, context);
4536
3798
  }
4537
- return Promise.resolve(contents);
3799
+ return contents;
4538
3800
  };
4539
3801
  exports.deserializeAws_restJson1SearchPlaceIndexForTextCommand = deserializeAws_restJson1SearchPlaceIndexForTextCommand;
4540
3802
  const deserializeAws_restJson1SearchPlaceIndexForTextCommandError = async (output, context) => {
@@ -4542,7 +3804,6 @@ const deserializeAws_restJson1SearchPlaceIndexForTextCommandError = async (outpu
4542
3804
  ...output,
4543
3805
  body: await parseBody(output.body, context),
4544
3806
  };
4545
- let response;
4546
3807
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4547
3808
  switch (errorCode) {
4548
3809
  case "AccessDeniedException":
@@ -4562,25 +3823,23 @@ const deserializeAws_restJson1SearchPlaceIndexForTextCommandError = async (outpu
4562
3823
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4563
3824
  default:
4564
3825
  const parsedBody = parsedOutput.body;
4565
- const $metadata = deserializeMetadata(output);
4566
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4567
- response = new LocationServiceException_1.LocationServiceException({
4568
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4569
- $fault: "client",
4570
- $metadata,
3826
+ (0, smithy_client_1.throwDefaultError)({
3827
+ output,
3828
+ parsedBody,
3829
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3830
+ errorCode,
4571
3831
  });
4572
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4573
3832
  }
4574
3833
  };
4575
3834
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
4576
3835
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4577
3836
  return deserializeAws_restJson1TagResourceCommandError(output, context);
4578
3837
  }
4579
- const contents = {
3838
+ const contents = map({
4580
3839
  $metadata: deserializeMetadata(output),
4581
- };
3840
+ });
4582
3841
  await collectBody(output.body, context);
4583
- return Promise.resolve(contents);
3842
+ return contents;
4584
3843
  };
4585
3844
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
4586
3845
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -4588,7 +3847,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
4588
3847
  ...output,
4589
3848
  body: await parseBody(output.body, context),
4590
3849
  };
4591
- let response;
4592
3850
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4593
3851
  switch (errorCode) {
4594
3852
  case "AccessDeniedException":
@@ -4608,25 +3866,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
4608
3866
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4609
3867
  default:
4610
3868
  const parsedBody = parsedOutput.body;
4611
- const $metadata = deserializeMetadata(output);
4612
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4613
- response = new LocationServiceException_1.LocationServiceException({
4614
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4615
- $fault: "client",
4616
- $metadata,
3869
+ (0, smithy_client_1.throwDefaultError)({
3870
+ output,
3871
+ parsedBody,
3872
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3873
+ errorCode,
4617
3874
  });
4618
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4619
3875
  }
4620
3876
  };
4621
3877
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
4622
3878
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4623
3879
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
4624
3880
  }
4625
- const contents = {
3881
+ const contents = map({
4626
3882
  $metadata: deserializeMetadata(output),
4627
- };
3883
+ });
4628
3884
  await collectBody(output.body, context);
4629
- return Promise.resolve(contents);
3885
+ return contents;
4630
3886
  };
4631
3887
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
4632
3888
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -4634,7 +3890,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
4634
3890
  ...output,
4635
3891
  body: await parseBody(output.body, context),
4636
3892
  };
4637
- let response;
4638
3893
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4639
3894
  switch (errorCode) {
4640
3895
  case "AccessDeniedException":
@@ -4654,37 +3909,32 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
4654
3909
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4655
3910
  default:
4656
3911
  const parsedBody = parsedOutput.body;
4657
- const $metadata = deserializeMetadata(output);
4658
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4659
- response = new LocationServiceException_1.LocationServiceException({
4660
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4661
- $fault: "client",
4662
- $metadata,
3912
+ (0, smithy_client_1.throwDefaultError)({
3913
+ output,
3914
+ parsedBody,
3915
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3916
+ errorCode,
4663
3917
  });
4664
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4665
3918
  }
4666
3919
  };
4667
3920
  const deserializeAws_restJson1UpdateGeofenceCollectionCommand = async (output, context) => {
4668
3921
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4669
3922
  return deserializeAws_restJson1UpdateGeofenceCollectionCommandError(output, context);
4670
3923
  }
4671
- const contents = {
3924
+ const contents = map({
4672
3925
  $metadata: deserializeMetadata(output),
4673
- CollectionArn: undefined,
4674
- CollectionName: undefined,
4675
- UpdateTime: undefined,
4676
- };
3926
+ });
4677
3927
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4678
- if (data.CollectionArn !== undefined && data.CollectionArn !== null) {
3928
+ if (data.CollectionArn != null) {
4679
3929
  contents.CollectionArn = (0, smithy_client_1.expectString)(data.CollectionArn);
4680
3930
  }
4681
- if (data.CollectionName !== undefined && data.CollectionName !== null) {
3931
+ if (data.CollectionName != null) {
4682
3932
  contents.CollectionName = (0, smithy_client_1.expectString)(data.CollectionName);
4683
3933
  }
4684
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
3934
+ if (data.UpdateTime != null) {
4685
3935
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4686
3936
  }
4687
- return Promise.resolve(contents);
3937
+ return contents;
4688
3938
  };
4689
3939
  exports.deserializeAws_restJson1UpdateGeofenceCollectionCommand = deserializeAws_restJson1UpdateGeofenceCollectionCommand;
4690
3940
  const deserializeAws_restJson1UpdateGeofenceCollectionCommandError = async (output, context) => {
@@ -4692,7 +3942,6 @@ const deserializeAws_restJson1UpdateGeofenceCollectionCommandError = async (outp
4692
3942
  ...output,
4693
3943
  body: await parseBody(output.body, context),
4694
3944
  };
4695
- let response;
4696
3945
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4697
3946
  switch (errorCode) {
4698
3947
  case "AccessDeniedException":
@@ -4712,37 +3961,32 @@ const deserializeAws_restJson1UpdateGeofenceCollectionCommandError = async (outp
4712
3961
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4713
3962
  default:
4714
3963
  const parsedBody = parsedOutput.body;
4715
- const $metadata = deserializeMetadata(output);
4716
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4717
- response = new LocationServiceException_1.LocationServiceException({
4718
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4719
- $fault: "client",
4720
- $metadata,
3964
+ (0, smithy_client_1.throwDefaultError)({
3965
+ output,
3966
+ parsedBody,
3967
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
3968
+ errorCode,
4721
3969
  });
4722
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4723
3970
  }
4724
3971
  };
4725
3972
  const deserializeAws_restJson1UpdateMapCommand = async (output, context) => {
4726
3973
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4727
3974
  return deserializeAws_restJson1UpdateMapCommandError(output, context);
4728
3975
  }
4729
- const contents = {
3976
+ const contents = map({
4730
3977
  $metadata: deserializeMetadata(output),
4731
- MapArn: undefined,
4732
- MapName: undefined,
4733
- UpdateTime: undefined,
4734
- };
3978
+ });
4735
3979
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4736
- if (data.MapArn !== undefined && data.MapArn !== null) {
3980
+ if (data.MapArn != null) {
4737
3981
  contents.MapArn = (0, smithy_client_1.expectString)(data.MapArn);
4738
3982
  }
4739
- if (data.MapName !== undefined && data.MapName !== null) {
3983
+ if (data.MapName != null) {
4740
3984
  contents.MapName = (0, smithy_client_1.expectString)(data.MapName);
4741
3985
  }
4742
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
3986
+ if (data.UpdateTime != null) {
4743
3987
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4744
3988
  }
4745
- return Promise.resolve(contents);
3989
+ return contents;
4746
3990
  };
4747
3991
  exports.deserializeAws_restJson1UpdateMapCommand = deserializeAws_restJson1UpdateMapCommand;
4748
3992
  const deserializeAws_restJson1UpdateMapCommandError = async (output, context) => {
@@ -4750,7 +3994,6 @@ const deserializeAws_restJson1UpdateMapCommandError = async (output, context) =>
4750
3994
  ...output,
4751
3995
  body: await parseBody(output.body, context),
4752
3996
  };
4753
- let response;
4754
3997
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4755
3998
  switch (errorCode) {
4756
3999
  case "AccessDeniedException":
@@ -4770,37 +4013,32 @@ const deserializeAws_restJson1UpdateMapCommandError = async (output, context) =>
4770
4013
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4771
4014
  default:
4772
4015
  const parsedBody = parsedOutput.body;
4773
- const $metadata = deserializeMetadata(output);
4774
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4775
- response = new LocationServiceException_1.LocationServiceException({
4776
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4777
- $fault: "client",
4778
- $metadata,
4016
+ (0, smithy_client_1.throwDefaultError)({
4017
+ output,
4018
+ parsedBody,
4019
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
4020
+ errorCode,
4779
4021
  });
4780
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4781
4022
  }
4782
4023
  };
4783
4024
  const deserializeAws_restJson1UpdatePlaceIndexCommand = async (output, context) => {
4784
4025
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4785
4026
  return deserializeAws_restJson1UpdatePlaceIndexCommandError(output, context);
4786
4027
  }
4787
- const contents = {
4028
+ const contents = map({
4788
4029
  $metadata: deserializeMetadata(output),
4789
- IndexArn: undefined,
4790
- IndexName: undefined,
4791
- UpdateTime: undefined,
4792
- };
4030
+ });
4793
4031
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4794
- if (data.IndexArn !== undefined && data.IndexArn !== null) {
4032
+ if (data.IndexArn != null) {
4795
4033
  contents.IndexArn = (0, smithy_client_1.expectString)(data.IndexArn);
4796
4034
  }
4797
- if (data.IndexName !== undefined && data.IndexName !== null) {
4035
+ if (data.IndexName != null) {
4798
4036
  contents.IndexName = (0, smithy_client_1.expectString)(data.IndexName);
4799
4037
  }
4800
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
4038
+ if (data.UpdateTime != null) {
4801
4039
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4802
4040
  }
4803
- return Promise.resolve(contents);
4041
+ return contents;
4804
4042
  };
4805
4043
  exports.deserializeAws_restJson1UpdatePlaceIndexCommand = deserializeAws_restJson1UpdatePlaceIndexCommand;
4806
4044
  const deserializeAws_restJson1UpdatePlaceIndexCommandError = async (output, context) => {
@@ -4808,7 +4046,6 @@ const deserializeAws_restJson1UpdatePlaceIndexCommandError = async (output, cont
4808
4046
  ...output,
4809
4047
  body: await parseBody(output.body, context),
4810
4048
  };
4811
- let response;
4812
4049
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4813
4050
  switch (errorCode) {
4814
4051
  case "AccessDeniedException":
@@ -4828,37 +4065,32 @@ const deserializeAws_restJson1UpdatePlaceIndexCommandError = async (output, cont
4828
4065
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4829
4066
  default:
4830
4067
  const parsedBody = parsedOutput.body;
4831
- const $metadata = deserializeMetadata(output);
4832
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4833
- response = new LocationServiceException_1.LocationServiceException({
4834
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4835
- $fault: "client",
4836
- $metadata,
4068
+ (0, smithy_client_1.throwDefaultError)({
4069
+ output,
4070
+ parsedBody,
4071
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
4072
+ errorCode,
4837
4073
  });
4838
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4839
4074
  }
4840
4075
  };
4841
4076
  const deserializeAws_restJson1UpdateRouteCalculatorCommand = async (output, context) => {
4842
4077
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4843
4078
  return deserializeAws_restJson1UpdateRouteCalculatorCommandError(output, context);
4844
4079
  }
4845
- const contents = {
4080
+ const contents = map({
4846
4081
  $metadata: deserializeMetadata(output),
4847
- CalculatorArn: undefined,
4848
- CalculatorName: undefined,
4849
- UpdateTime: undefined,
4850
- };
4082
+ });
4851
4083
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4852
- if (data.CalculatorArn !== undefined && data.CalculatorArn !== null) {
4084
+ if (data.CalculatorArn != null) {
4853
4085
  contents.CalculatorArn = (0, smithy_client_1.expectString)(data.CalculatorArn);
4854
4086
  }
4855
- if (data.CalculatorName !== undefined && data.CalculatorName !== null) {
4087
+ if (data.CalculatorName != null) {
4856
4088
  contents.CalculatorName = (0, smithy_client_1.expectString)(data.CalculatorName);
4857
4089
  }
4858
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
4090
+ if (data.UpdateTime != null) {
4859
4091
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4860
4092
  }
4861
- return Promise.resolve(contents);
4093
+ return contents;
4862
4094
  };
4863
4095
  exports.deserializeAws_restJson1UpdateRouteCalculatorCommand = deserializeAws_restJson1UpdateRouteCalculatorCommand;
4864
4096
  const deserializeAws_restJson1UpdateRouteCalculatorCommandError = async (output, context) => {
@@ -4866,7 +4098,6 @@ const deserializeAws_restJson1UpdateRouteCalculatorCommandError = async (output,
4866
4098
  ...output,
4867
4099
  body: await parseBody(output.body, context),
4868
4100
  };
4869
- let response;
4870
4101
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4871
4102
  switch (errorCode) {
4872
4103
  case "AccessDeniedException":
@@ -4886,37 +4117,32 @@ const deserializeAws_restJson1UpdateRouteCalculatorCommandError = async (output,
4886
4117
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4887
4118
  default:
4888
4119
  const parsedBody = parsedOutput.body;
4889
- const $metadata = deserializeMetadata(output);
4890
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4891
- response = new LocationServiceException_1.LocationServiceException({
4892
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4893
- $fault: "client",
4894
- $metadata,
4120
+ (0, smithy_client_1.throwDefaultError)({
4121
+ output,
4122
+ parsedBody,
4123
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
4124
+ errorCode,
4895
4125
  });
4896
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4897
4126
  }
4898
4127
  };
4899
4128
  const deserializeAws_restJson1UpdateTrackerCommand = async (output, context) => {
4900
4129
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4901
4130
  return deserializeAws_restJson1UpdateTrackerCommandError(output, context);
4902
4131
  }
4903
- const contents = {
4132
+ const contents = map({
4904
4133
  $metadata: deserializeMetadata(output),
4905
- TrackerArn: undefined,
4906
- TrackerName: undefined,
4907
- UpdateTime: undefined,
4908
- };
4134
+ });
4909
4135
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
4910
- if (data.TrackerArn !== undefined && data.TrackerArn !== null) {
4136
+ if (data.TrackerArn != null) {
4911
4137
  contents.TrackerArn = (0, smithy_client_1.expectString)(data.TrackerArn);
4912
4138
  }
4913
- if (data.TrackerName !== undefined && data.TrackerName !== null) {
4139
+ if (data.TrackerName != null) {
4914
4140
  contents.TrackerName = (0, smithy_client_1.expectString)(data.TrackerName);
4915
4141
  }
4916
- if (data.UpdateTime !== undefined && data.UpdateTime !== null) {
4142
+ if (data.UpdateTime != null) {
4917
4143
  contents.UpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.UpdateTime));
4918
4144
  }
4919
- return Promise.resolve(contents);
4145
+ return contents;
4920
4146
  };
4921
4147
  exports.deserializeAws_restJson1UpdateTrackerCommand = deserializeAws_restJson1UpdateTrackerCommand;
4922
4148
  const deserializeAws_restJson1UpdateTrackerCommandError = async (output, context) => {
@@ -4924,7 +4150,6 @@ const deserializeAws_restJson1UpdateTrackerCommandError = async (output, context
4924
4150
  ...output,
4925
4151
  body: await parseBody(output.body, context),
4926
4152
  };
4927
- let response;
4928
4153
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4929
4154
  switch (errorCode) {
4930
4155
  case "AccessDeniedException":
@@ -4944,20 +4169,19 @@ const deserializeAws_restJson1UpdateTrackerCommandError = async (output, context
4944
4169
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4945
4170
  default:
4946
4171
  const parsedBody = parsedOutput.body;
4947
- const $metadata = deserializeMetadata(output);
4948
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4949
- response = new LocationServiceException_1.LocationServiceException({
4950
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4951
- $fault: "client",
4952
- $metadata,
4172
+ (0, smithy_client_1.throwDefaultError)({
4173
+ output,
4174
+ parsedBody,
4175
+ exceptionCtor: LocationServiceException_1.LocationServiceException,
4176
+ errorCode,
4953
4177
  });
4954
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
4955
4178
  }
4956
4179
  };
4180
+ const map = smithy_client_1.map;
4957
4181
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
4958
- const contents = {};
4182
+ const contents = map({});
4959
4183
  const data = parsedOutput.body;
4960
- if (data.message !== undefined && data.message !== null) {
4184
+ if (data.message != null) {
4961
4185
  contents.Message = (0, smithy_client_1.expectString)(data.message);
4962
4186
  }
4963
4187
  const exception = new models_0_1.AccessDeniedException({
@@ -4967,9 +4191,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
4967
4191
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4968
4192
  };
4969
4193
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
4970
- const contents = {};
4194
+ const contents = map({});
4971
4195
  const data = parsedOutput.body;
4972
- if (data.message !== undefined && data.message !== null) {
4196
+ if (data.message != null) {
4973
4197
  contents.Message = (0, smithy_client_1.expectString)(data.message);
4974
4198
  }
4975
4199
  const exception = new models_0_1.ConflictException({
@@ -4979,9 +4203,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
4979
4203
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4980
4204
  };
4981
4205
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
4982
- const contents = {};
4206
+ const contents = map({});
4983
4207
  const data = parsedOutput.body;
4984
- if (data.message !== undefined && data.message !== null) {
4208
+ if (data.message != null) {
4985
4209
  contents.Message = (0, smithy_client_1.expectString)(data.message);
4986
4210
  }
4987
4211
  const exception = new models_0_1.InternalServerException({
@@ -4991,9 +4215,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
4991
4215
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
4992
4216
  };
4993
4217
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
4994
- const contents = {};
4218
+ const contents = map({});
4995
4219
  const data = parsedOutput.body;
4996
- if (data.message !== undefined && data.message !== null) {
4220
+ if (data.message != null) {
4997
4221
  contents.Message = (0, smithy_client_1.expectString)(data.message);
4998
4222
  }
4999
4223
  const exception = new models_0_1.ResourceNotFoundException({
@@ -5003,9 +4227,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
5003
4227
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
5004
4228
  };
5005
4229
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
5006
- const contents = {};
4230
+ const contents = map({});
5007
4231
  const data = parsedOutput.body;
5008
- if (data.message !== undefined && data.message !== null) {
4232
+ if (data.message != null) {
5009
4233
  contents.Message = (0, smithy_client_1.expectString)(data.message);
5010
4234
  }
5011
4235
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -5015,9 +4239,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
5015
4239
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
5016
4240
  };
5017
4241
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
5018
- const contents = {};
4242
+ const contents = map({});
5019
4243
  const data = parsedOutput.body;
5020
- if (data.message !== undefined && data.message !== null) {
4244
+ if (data.message != null) {
5021
4245
  contents.Message = (0, smithy_client_1.expectString)(data.message);
5022
4246
  }
5023
4247
  const exception = new models_0_1.ThrottlingException({
@@ -5027,15 +4251,15 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
5027
4251
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
5028
4252
  };
5029
4253
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
5030
- const contents = {};
4254
+ const contents = map({});
5031
4255
  const data = parsedOutput.body;
5032
- if (data.fieldList !== undefined && data.fieldList !== null) {
4256
+ if (data.fieldList != null) {
5033
4257
  contents.FieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
5034
4258
  }
5035
- if (data.message !== undefined && data.message !== null) {
4259
+ if (data.message != null) {
5036
4260
  contents.Message = (0, smithy_client_1.expectString)(data.message);
5037
4261
  }
5038
- if (data.reason !== undefined && data.reason !== null) {
4262
+ if (data.reason != null) {
5039
4263
  contents.Reason = (0, smithy_client_1.expectString)(data.reason);
5040
4264
  }
5041
4265
  const exception = new models_0_1.ValidationException({
@@ -5054,9 +4278,6 @@ const serializeAws_restJson1BatchPutGeofenceRequestEntryList = (input, context)
5054
4278
  return input
5055
4279
  .filter((e) => e != null)
5056
4280
  .map((entry) => {
5057
- if (entry === null) {
5058
- return null;
5059
- }
5060
4281
  return serializeAws_restJson1BatchPutGeofenceRequestEntry(entry, context);
5061
4282
  });
5062
4283
  };
@@ -5064,9 +4285,6 @@ const serializeAws_restJson1BoundingBox = (input, context) => {
5064
4285
  return input
5065
4286
  .filter((e) => e != null)
5066
4287
  .map((entry) => {
5067
- if (entry === null) {
5068
- return null;
5069
- }
5070
4288
  return (0, smithy_client_1.serializeFloat)(entry);
5071
4289
  });
5072
4290
  };
@@ -5088,9 +4306,6 @@ const serializeAws_restJson1CountryCodeList = (input, context) => {
5088
4306
  return input
5089
4307
  .filter((e) => e != null)
5090
4308
  .map((entry) => {
5091
- if (entry === null) {
5092
- return null;
5093
- }
5094
4309
  return entry;
5095
4310
  });
5096
4311
  };
@@ -5103,9 +4318,6 @@ const serializeAws_restJson1DeviceIdsList = (input, context) => {
5103
4318
  return input
5104
4319
  .filter((e) => e != null)
5105
4320
  .map((entry) => {
5106
- if (entry === null) {
5107
- return null;
5108
- }
5109
4321
  return entry;
5110
4322
  });
5111
4323
  };
@@ -5124,9 +4336,6 @@ const serializeAws_restJson1DevicePositionUpdateList = (input, context) => {
5124
4336
  return input
5125
4337
  .filter((e) => e != null)
5126
4338
  .map((entry) => {
5127
- if (entry === null) {
5128
- return null;
5129
- }
5130
4339
  return serializeAws_restJson1DevicePositionUpdate(entry, context);
5131
4340
  });
5132
4341
  };
@@ -5139,9 +4348,6 @@ const serializeAws_restJson1IdList = (input, context) => {
5139
4348
  return input
5140
4349
  .filter((e) => e != null)
5141
4350
  .map((entry) => {
5142
- if (entry === null) {
5143
- return null;
5144
- }
5145
4351
  return entry;
5146
4352
  });
5147
4353
  };
@@ -5149,9 +4355,6 @@ const serializeAws_restJson1LinearRing = (input, context) => {
5149
4355
  return input
5150
4356
  .filter((e) => e != null)
5151
4357
  .map((entry) => {
5152
- if (entry === null) {
5153
- return null;
5154
- }
5155
4358
  return serializeAws_restJson1Position(entry, context);
5156
4359
  });
5157
4360
  };
@@ -5159,9 +4362,6 @@ const serializeAws_restJson1LinearRings = (input, context) => {
5159
4362
  return input
5160
4363
  .filter((e) => e != null)
5161
4364
  .map((entry) => {
5162
- if (entry === null) {
5163
- return null;
5164
- }
5165
4365
  return serializeAws_restJson1LinearRing(entry, context);
5166
4366
  });
5167
4367
  };
@@ -5174,9 +4374,6 @@ const serializeAws_restJson1Position = (input, context) => {
5174
4374
  return input
5175
4375
  .filter((e) => e != null)
5176
4376
  .map((entry) => {
5177
- if (entry === null) {
5178
- return null;
5179
- }
5180
4377
  return (0, smithy_client_1.serializeFloat)(entry);
5181
4378
  });
5182
4379
  };
@@ -5189,9 +4386,6 @@ const serializeAws_restJson1PositionList = (input, context) => {
5189
4386
  return input
5190
4387
  .filter((e) => e != null)
5191
4388
  .map((entry) => {
5192
- if (entry === null) {
5193
- return null;
5194
- }
5195
4389
  return serializeAws_restJson1Position(entry, context);
5196
4390
  });
5197
4391
  };
@@ -5235,9 +4429,6 @@ const serializeAws_restJson1WaypointPositionList = (input, context) => {
5235
4429
  return input
5236
4430
  .filter((e) => e != null)
5237
4431
  .map((entry) => {
5238
- if (entry === null) {
5239
- return null;
5240
- }
5241
4432
  return serializeAws_restJson1Position(entry, context);
5242
4433
  });
5243
4434
  };