@aws-sdk/client-iottwinmaker 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,16 +13,7 @@ const serializeAws_restJson1BatchPutPropertyValuesCommand = async (input, contex
13
13
  };
14
14
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
15
15
  "/workspaces/{workspaceId}/entity-properties";
16
- if (input.workspaceId !== undefined) {
17
- const labelValue = input.workspaceId;
18
- if (labelValue.length <= 0) {
19
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
20
- }
21
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
22
- }
23
- else {
24
- throw new Error("No value provided for input HTTP label: workspaceId.");
25
- }
16
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
26
17
  let body;
27
18
  body = JSON.stringify({
28
19
  ...(input.entries != null && { entries: serializeAws_restJson1Entries(input.entries, context) }),
@@ -52,26 +43,8 @@ const serializeAws_restJson1CreateComponentTypeCommand = async (input, context)
52
43
  };
53
44
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
54
45
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
55
- if (input.workspaceId !== undefined) {
56
- const labelValue = input.workspaceId;
57
- if (labelValue.length <= 0) {
58
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
59
- }
60
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
61
- }
62
- else {
63
- throw new Error("No value provided for input HTTP label: workspaceId.");
64
- }
65
- if (input.componentTypeId !== undefined) {
66
- const labelValue = input.componentTypeId;
67
- if (labelValue.length <= 0) {
68
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
69
- }
70
- resolvedPath = resolvedPath.replace("{componentTypeId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
71
- }
72
- else {
73
- throw new Error("No value provided for input HTTP label: componentTypeId.");
74
- }
46
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
47
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "componentTypeId", () => input.componentTypeId, "{componentTypeId}", false);
75
48
  let body;
76
49
  body = JSON.stringify({
77
50
  ...(input.description != null && { description: input.description }),
@@ -107,16 +80,7 @@ const serializeAws_restJson1CreateEntityCommand = async (input, context) => {
107
80
  "content-type": "application/json",
108
81
  };
109
82
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/entities";
110
- if (input.workspaceId !== undefined) {
111
- const labelValue = input.workspaceId;
112
- if (labelValue.length <= 0) {
113
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
114
- }
115
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
116
- }
117
- else {
118
- throw new Error("No value provided for input HTTP label: workspaceId.");
119
- }
83
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
120
84
  let body;
121
85
  body = JSON.stringify({
122
86
  ...(input.components != null && {
@@ -152,16 +116,7 @@ const serializeAws_restJson1CreateSceneCommand = async (input, context) => {
152
116
  "content-type": "application/json",
153
117
  };
154
118
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/scenes";
155
- if (input.workspaceId !== undefined) {
156
- const labelValue = input.workspaceId;
157
- if (labelValue.length <= 0) {
158
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
159
- }
160
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
161
- }
162
- else {
163
- throw new Error("No value provided for input HTTP label: workspaceId.");
164
- }
119
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
165
120
  let body;
166
121
  body = JSON.stringify({
167
122
  ...(input.capabilities != null && {
@@ -196,16 +151,7 @@ const serializeAws_restJson1CreateWorkspaceCommand = async (input, context) => {
196
151
  "content-type": "application/json",
197
152
  };
198
153
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
199
- if (input.workspaceId !== undefined) {
200
- const labelValue = input.workspaceId;
201
- if (labelValue.length <= 0) {
202
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
203
- }
204
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
205
- }
206
- else {
207
- throw new Error("No value provided for input HTTP label: workspaceId.");
208
- }
154
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
209
155
  let body;
210
156
  body = JSON.stringify({
211
157
  ...(input.description != null && { description: input.description }),
@@ -236,26 +182,8 @@ const serializeAws_restJson1DeleteComponentTypeCommand = async (input, context)
236
182
  const headers = {};
237
183
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
238
184
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
239
- if (input.workspaceId !== undefined) {
240
- const labelValue = input.workspaceId;
241
- if (labelValue.length <= 0) {
242
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
243
- }
244
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
245
- }
246
- else {
247
- throw new Error("No value provided for input HTTP label: workspaceId.");
248
- }
249
- if (input.componentTypeId !== undefined) {
250
- const labelValue = input.componentTypeId;
251
- if (labelValue.length <= 0) {
252
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
253
- }
254
- resolvedPath = resolvedPath.replace("{componentTypeId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
255
- }
256
- else {
257
- throw new Error("No value provided for input HTTP label: componentTypeId.");
258
- }
185
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
186
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "componentTypeId", () => input.componentTypeId, "{componentTypeId}", false);
259
187
  let body;
260
188
  let { hostname: resolvedHostname } = await context.endpoint();
261
189
  if (context.disableHostPrefix !== true) {
@@ -280,29 +208,11 @@ const serializeAws_restJson1DeleteEntityCommand = async (input, context) => {
280
208
  const headers = {};
281
209
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
282
210
  "/workspaces/{workspaceId}/entities/{entityId}";
283
- if (input.workspaceId !== undefined) {
284
- const labelValue = input.workspaceId;
285
- if (labelValue.length <= 0) {
286
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
287
- }
288
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
289
- }
290
- else {
291
- throw new Error("No value provided for input HTTP label: workspaceId.");
292
- }
293
- if (input.entityId !== undefined) {
294
- const labelValue = input.entityId;
295
- if (labelValue.length <= 0) {
296
- throw new Error("Empty value provided for input HTTP label: entityId.");
297
- }
298
- resolvedPath = resolvedPath.replace("{entityId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
299
- }
300
- else {
301
- throw new Error("No value provided for input HTTP label: entityId.");
302
- }
303
- const query = {
304
- ...(input.isRecursive !== undefined && { isRecursive: input.isRecursive.toString() }),
305
- };
211
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
212
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "entityId", () => input.entityId, "{entityId}", false);
213
+ const query = map({
214
+ isRecursive: [() => input.isRecursive !== void 0, () => input.isRecursive.toString()],
215
+ });
306
216
  let body;
307
217
  let { hostname: resolvedHostname } = await context.endpoint();
308
218
  if (context.disableHostPrefix !== true) {
@@ -328,26 +238,8 @@ const serializeAws_restJson1DeleteSceneCommand = async (input, context) => {
328
238
  const headers = {};
329
239
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
330
240
  "/workspaces/{workspaceId}/scenes/{sceneId}";
331
- if (input.workspaceId !== undefined) {
332
- const labelValue = input.workspaceId;
333
- if (labelValue.length <= 0) {
334
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
335
- }
336
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
337
- }
338
- else {
339
- throw new Error("No value provided for input HTTP label: workspaceId.");
340
- }
341
- if (input.sceneId !== undefined) {
342
- const labelValue = input.sceneId;
343
- if (labelValue.length <= 0) {
344
- throw new Error("Empty value provided for input HTTP label: sceneId.");
345
- }
346
- resolvedPath = resolvedPath.replace("{sceneId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
347
- }
348
- else {
349
- throw new Error("No value provided for input HTTP label: sceneId.");
350
- }
241
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
242
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sceneId", () => input.sceneId, "{sceneId}", false);
351
243
  let body;
352
244
  let { hostname: resolvedHostname } = await context.endpoint();
353
245
  if (context.disableHostPrefix !== true) {
@@ -371,16 +263,7 @@ const serializeAws_restJson1DeleteWorkspaceCommand = async (input, context) => {
371
263
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
372
264
  const headers = {};
373
265
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
374
- if (input.workspaceId !== undefined) {
375
- const labelValue = input.workspaceId;
376
- if (labelValue.length <= 0) {
377
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
378
- }
379
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
380
- }
381
- else {
382
- throw new Error("No value provided for input HTTP label: workspaceId.");
383
- }
266
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
384
267
  let body;
385
268
  let { hostname: resolvedHostname } = await context.endpoint();
386
269
  if (context.disableHostPrefix !== true) {
@@ -405,26 +288,8 @@ const serializeAws_restJson1GetComponentTypeCommand = async (input, context) =>
405
288
  const headers = {};
406
289
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
407
290
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
408
- if (input.workspaceId !== undefined) {
409
- const labelValue = input.workspaceId;
410
- if (labelValue.length <= 0) {
411
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
412
- }
413
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
414
- }
415
- else {
416
- throw new Error("No value provided for input HTTP label: workspaceId.");
417
- }
418
- if (input.componentTypeId !== undefined) {
419
- const labelValue = input.componentTypeId;
420
- if (labelValue.length <= 0) {
421
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
422
- }
423
- resolvedPath = resolvedPath.replace("{componentTypeId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
424
- }
425
- else {
426
- throw new Error("No value provided for input HTTP label: componentTypeId.");
427
- }
291
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
292
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "componentTypeId", () => input.componentTypeId, "{componentTypeId}", false);
428
293
  let body;
429
294
  let { hostname: resolvedHostname } = await context.endpoint();
430
295
  if (context.disableHostPrefix !== true) {
@@ -449,26 +314,8 @@ const serializeAws_restJson1GetEntityCommand = async (input, context) => {
449
314
  const headers = {};
450
315
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
451
316
  "/workspaces/{workspaceId}/entities/{entityId}";
452
- if (input.workspaceId !== undefined) {
453
- const labelValue = input.workspaceId;
454
- if (labelValue.length <= 0) {
455
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
456
- }
457
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
458
- }
459
- else {
460
- throw new Error("No value provided for input HTTP label: workspaceId.");
461
- }
462
- if (input.entityId !== undefined) {
463
- const labelValue = input.entityId;
464
- if (labelValue.length <= 0) {
465
- throw new Error("Empty value provided for input HTTP label: entityId.");
466
- }
467
- resolvedPath = resolvedPath.replace("{entityId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
468
- }
469
- else {
470
- throw new Error("No value provided for input HTTP label: entityId.");
471
- }
317
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
318
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "entityId", () => input.entityId, "{entityId}", false);
472
319
  let body;
473
320
  let { hostname: resolvedHostname } = await context.endpoint();
474
321
  if (context.disableHostPrefix !== true) {
@@ -495,16 +342,7 @@ const serializeAws_restJson1GetPropertyValueCommand = async (input, context) =>
495
342
  };
496
343
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
497
344
  "/workspaces/{workspaceId}/entity-properties/value";
498
- if (input.workspaceId !== undefined) {
499
- const labelValue = input.workspaceId;
500
- if (labelValue.length <= 0) {
501
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
502
- }
503
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
504
- }
505
- else {
506
- throw new Error("No value provided for input HTTP label: workspaceId.");
507
- }
345
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
508
346
  let body;
509
347
  body = JSON.stringify({
510
348
  ...(input.componentName != null && { componentName: input.componentName }),
@@ -539,16 +377,7 @@ const serializeAws_restJson1GetPropertyValueHistoryCommand = async (input, conte
539
377
  };
540
378
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
541
379
  "/workspaces/{workspaceId}/entity-properties/history";
542
- if (input.workspaceId !== undefined) {
543
- const labelValue = input.workspaceId;
544
- if (labelValue.length <= 0) {
545
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
546
- }
547
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
548
- }
549
- else {
550
- throw new Error("No value provided for input HTTP label: workspaceId.");
551
- }
380
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
552
381
  let body;
553
382
  body = JSON.stringify({
554
383
  ...(input.componentName != null && { componentName: input.componentName }),
@@ -594,26 +423,8 @@ const serializeAws_restJson1GetSceneCommand = async (input, context) => {
594
423
  const headers = {};
595
424
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
596
425
  "/workspaces/{workspaceId}/scenes/{sceneId}";
597
- if (input.workspaceId !== undefined) {
598
- const labelValue = input.workspaceId;
599
- if (labelValue.length <= 0) {
600
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
601
- }
602
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
603
- }
604
- else {
605
- throw new Error("No value provided for input HTTP label: workspaceId.");
606
- }
607
- if (input.sceneId !== undefined) {
608
- const labelValue = input.sceneId;
609
- if (labelValue.length <= 0) {
610
- throw new Error("Empty value provided for input HTTP label: sceneId.");
611
- }
612
- resolvedPath = resolvedPath.replace("{sceneId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
613
- }
614
- else {
615
- throw new Error("No value provided for input HTTP label: sceneId.");
616
- }
426
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
427
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sceneId", () => input.sceneId, "{sceneId}", false);
617
428
  let body;
618
429
  let { hostname: resolvedHostname } = await context.endpoint();
619
430
  if (context.disableHostPrefix !== true) {
@@ -637,16 +448,7 @@ const serializeAws_restJson1GetWorkspaceCommand = async (input, context) => {
637
448
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
638
449
  const headers = {};
639
450
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
640
- if (input.workspaceId !== undefined) {
641
- const labelValue = input.workspaceId;
642
- if (labelValue.length <= 0) {
643
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
644
- }
645
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
646
- }
647
- else {
648
- throw new Error("No value provided for input HTTP label: workspaceId.");
649
- }
451
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
650
452
  let body;
651
453
  let { hostname: resolvedHostname } = await context.endpoint();
652
454
  if (context.disableHostPrefix !== true) {
@@ -673,16 +475,7 @@ const serializeAws_restJson1ListComponentTypesCommand = async (input, context) =
673
475
  };
674
476
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
675
477
  "/workspaces/{workspaceId}/component-types-list";
676
- if (input.workspaceId !== undefined) {
677
- const labelValue = input.workspaceId;
678
- if (labelValue.length <= 0) {
679
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
680
- }
681
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
682
- }
683
- else {
684
- throw new Error("No value provided for input HTTP label: workspaceId.");
685
- }
478
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
686
479
  let body;
687
480
  body = JSON.stringify({
688
481
  ...(input.filters != null && { filters: serializeAws_restJson1ListComponentTypesFilters(input.filters, context) }),
@@ -713,16 +506,7 @@ const serializeAws_restJson1ListEntitiesCommand = async (input, context) => {
713
506
  "content-type": "application/json",
714
507
  };
715
508
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/entities-list";
716
- if (input.workspaceId !== undefined) {
717
- const labelValue = input.workspaceId;
718
- if (labelValue.length <= 0) {
719
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
720
- }
721
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
722
- }
723
- else {
724
- throw new Error("No value provided for input HTTP label: workspaceId.");
725
- }
509
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
726
510
  let body;
727
511
  body = JSON.stringify({
728
512
  ...(input.filters != null && { filters: serializeAws_restJson1ListEntitiesFilters(input.filters, context) }),
@@ -753,16 +537,7 @@ const serializeAws_restJson1ListScenesCommand = async (input, context) => {
753
537
  "content-type": "application/json",
754
538
  };
755
539
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/scenes-list";
756
- if (input.workspaceId !== undefined) {
757
- const labelValue = input.workspaceId;
758
- if (labelValue.length <= 0) {
759
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
760
- }
761
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
762
- }
763
- else {
764
- throw new Error("No value provided for input HTTP label: workspaceId.");
765
- }
540
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
766
541
  let body;
767
542
  body = JSON.stringify({
768
543
  ...(input.maxResults != null && { maxResults: input.maxResults }),
@@ -878,10 +653,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
878
653
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
879
654
  const headers = {};
880
655
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
881
- const query = {
882
- ...(input.resourceARN !== undefined && { resourceARN: input.resourceARN }),
883
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
884
- };
656
+ const query = map({
657
+ resourceARN: [, input.resourceARN],
658
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
659
+ });
885
660
  let body;
886
661
  let { hostname: resolvedHostname } = await context.endpoint();
887
662
  if (context.disableHostPrefix !== true) {
@@ -909,26 +684,8 @@ const serializeAws_restJson1UpdateComponentTypeCommand = async (input, context)
909
684
  };
910
685
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
911
686
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
912
- if (input.workspaceId !== undefined) {
913
- const labelValue = input.workspaceId;
914
- if (labelValue.length <= 0) {
915
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
916
- }
917
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
918
- }
919
- else {
920
- throw new Error("No value provided for input HTTP label: workspaceId.");
921
- }
922
- if (input.componentTypeId !== undefined) {
923
- const labelValue = input.componentTypeId;
924
- if (labelValue.length <= 0) {
925
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
926
- }
927
- resolvedPath = resolvedPath.replace("{componentTypeId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
928
- }
929
- else {
930
- throw new Error("No value provided for input HTTP label: componentTypeId.");
931
- }
687
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
688
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "componentTypeId", () => input.componentTypeId, "{componentTypeId}", false);
932
689
  let body;
933
690
  body = JSON.stringify({
934
691
  ...(input.description != null && { description: input.description }),
@@ -964,26 +721,8 @@ const serializeAws_restJson1UpdateEntityCommand = async (input, context) => {
964
721
  };
965
722
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
966
723
  "/workspaces/{workspaceId}/entities/{entityId}";
967
- if (input.workspaceId !== undefined) {
968
- const labelValue = input.workspaceId;
969
- if (labelValue.length <= 0) {
970
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
971
- }
972
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
973
- }
974
- else {
975
- throw new Error("No value provided for input HTTP label: workspaceId.");
976
- }
977
- if (input.entityId !== undefined) {
978
- const labelValue = input.entityId;
979
- if (labelValue.length <= 0) {
980
- throw new Error("Empty value provided for input HTTP label: entityId.");
981
- }
982
- resolvedPath = resolvedPath.replace("{entityId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
983
- }
984
- else {
985
- throw new Error("No value provided for input HTTP label: entityId.");
986
- }
724
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
725
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "entityId", () => input.entityId, "{entityId}", false);
987
726
  let body;
988
727
  body = JSON.stringify({
989
728
  ...(input.componentUpdates != null && {
@@ -1020,26 +759,8 @@ const serializeAws_restJson1UpdateSceneCommand = async (input, context) => {
1020
759
  };
1021
760
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
1022
761
  "/workspaces/{workspaceId}/scenes/{sceneId}";
1023
- if (input.workspaceId !== undefined) {
1024
- const labelValue = input.workspaceId;
1025
- if (labelValue.length <= 0) {
1026
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1027
- }
1028
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1029
- }
1030
- else {
1031
- throw new Error("No value provided for input HTTP label: workspaceId.");
1032
- }
1033
- if (input.sceneId !== undefined) {
1034
- const labelValue = input.sceneId;
1035
- if (labelValue.length <= 0) {
1036
- throw new Error("Empty value provided for input HTTP label: sceneId.");
1037
- }
1038
- resolvedPath = resolvedPath.replace("{sceneId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1039
- }
1040
- else {
1041
- throw new Error("No value provided for input HTTP label: sceneId.");
1042
- }
762
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
763
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sceneId", () => input.sceneId, "{sceneId}", false);
1043
764
  let body;
1044
765
  body = JSON.stringify({
1045
766
  ...(input.capabilities != null && {
@@ -1072,16 +793,7 @@ const serializeAws_restJson1UpdateWorkspaceCommand = async (input, context) => {
1072
793
  "content-type": "application/json",
1073
794
  };
1074
795
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
1075
- if (input.workspaceId !== undefined) {
1076
- const labelValue = input.workspaceId;
1077
- if (labelValue.length <= 0) {
1078
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1079
- }
1080
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1081
- }
1082
- else {
1083
- throw new Error("No value provided for input HTTP label: workspaceId.");
1084
- }
796
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
1085
797
  let body;
1086
798
  body = JSON.stringify({
1087
799
  ...(input.description != null && { description: input.description }),
@@ -1109,15 +821,14 @@ const deserializeAws_restJson1BatchPutPropertyValuesCommand = async (output, con
1109
821
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1110
822
  return deserializeAws_restJson1BatchPutPropertyValuesCommandError(output, context);
1111
823
  }
1112
- const contents = {
824
+ const contents = map({
1113
825
  $metadata: deserializeMetadata(output),
1114
- errorEntries: undefined,
1115
- };
826
+ });
1116
827
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1117
- if (data.errorEntries !== undefined && data.errorEntries !== null) {
828
+ if (data.errorEntries != null) {
1118
829
  contents.errorEntries = deserializeAws_restJson1ErrorEntries(data.errorEntries, context);
1119
830
  }
1120
- return Promise.resolve(contents);
831
+ return contents;
1121
832
  };
1122
833
  exports.deserializeAws_restJson1BatchPutPropertyValuesCommand = deserializeAws_restJson1BatchPutPropertyValuesCommand;
1123
834
  const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async (output, context) => {
@@ -1125,7 +836,6 @@ const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async (output
1125
836
  ...output,
1126
837
  body: await parseBody(output.body, context),
1127
838
  };
1128
- let response;
1129
839
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
840
  switch (errorCode) {
1131
841
  case "InternalServerException":
@@ -1142,37 +852,32 @@ const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async (output
1142
852
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1143
853
  default:
1144
854
  const parsedBody = parsedOutput.body;
1145
- const $metadata = deserializeMetadata(output);
1146
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1147
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1148
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1149
- $fault: "client",
1150
- $metadata,
855
+ (0, smithy_client_1.throwDefaultError)({
856
+ output,
857
+ parsedBody,
858
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
859
+ errorCode,
1151
860
  });
1152
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1153
861
  }
1154
862
  };
1155
863
  const deserializeAws_restJson1CreateComponentTypeCommand = async (output, context) => {
1156
864
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1157
865
  return deserializeAws_restJson1CreateComponentTypeCommandError(output, context);
1158
866
  }
1159
- const contents = {
867
+ const contents = map({
1160
868
  $metadata: deserializeMetadata(output),
1161
- arn: undefined,
1162
- creationDateTime: undefined,
1163
- state: undefined,
1164
- };
869
+ });
1165
870
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1166
- if (data.arn !== undefined && data.arn !== null) {
871
+ if (data.arn != null) {
1167
872
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1168
873
  }
1169
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
874
+ if (data.creationDateTime != null) {
1170
875
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1171
876
  }
1172
- if (data.state !== undefined && data.state !== null) {
877
+ if (data.state != null) {
1173
878
  contents.state = (0, smithy_client_1.expectString)(data.state);
1174
879
  }
1175
- return Promise.resolve(contents);
880
+ return contents;
1176
881
  };
1177
882
  exports.deserializeAws_restJson1CreateComponentTypeCommand = deserializeAws_restJson1CreateComponentTypeCommand;
1178
883
  const deserializeAws_restJson1CreateComponentTypeCommandError = async (output, context) => {
@@ -1180,7 +885,6 @@ const deserializeAws_restJson1CreateComponentTypeCommandError = async (output, c
1180
885
  ...output,
1181
886
  body: await parseBody(output.body, context),
1182
887
  };
1183
- let response;
1184
888
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1185
889
  switch (errorCode) {
1186
890
  case "AccessDeniedException":
@@ -1203,41 +907,35 @@ const deserializeAws_restJson1CreateComponentTypeCommandError = async (output, c
1203
907
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1204
908
  default:
1205
909
  const parsedBody = parsedOutput.body;
1206
- const $metadata = deserializeMetadata(output);
1207
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1208
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1209
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1210
- $fault: "client",
1211
- $metadata,
910
+ (0, smithy_client_1.throwDefaultError)({
911
+ output,
912
+ parsedBody,
913
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
914
+ errorCode,
1212
915
  });
1213
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1214
916
  }
1215
917
  };
1216
918
  const deserializeAws_restJson1CreateEntityCommand = async (output, context) => {
1217
919
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1218
920
  return deserializeAws_restJson1CreateEntityCommandError(output, context);
1219
921
  }
1220
- const contents = {
922
+ const contents = map({
1221
923
  $metadata: deserializeMetadata(output),
1222
- arn: undefined,
1223
- creationDateTime: undefined,
1224
- entityId: undefined,
1225
- state: undefined,
1226
- };
924
+ });
1227
925
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1228
- if (data.arn !== undefined && data.arn !== null) {
926
+ if (data.arn != null) {
1229
927
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1230
928
  }
1231
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
929
+ if (data.creationDateTime != null) {
1232
930
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1233
931
  }
1234
- if (data.entityId !== undefined && data.entityId !== null) {
932
+ if (data.entityId != null) {
1235
933
  contents.entityId = (0, smithy_client_1.expectString)(data.entityId);
1236
934
  }
1237
- if (data.state !== undefined && data.state !== null) {
935
+ if (data.state != null) {
1238
936
  contents.state = (0, smithy_client_1.expectString)(data.state);
1239
937
  }
1240
- return Promise.resolve(contents);
938
+ return contents;
1241
939
  };
1242
940
  exports.deserializeAws_restJson1CreateEntityCommand = deserializeAws_restJson1CreateEntityCommand;
1243
941
  const deserializeAws_restJson1CreateEntityCommandError = async (output, context) => {
@@ -1245,7 +943,6 @@ const deserializeAws_restJson1CreateEntityCommandError = async (output, context)
1245
943
  ...output,
1246
944
  body: await parseBody(output.body, context),
1247
945
  };
1248
- let response;
1249
946
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1250
947
  switch (errorCode) {
1251
948
  case "AccessDeniedException":
@@ -1268,33 +965,29 @@ const deserializeAws_restJson1CreateEntityCommandError = async (output, context)
1268
965
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1269
966
  default:
1270
967
  const parsedBody = parsedOutput.body;
1271
- const $metadata = deserializeMetadata(output);
1272
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1273
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1274
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1275
- $fault: "client",
1276
- $metadata,
968
+ (0, smithy_client_1.throwDefaultError)({
969
+ output,
970
+ parsedBody,
971
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
972
+ errorCode,
1277
973
  });
1278
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1279
974
  }
1280
975
  };
1281
976
  const deserializeAws_restJson1CreateSceneCommand = async (output, context) => {
1282
977
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1283
978
  return deserializeAws_restJson1CreateSceneCommandError(output, context);
1284
979
  }
1285
- const contents = {
980
+ const contents = map({
1286
981
  $metadata: deserializeMetadata(output),
1287
- arn: undefined,
1288
- creationDateTime: undefined,
1289
- };
982
+ });
1290
983
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1291
- if (data.arn !== undefined && data.arn !== null) {
984
+ if (data.arn != null) {
1292
985
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1293
986
  }
1294
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
987
+ if (data.creationDateTime != null) {
1295
988
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1296
989
  }
1297
- return Promise.resolve(contents);
990
+ return contents;
1298
991
  };
1299
992
  exports.deserializeAws_restJson1CreateSceneCommand = deserializeAws_restJson1CreateSceneCommand;
1300
993
  const deserializeAws_restJson1CreateSceneCommandError = async (output, context) => {
@@ -1302,7 +995,6 @@ const deserializeAws_restJson1CreateSceneCommandError = async (output, context)
1302
995
  ...output,
1303
996
  body: await parseBody(output.body, context),
1304
997
  };
1305
- let response;
1306
998
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1307
999
  switch (errorCode) {
1308
1000
  case "AccessDeniedException":
@@ -1325,33 +1017,29 @@ const deserializeAws_restJson1CreateSceneCommandError = async (output, context)
1325
1017
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1326
1018
  default:
1327
1019
  const parsedBody = parsedOutput.body;
1328
- const $metadata = deserializeMetadata(output);
1329
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1330
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1331
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1332
- $fault: "client",
1333
- $metadata,
1020
+ (0, smithy_client_1.throwDefaultError)({
1021
+ output,
1022
+ parsedBody,
1023
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1024
+ errorCode,
1334
1025
  });
1335
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1336
1026
  }
1337
1027
  };
1338
1028
  const deserializeAws_restJson1CreateWorkspaceCommand = async (output, context) => {
1339
1029
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1340
1030
  return deserializeAws_restJson1CreateWorkspaceCommandError(output, context);
1341
1031
  }
1342
- const contents = {
1032
+ const contents = map({
1343
1033
  $metadata: deserializeMetadata(output),
1344
- arn: undefined,
1345
- creationDateTime: undefined,
1346
- };
1034
+ });
1347
1035
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1348
- if (data.arn !== undefined && data.arn !== null) {
1036
+ if (data.arn != null) {
1349
1037
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1350
1038
  }
1351
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1039
+ if (data.creationDateTime != null) {
1352
1040
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1353
1041
  }
1354
- return Promise.resolve(contents);
1042
+ return contents;
1355
1043
  };
1356
1044
  exports.deserializeAws_restJson1CreateWorkspaceCommand = deserializeAws_restJson1CreateWorkspaceCommand;
1357
1045
  const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, context) => {
@@ -1359,7 +1047,6 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
1359
1047
  ...output,
1360
1048
  body: await parseBody(output.body, context),
1361
1049
  };
1362
- let response;
1363
1050
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1364
1051
  switch (errorCode) {
1365
1052
  case "AccessDeniedException":
@@ -1382,29 +1069,26 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
1382
1069
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1383
1070
  default:
1384
1071
  const parsedBody = parsedOutput.body;
1385
- const $metadata = deserializeMetadata(output);
1386
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1387
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1388
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1389
- $fault: "client",
1390
- $metadata,
1072
+ (0, smithy_client_1.throwDefaultError)({
1073
+ output,
1074
+ parsedBody,
1075
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1076
+ errorCode,
1391
1077
  });
1392
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1393
1078
  }
1394
1079
  };
1395
1080
  const deserializeAws_restJson1DeleteComponentTypeCommand = async (output, context) => {
1396
1081
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1397
1082
  return deserializeAws_restJson1DeleteComponentTypeCommandError(output, context);
1398
1083
  }
1399
- const contents = {
1084
+ const contents = map({
1400
1085
  $metadata: deserializeMetadata(output),
1401
- state: undefined,
1402
- };
1086
+ });
1403
1087
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1404
- if (data.state !== undefined && data.state !== null) {
1088
+ if (data.state != null) {
1405
1089
  contents.state = (0, smithy_client_1.expectString)(data.state);
1406
1090
  }
1407
- return Promise.resolve(contents);
1091
+ return contents;
1408
1092
  };
1409
1093
  exports.deserializeAws_restJson1DeleteComponentTypeCommand = deserializeAws_restJson1DeleteComponentTypeCommand;
1410
1094
  const deserializeAws_restJson1DeleteComponentTypeCommandError = async (output, context) => {
@@ -1412,7 +1096,6 @@ const deserializeAws_restJson1DeleteComponentTypeCommandError = async (output, c
1412
1096
  ...output,
1413
1097
  body: await parseBody(output.body, context),
1414
1098
  };
1415
- let response;
1416
1099
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1417
1100
  switch (errorCode) {
1418
1101
  case "AccessDeniedException":
@@ -1432,29 +1115,26 @@ const deserializeAws_restJson1DeleteComponentTypeCommandError = async (output, c
1432
1115
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1433
1116
  default:
1434
1117
  const parsedBody = parsedOutput.body;
1435
- const $metadata = deserializeMetadata(output);
1436
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1437
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1438
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1439
- $fault: "client",
1440
- $metadata,
1118
+ (0, smithy_client_1.throwDefaultError)({
1119
+ output,
1120
+ parsedBody,
1121
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1122
+ errorCode,
1441
1123
  });
1442
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1443
1124
  }
1444
1125
  };
1445
1126
  const deserializeAws_restJson1DeleteEntityCommand = async (output, context) => {
1446
1127
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1447
1128
  return deserializeAws_restJson1DeleteEntityCommandError(output, context);
1448
1129
  }
1449
- const contents = {
1130
+ const contents = map({
1450
1131
  $metadata: deserializeMetadata(output),
1451
- state: undefined,
1452
- };
1132
+ });
1453
1133
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1454
- if (data.state !== undefined && data.state !== null) {
1134
+ if (data.state != null) {
1455
1135
  contents.state = (0, smithy_client_1.expectString)(data.state);
1456
1136
  }
1457
- return Promise.resolve(contents);
1137
+ return contents;
1458
1138
  };
1459
1139
  exports.deserializeAws_restJson1DeleteEntityCommand = deserializeAws_restJson1DeleteEntityCommand;
1460
1140
  const deserializeAws_restJson1DeleteEntityCommandError = async (output, context) => {
@@ -1462,7 +1142,6 @@ const deserializeAws_restJson1DeleteEntityCommandError = async (output, context)
1462
1142
  ...output,
1463
1143
  body: await parseBody(output.body, context),
1464
1144
  };
1465
- let response;
1466
1145
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1467
1146
  switch (errorCode) {
1468
1147
  case "InternalServerException":
@@ -1482,25 +1161,23 @@ const deserializeAws_restJson1DeleteEntityCommandError = async (output, context)
1482
1161
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1483
1162
  default:
1484
1163
  const parsedBody = parsedOutput.body;
1485
- const $metadata = deserializeMetadata(output);
1486
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1487
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1488
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1489
- $fault: "client",
1490
- $metadata,
1164
+ (0, smithy_client_1.throwDefaultError)({
1165
+ output,
1166
+ parsedBody,
1167
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1168
+ errorCode,
1491
1169
  });
1492
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1493
1170
  }
1494
1171
  };
1495
1172
  const deserializeAws_restJson1DeleteSceneCommand = async (output, context) => {
1496
1173
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1497
1174
  return deserializeAws_restJson1DeleteSceneCommandError(output, context);
1498
1175
  }
1499
- const contents = {
1176
+ const contents = map({
1500
1177
  $metadata: deserializeMetadata(output),
1501
- };
1178
+ });
1502
1179
  await collectBody(output.body, context);
1503
- return Promise.resolve(contents);
1180
+ return contents;
1504
1181
  };
1505
1182
  exports.deserializeAws_restJson1DeleteSceneCommand = deserializeAws_restJson1DeleteSceneCommand;
1506
1183
  const deserializeAws_restJson1DeleteSceneCommandError = async (output, context) => {
@@ -1508,7 +1185,6 @@ const deserializeAws_restJson1DeleteSceneCommandError = async (output, context)
1508
1185
  ...output,
1509
1186
  body: await parseBody(output.body, context),
1510
1187
  };
1511
- let response;
1512
1188
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
1189
  switch (errorCode) {
1514
1190
  case "AccessDeniedException":
@@ -1528,25 +1204,23 @@ const deserializeAws_restJson1DeleteSceneCommandError = async (output, context)
1528
1204
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1529
1205
  default:
1530
1206
  const parsedBody = parsedOutput.body;
1531
- const $metadata = deserializeMetadata(output);
1532
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1533
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1534
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1535
- $fault: "client",
1536
- $metadata,
1207
+ (0, smithy_client_1.throwDefaultError)({
1208
+ output,
1209
+ parsedBody,
1210
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1211
+ errorCode,
1537
1212
  });
1538
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1539
1213
  }
1540
1214
  };
1541
1215
  const deserializeAws_restJson1DeleteWorkspaceCommand = async (output, context) => {
1542
1216
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1543
1217
  return deserializeAws_restJson1DeleteWorkspaceCommandError(output, context);
1544
1218
  }
1545
- const contents = {
1219
+ const contents = map({
1546
1220
  $metadata: deserializeMetadata(output),
1547
- };
1221
+ });
1548
1222
  await collectBody(output.body, context);
1549
- return Promise.resolve(contents);
1223
+ return contents;
1550
1224
  };
1551
1225
  exports.deserializeAws_restJson1DeleteWorkspaceCommand = deserializeAws_restJson1DeleteWorkspaceCommand;
1552
1226
  const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, context) => {
@@ -1554,7 +1228,6 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
1554
1228
  ...output,
1555
1229
  body: await parseBody(output.body, context),
1556
1230
  };
1557
- let response;
1558
1231
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1559
1232
  switch (errorCode) {
1560
1233
  case "AccessDeniedException":
@@ -1574,77 +1247,62 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
1574
1247
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1575
1248
  default:
1576
1249
  const parsedBody = parsedOutput.body;
1577
- const $metadata = deserializeMetadata(output);
1578
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1579
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1580
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1581
- $fault: "client",
1582
- $metadata,
1250
+ (0, smithy_client_1.throwDefaultError)({
1251
+ output,
1252
+ parsedBody,
1253
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1254
+ errorCode,
1583
1255
  });
1584
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1585
1256
  }
1586
1257
  };
1587
1258
  const deserializeAws_restJson1GetComponentTypeCommand = async (output, context) => {
1588
1259
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1589
1260
  return deserializeAws_restJson1GetComponentTypeCommandError(output, context);
1590
1261
  }
1591
- const contents = {
1262
+ const contents = map({
1592
1263
  $metadata: deserializeMetadata(output),
1593
- arn: undefined,
1594
- componentTypeId: undefined,
1595
- creationDateTime: undefined,
1596
- description: undefined,
1597
- extendsFrom: undefined,
1598
- functions: undefined,
1599
- isAbstract: undefined,
1600
- isSchemaInitialized: undefined,
1601
- isSingleton: undefined,
1602
- propertyDefinitions: undefined,
1603
- status: undefined,
1604
- updateDateTime: undefined,
1605
- workspaceId: undefined,
1606
- };
1264
+ });
1607
1265
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1608
- if (data.arn !== undefined && data.arn !== null) {
1266
+ if (data.arn != null) {
1609
1267
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1610
1268
  }
1611
- if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
1269
+ if (data.componentTypeId != null) {
1612
1270
  contents.componentTypeId = (0, smithy_client_1.expectString)(data.componentTypeId);
1613
1271
  }
1614
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1272
+ if (data.creationDateTime != null) {
1615
1273
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1616
1274
  }
1617
- if (data.description !== undefined && data.description !== null) {
1275
+ if (data.description != null) {
1618
1276
  contents.description = (0, smithy_client_1.expectString)(data.description);
1619
1277
  }
1620
- if (data.extendsFrom !== undefined && data.extendsFrom !== null) {
1278
+ if (data.extendsFrom != null) {
1621
1279
  contents.extendsFrom = deserializeAws_restJson1ExtendsFrom(data.extendsFrom, context);
1622
1280
  }
1623
- if (data.functions !== undefined && data.functions !== null) {
1281
+ if (data.functions != null) {
1624
1282
  contents.functions = deserializeAws_restJson1FunctionsResponse(data.functions, context);
1625
1283
  }
1626
- if (data.isAbstract !== undefined && data.isAbstract !== null) {
1284
+ if (data.isAbstract != null) {
1627
1285
  contents.isAbstract = (0, smithy_client_1.expectBoolean)(data.isAbstract);
1628
1286
  }
1629
- if (data.isSchemaInitialized !== undefined && data.isSchemaInitialized !== null) {
1287
+ if (data.isSchemaInitialized != null) {
1630
1288
  contents.isSchemaInitialized = (0, smithy_client_1.expectBoolean)(data.isSchemaInitialized);
1631
1289
  }
1632
- if (data.isSingleton !== undefined && data.isSingleton !== null) {
1290
+ if (data.isSingleton != null) {
1633
1291
  contents.isSingleton = (0, smithy_client_1.expectBoolean)(data.isSingleton);
1634
1292
  }
1635
- if (data.propertyDefinitions !== undefined && data.propertyDefinitions !== null) {
1293
+ if (data.propertyDefinitions != null) {
1636
1294
  contents.propertyDefinitions = deserializeAws_restJson1PropertyDefinitionsResponse(data.propertyDefinitions, context);
1637
1295
  }
1638
- if (data.status !== undefined && data.status !== null) {
1296
+ if (data.status != null) {
1639
1297
  contents.status = deserializeAws_restJson1Status(data.status, context);
1640
1298
  }
1641
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1299
+ if (data.updateDateTime != null) {
1642
1300
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
1643
1301
  }
1644
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1302
+ if (data.workspaceId != null) {
1645
1303
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
1646
1304
  }
1647
- return Promise.resolve(contents);
1305
+ return contents;
1648
1306
  };
1649
1307
  exports.deserializeAws_restJson1GetComponentTypeCommand = deserializeAws_restJson1GetComponentTypeCommand;
1650
1308
  const deserializeAws_restJson1GetComponentTypeCommandError = async (output, context) => {
@@ -1652,7 +1310,6 @@ const deserializeAws_restJson1GetComponentTypeCommandError = async (output, cont
1652
1310
  ...output,
1653
1311
  body: await parseBody(output.body, context),
1654
1312
  };
1655
- let response;
1656
1313
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1657
1314
  switch (errorCode) {
1658
1315
  case "AccessDeniedException":
@@ -1669,69 +1326,56 @@ const deserializeAws_restJson1GetComponentTypeCommandError = async (output, cont
1669
1326
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1670
1327
  default:
1671
1328
  const parsedBody = parsedOutput.body;
1672
- const $metadata = deserializeMetadata(output);
1673
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1674
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1675
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1676
- $fault: "client",
1677
- $metadata,
1329
+ (0, smithy_client_1.throwDefaultError)({
1330
+ output,
1331
+ parsedBody,
1332
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1333
+ errorCode,
1678
1334
  });
1679
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1680
1335
  }
1681
1336
  };
1682
1337
  const deserializeAws_restJson1GetEntityCommand = async (output, context) => {
1683
1338
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1684
1339
  return deserializeAws_restJson1GetEntityCommandError(output, context);
1685
1340
  }
1686
- const contents = {
1341
+ const contents = map({
1687
1342
  $metadata: deserializeMetadata(output),
1688
- arn: undefined,
1689
- components: undefined,
1690
- creationDateTime: undefined,
1691
- description: undefined,
1692
- entityId: undefined,
1693
- entityName: undefined,
1694
- hasChildEntities: undefined,
1695
- parentEntityId: undefined,
1696
- status: undefined,
1697
- updateDateTime: undefined,
1698
- workspaceId: undefined,
1699
- };
1343
+ });
1700
1344
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1701
- if (data.arn !== undefined && data.arn !== null) {
1345
+ if (data.arn != null) {
1702
1346
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1703
1347
  }
1704
- if (data.components !== undefined && data.components !== null) {
1348
+ if (data.components != null) {
1705
1349
  contents.components = deserializeAws_restJson1ComponentsMap(data.components, context);
1706
1350
  }
1707
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1351
+ if (data.creationDateTime != null) {
1708
1352
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1709
1353
  }
1710
- if (data.description !== undefined && data.description !== null) {
1354
+ if (data.description != null) {
1711
1355
  contents.description = (0, smithy_client_1.expectString)(data.description);
1712
1356
  }
1713
- if (data.entityId !== undefined && data.entityId !== null) {
1357
+ if (data.entityId != null) {
1714
1358
  contents.entityId = (0, smithy_client_1.expectString)(data.entityId);
1715
1359
  }
1716
- if (data.entityName !== undefined && data.entityName !== null) {
1360
+ if (data.entityName != null) {
1717
1361
  contents.entityName = (0, smithy_client_1.expectString)(data.entityName);
1718
1362
  }
1719
- if (data.hasChildEntities !== undefined && data.hasChildEntities !== null) {
1363
+ if (data.hasChildEntities != null) {
1720
1364
  contents.hasChildEntities = (0, smithy_client_1.expectBoolean)(data.hasChildEntities);
1721
1365
  }
1722
- if (data.parentEntityId !== undefined && data.parentEntityId !== null) {
1366
+ if (data.parentEntityId != null) {
1723
1367
  contents.parentEntityId = (0, smithy_client_1.expectString)(data.parentEntityId);
1724
1368
  }
1725
- if (data.status !== undefined && data.status !== null) {
1369
+ if (data.status != null) {
1726
1370
  contents.status = deserializeAws_restJson1Status(data.status, context);
1727
1371
  }
1728
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1372
+ if (data.updateDateTime != null) {
1729
1373
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
1730
1374
  }
1731
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1375
+ if (data.workspaceId != null) {
1732
1376
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
1733
1377
  }
1734
- return Promise.resolve(contents);
1378
+ return contents;
1735
1379
  };
1736
1380
  exports.deserializeAws_restJson1GetEntityCommand = deserializeAws_restJson1GetEntityCommand;
1737
1381
  const deserializeAws_restJson1GetEntityCommandError = async (output, context) => {
@@ -1739,7 +1383,6 @@ const deserializeAws_restJson1GetEntityCommandError = async (output, context) =>
1739
1383
  ...output,
1740
1384
  body: await parseBody(output.body, context),
1741
1385
  };
1742
- let response;
1743
1386
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1744
1387
  switch (errorCode) {
1745
1388
  case "InternalServerException":
@@ -1759,29 +1402,26 @@ const deserializeAws_restJson1GetEntityCommandError = async (output, context) =>
1759
1402
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1760
1403
  default:
1761
1404
  const parsedBody = parsedOutput.body;
1762
- const $metadata = deserializeMetadata(output);
1763
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1764
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1765
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1766
- $fault: "client",
1767
- $metadata,
1405
+ (0, smithy_client_1.throwDefaultError)({
1406
+ output,
1407
+ parsedBody,
1408
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1409
+ errorCode,
1768
1410
  });
1769
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1770
1411
  }
1771
1412
  };
1772
1413
  const deserializeAws_restJson1GetPropertyValueCommand = async (output, context) => {
1773
1414
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1774
1415
  return deserializeAws_restJson1GetPropertyValueCommandError(output, context);
1775
1416
  }
1776
- const contents = {
1417
+ const contents = map({
1777
1418
  $metadata: deserializeMetadata(output),
1778
- propertyValues: undefined,
1779
- };
1419
+ });
1780
1420
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1781
- if (data.propertyValues !== undefined && data.propertyValues !== null) {
1421
+ if (data.propertyValues != null) {
1782
1422
  contents.propertyValues = deserializeAws_restJson1PropertyLatestValueMap(data.propertyValues, context);
1783
1423
  }
1784
- return Promise.resolve(contents);
1424
+ return contents;
1785
1425
  };
1786
1426
  exports.deserializeAws_restJson1GetPropertyValueCommand = deserializeAws_restJson1GetPropertyValueCommand;
1787
1427
  const deserializeAws_restJson1GetPropertyValueCommandError = async (output, context) => {
@@ -1789,7 +1429,6 @@ const deserializeAws_restJson1GetPropertyValueCommandError = async (output, cont
1789
1429
  ...output,
1790
1430
  body: await parseBody(output.body, context),
1791
1431
  };
1792
- let response;
1793
1432
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1794
1433
  switch (errorCode) {
1795
1434
  case "AccessDeniedException":
@@ -1815,33 +1454,29 @@ const deserializeAws_restJson1GetPropertyValueCommandError = async (output, cont
1815
1454
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1816
1455
  default:
1817
1456
  const parsedBody = parsedOutput.body;
1818
- const $metadata = deserializeMetadata(output);
1819
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1820
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1821
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1822
- $fault: "client",
1823
- $metadata,
1457
+ (0, smithy_client_1.throwDefaultError)({
1458
+ output,
1459
+ parsedBody,
1460
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1461
+ errorCode,
1824
1462
  });
1825
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1826
1463
  }
1827
1464
  };
1828
1465
  const deserializeAws_restJson1GetPropertyValueHistoryCommand = async (output, context) => {
1829
1466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1830
1467
  return deserializeAws_restJson1GetPropertyValueHistoryCommandError(output, context);
1831
1468
  }
1832
- const contents = {
1469
+ const contents = map({
1833
1470
  $metadata: deserializeMetadata(output),
1834
- nextToken: undefined,
1835
- propertyValues: undefined,
1836
- };
1471
+ });
1837
1472
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1838
- if (data.nextToken !== undefined && data.nextToken !== null) {
1473
+ if (data.nextToken != null) {
1839
1474
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1840
1475
  }
1841
- if (data.propertyValues !== undefined && data.propertyValues !== null) {
1476
+ if (data.propertyValues != null) {
1842
1477
  contents.propertyValues = deserializeAws_restJson1PropertyValueList(data.propertyValues, context);
1843
1478
  }
1844
- return Promise.resolve(contents);
1479
+ return contents;
1845
1480
  };
1846
1481
  exports.deserializeAws_restJson1GetPropertyValueHistoryCommand = deserializeAws_restJson1GetPropertyValueHistoryCommand;
1847
1482
  const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async (output, context) => {
@@ -1849,7 +1484,6 @@ const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async (outpu
1849
1484
  ...output,
1850
1485
  body: await parseBody(output.body, context),
1851
1486
  };
1852
- let response;
1853
1487
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1854
1488
  switch (errorCode) {
1855
1489
  case "AccessDeniedException":
@@ -1875,57 +1509,47 @@ const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async (outpu
1875
1509
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1876
1510
  default:
1877
1511
  const parsedBody = parsedOutput.body;
1878
- const $metadata = deserializeMetadata(output);
1879
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1880
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1881
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1882
- $fault: "client",
1883
- $metadata,
1512
+ (0, smithy_client_1.throwDefaultError)({
1513
+ output,
1514
+ parsedBody,
1515
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1516
+ errorCode,
1884
1517
  });
1885
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1886
1518
  }
1887
1519
  };
1888
1520
  const deserializeAws_restJson1GetSceneCommand = async (output, context) => {
1889
1521
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1890
1522
  return deserializeAws_restJson1GetSceneCommandError(output, context);
1891
1523
  }
1892
- const contents = {
1524
+ const contents = map({
1893
1525
  $metadata: deserializeMetadata(output),
1894
- arn: undefined,
1895
- capabilities: undefined,
1896
- contentLocation: undefined,
1897
- creationDateTime: undefined,
1898
- description: undefined,
1899
- sceneId: undefined,
1900
- updateDateTime: undefined,
1901
- workspaceId: undefined,
1902
- };
1526
+ });
1903
1527
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1904
- if (data.arn !== undefined && data.arn !== null) {
1528
+ if (data.arn != null) {
1905
1529
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1906
1530
  }
1907
- if (data.capabilities !== undefined && data.capabilities !== null) {
1531
+ if (data.capabilities != null) {
1908
1532
  contents.capabilities = deserializeAws_restJson1SceneCapabilities(data.capabilities, context);
1909
1533
  }
1910
- if (data.contentLocation !== undefined && data.contentLocation !== null) {
1534
+ if (data.contentLocation != null) {
1911
1535
  contents.contentLocation = (0, smithy_client_1.expectString)(data.contentLocation);
1912
1536
  }
1913
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1537
+ if (data.creationDateTime != null) {
1914
1538
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1915
1539
  }
1916
- if (data.description !== undefined && data.description !== null) {
1540
+ if (data.description != null) {
1917
1541
  contents.description = (0, smithy_client_1.expectString)(data.description);
1918
1542
  }
1919
- if (data.sceneId !== undefined && data.sceneId !== null) {
1543
+ if (data.sceneId != null) {
1920
1544
  contents.sceneId = (0, smithy_client_1.expectString)(data.sceneId);
1921
1545
  }
1922
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1546
+ if (data.updateDateTime != null) {
1923
1547
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
1924
1548
  }
1925
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1549
+ if (data.workspaceId != null) {
1926
1550
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
1927
1551
  }
1928
- return Promise.resolve(contents);
1552
+ return contents;
1929
1553
  };
1930
1554
  exports.deserializeAws_restJson1GetSceneCommand = deserializeAws_restJson1GetSceneCommand;
1931
1555
  const deserializeAws_restJson1GetSceneCommandError = async (output, context) => {
@@ -1933,7 +1557,6 @@ const deserializeAws_restJson1GetSceneCommandError = async (output, context) =>
1933
1557
  ...output,
1934
1558
  body: await parseBody(output.body, context),
1935
1559
  };
1936
- let response;
1937
1560
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1938
1561
  switch (errorCode) {
1939
1562
  case "AccessDeniedException":
@@ -1953,53 +1576,44 @@ const deserializeAws_restJson1GetSceneCommandError = async (output, context) =>
1953
1576
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1954
1577
  default:
1955
1578
  const parsedBody = parsedOutput.body;
1956
- const $metadata = deserializeMetadata(output);
1957
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1958
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1959
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1960
- $fault: "client",
1961
- $metadata,
1579
+ (0, smithy_client_1.throwDefaultError)({
1580
+ output,
1581
+ parsedBody,
1582
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1583
+ errorCode,
1962
1584
  });
1963
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1964
1585
  }
1965
1586
  };
1966
1587
  const deserializeAws_restJson1GetWorkspaceCommand = async (output, context) => {
1967
1588
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1968
1589
  return deserializeAws_restJson1GetWorkspaceCommandError(output, context);
1969
1590
  }
1970
- const contents = {
1591
+ const contents = map({
1971
1592
  $metadata: deserializeMetadata(output),
1972
- arn: undefined,
1973
- creationDateTime: undefined,
1974
- description: undefined,
1975
- role: undefined,
1976
- s3Location: undefined,
1977
- updateDateTime: undefined,
1978
- workspaceId: undefined,
1979
- };
1593
+ });
1980
1594
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1981
- if (data.arn !== undefined && data.arn !== null) {
1595
+ if (data.arn != null) {
1982
1596
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1983
1597
  }
1984
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1598
+ if (data.creationDateTime != null) {
1985
1599
  contents.creationDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationDateTime)));
1986
1600
  }
1987
- if (data.description !== undefined && data.description !== null) {
1601
+ if (data.description != null) {
1988
1602
  contents.description = (0, smithy_client_1.expectString)(data.description);
1989
1603
  }
1990
- if (data.role !== undefined && data.role !== null) {
1604
+ if (data.role != null) {
1991
1605
  contents.role = (0, smithy_client_1.expectString)(data.role);
1992
1606
  }
1993
- if (data.s3Location !== undefined && data.s3Location !== null) {
1607
+ if (data.s3Location != null) {
1994
1608
  contents.s3Location = (0, smithy_client_1.expectString)(data.s3Location);
1995
1609
  }
1996
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1610
+ if (data.updateDateTime != null) {
1997
1611
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
1998
1612
  }
1999
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1613
+ if (data.workspaceId != null) {
2000
1614
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
2001
1615
  }
2002
- return Promise.resolve(contents);
1616
+ return contents;
2003
1617
  };
2004
1618
  exports.deserializeAws_restJson1GetWorkspaceCommand = deserializeAws_restJson1GetWorkspaceCommand;
2005
1619
  const deserializeAws_restJson1GetWorkspaceCommandError = async (output, context) => {
@@ -2007,7 +1621,6 @@ const deserializeAws_restJson1GetWorkspaceCommandError = async (output, context)
2007
1621
  ...output,
2008
1622
  body: await parseBody(output.body, context),
2009
1623
  };
2010
- let response;
2011
1624
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2012
1625
  switch (errorCode) {
2013
1626
  case "InternalServerException":
@@ -2027,41 +1640,35 @@ const deserializeAws_restJson1GetWorkspaceCommandError = async (output, context)
2027
1640
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2028
1641
  default:
2029
1642
  const parsedBody = parsedOutput.body;
2030
- const $metadata = deserializeMetadata(output);
2031
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2032
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2033
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2034
- $fault: "client",
2035
- $metadata,
1643
+ (0, smithy_client_1.throwDefaultError)({
1644
+ output,
1645
+ parsedBody,
1646
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1647
+ errorCode,
2036
1648
  });
2037
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2038
1649
  }
2039
1650
  };
2040
1651
  const deserializeAws_restJson1ListComponentTypesCommand = async (output, context) => {
2041
1652
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2042
1653
  return deserializeAws_restJson1ListComponentTypesCommandError(output, context);
2043
1654
  }
2044
- const contents = {
1655
+ const contents = map({
2045
1656
  $metadata: deserializeMetadata(output),
2046
- componentTypeSummaries: undefined,
2047
- maxResults: undefined,
2048
- nextToken: undefined,
2049
- workspaceId: undefined,
2050
- };
1657
+ });
2051
1658
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2052
- if (data.componentTypeSummaries !== undefined && data.componentTypeSummaries !== null) {
1659
+ if (data.componentTypeSummaries != null) {
2053
1660
  contents.componentTypeSummaries = deserializeAws_restJson1ComponentTypeSummaries(data.componentTypeSummaries, context);
2054
1661
  }
2055
- if (data.maxResults !== undefined && data.maxResults !== null) {
1662
+ if (data.maxResults != null) {
2056
1663
  contents.maxResults = (0, smithy_client_1.expectInt32)(data.maxResults);
2057
1664
  }
2058
- if (data.nextToken !== undefined && data.nextToken !== null) {
1665
+ if (data.nextToken != null) {
2059
1666
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2060
1667
  }
2061
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1668
+ if (data.workspaceId != null) {
2062
1669
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
2063
1670
  }
2064
- return Promise.resolve(contents);
1671
+ return contents;
2065
1672
  };
2066
1673
  exports.deserializeAws_restJson1ListComponentTypesCommand = deserializeAws_restJson1ListComponentTypesCommand;
2067
1674
  const deserializeAws_restJson1ListComponentTypesCommandError = async (output, context) => {
@@ -2069,7 +1676,6 @@ const deserializeAws_restJson1ListComponentTypesCommandError = async (output, co
2069
1676
  ...output,
2070
1677
  body: await parseBody(output.body, context),
2071
1678
  };
2072
- let response;
2073
1679
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2074
1680
  switch (errorCode) {
2075
1681
  case "AccessDeniedException":
@@ -2086,33 +1692,29 @@ const deserializeAws_restJson1ListComponentTypesCommandError = async (output, co
2086
1692
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2087
1693
  default:
2088
1694
  const parsedBody = parsedOutput.body;
2089
- const $metadata = deserializeMetadata(output);
2090
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2091
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2092
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2093
- $fault: "client",
2094
- $metadata,
1695
+ (0, smithy_client_1.throwDefaultError)({
1696
+ output,
1697
+ parsedBody,
1698
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1699
+ errorCode,
2095
1700
  });
2096
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2097
1701
  }
2098
1702
  };
2099
1703
  const deserializeAws_restJson1ListEntitiesCommand = async (output, context) => {
2100
1704
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2101
1705
  return deserializeAws_restJson1ListEntitiesCommandError(output, context);
2102
1706
  }
2103
- const contents = {
1707
+ const contents = map({
2104
1708
  $metadata: deserializeMetadata(output),
2105
- entitySummaries: undefined,
2106
- nextToken: undefined,
2107
- };
1709
+ });
2108
1710
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2109
- if (data.entitySummaries !== undefined && data.entitySummaries !== null) {
1711
+ if (data.entitySummaries != null) {
2110
1712
  contents.entitySummaries = deserializeAws_restJson1EntitySummaries(data.entitySummaries, context);
2111
1713
  }
2112
- if (data.nextToken !== undefined && data.nextToken !== null) {
1714
+ if (data.nextToken != null) {
2113
1715
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2114
1716
  }
2115
- return Promise.resolve(contents);
1717
+ return contents;
2116
1718
  };
2117
1719
  exports.deserializeAws_restJson1ListEntitiesCommand = deserializeAws_restJson1ListEntitiesCommand;
2118
1720
  const deserializeAws_restJson1ListEntitiesCommandError = async (output, context) => {
@@ -2120,7 +1722,6 @@ const deserializeAws_restJson1ListEntitiesCommandError = async (output, context)
2120
1722
  ...output,
2121
1723
  body: await parseBody(output.body, context),
2122
1724
  };
2123
- let response;
2124
1725
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2125
1726
  switch (errorCode) {
2126
1727
  case "InternalServerException":
@@ -2137,33 +1738,29 @@ const deserializeAws_restJson1ListEntitiesCommandError = async (output, context)
2137
1738
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2138
1739
  default:
2139
1740
  const parsedBody = parsedOutput.body;
2140
- const $metadata = deserializeMetadata(output);
2141
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2142
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2143
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2144
- $fault: "client",
2145
- $metadata,
1741
+ (0, smithy_client_1.throwDefaultError)({
1742
+ output,
1743
+ parsedBody,
1744
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1745
+ errorCode,
2146
1746
  });
2147
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2148
1747
  }
2149
1748
  };
2150
1749
  const deserializeAws_restJson1ListScenesCommand = async (output, context) => {
2151
1750
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2152
1751
  return deserializeAws_restJson1ListScenesCommandError(output, context);
2153
1752
  }
2154
- const contents = {
1753
+ const contents = map({
2155
1754
  $metadata: deserializeMetadata(output),
2156
- nextToken: undefined,
2157
- sceneSummaries: undefined,
2158
- };
1755
+ });
2159
1756
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2160
- if (data.nextToken !== undefined && data.nextToken !== null) {
1757
+ if (data.nextToken != null) {
2161
1758
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2162
1759
  }
2163
- if (data.sceneSummaries !== undefined && data.sceneSummaries !== null) {
1760
+ if (data.sceneSummaries != null) {
2164
1761
  contents.sceneSummaries = deserializeAws_restJson1SceneSummaries(data.sceneSummaries, context);
2165
1762
  }
2166
- return Promise.resolve(contents);
1763
+ return contents;
2167
1764
  };
2168
1765
  exports.deserializeAws_restJson1ListScenesCommand = deserializeAws_restJson1ListScenesCommand;
2169
1766
  const deserializeAws_restJson1ListScenesCommandError = async (output, context) => {
@@ -2171,7 +1768,6 @@ const deserializeAws_restJson1ListScenesCommandError = async (output, context) =
2171
1768
  ...output,
2172
1769
  body: await parseBody(output.body, context),
2173
1770
  };
2174
- let response;
2175
1771
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2176
1772
  switch (errorCode) {
2177
1773
  case "AccessDeniedException":
@@ -2188,33 +1784,29 @@ const deserializeAws_restJson1ListScenesCommandError = async (output, context) =
2188
1784
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2189
1785
  default:
2190
1786
  const parsedBody = parsedOutput.body;
2191
- const $metadata = deserializeMetadata(output);
2192
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2193
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2194
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2195
- $fault: "client",
2196
- $metadata,
1787
+ (0, smithy_client_1.throwDefaultError)({
1788
+ output,
1789
+ parsedBody,
1790
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1791
+ errorCode,
2197
1792
  });
2198
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2199
1793
  }
2200
1794
  };
2201
1795
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2202
1796
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2203
1797
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2204
1798
  }
2205
- const contents = {
1799
+ const contents = map({
2206
1800
  $metadata: deserializeMetadata(output),
2207
- nextToken: undefined,
2208
- tags: undefined,
2209
- };
1801
+ });
2210
1802
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2211
- if (data.nextToken !== undefined && data.nextToken !== null) {
1803
+ if (data.nextToken != null) {
2212
1804
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2213
1805
  }
2214
- if (data.tags !== undefined && data.tags !== null) {
1806
+ if (data.tags != null) {
2215
1807
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
2216
1808
  }
2217
- return Promise.resolve(contents);
1809
+ return contents;
2218
1810
  };
2219
1811
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2220
1812
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -2222,7 +1814,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2222
1814
  ...output,
2223
1815
  body: await parseBody(output.body, context),
2224
1816
  };
2225
- let response;
2226
1817
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2227
1818
  switch (errorCode) {
2228
1819
  case "AccessDeniedException":
@@ -2233,33 +1824,29 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2233
1824
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2234
1825
  default:
2235
1826
  const parsedBody = parsedOutput.body;
2236
- const $metadata = deserializeMetadata(output);
2237
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2238
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2239
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2240
- $fault: "client",
2241
- $metadata,
1827
+ (0, smithy_client_1.throwDefaultError)({
1828
+ output,
1829
+ parsedBody,
1830
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1831
+ errorCode,
2242
1832
  });
2243
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2244
1833
  }
2245
1834
  };
2246
1835
  const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
2247
1836
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2248
1837
  return deserializeAws_restJson1ListWorkspacesCommandError(output, context);
2249
1838
  }
2250
- const contents = {
1839
+ const contents = map({
2251
1840
  $metadata: deserializeMetadata(output),
2252
- nextToken: undefined,
2253
- workspaceSummaries: undefined,
2254
- };
1841
+ });
2255
1842
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2256
- if (data.nextToken !== undefined && data.nextToken !== null) {
1843
+ if (data.nextToken != null) {
2257
1844
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2258
1845
  }
2259
- if (data.workspaceSummaries !== undefined && data.workspaceSummaries !== null) {
1846
+ if (data.workspaceSummaries != null) {
2260
1847
  contents.workspaceSummaries = deserializeAws_restJson1WorkspaceSummaries(data.workspaceSummaries, context);
2261
1848
  }
2262
- return Promise.resolve(contents);
1849
+ return contents;
2263
1850
  };
2264
1851
  exports.deserializeAws_restJson1ListWorkspacesCommand = deserializeAws_restJson1ListWorkspacesCommand;
2265
1852
  const deserializeAws_restJson1ListWorkspacesCommandError = async (output, context) => {
@@ -2267,7 +1854,6 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
2267
1854
  ...output,
2268
1855
  body: await parseBody(output.body, context),
2269
1856
  };
2270
- let response;
2271
1857
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2272
1858
  switch (errorCode) {
2273
1859
  case "InternalServerException":
@@ -2284,25 +1870,23 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
2284
1870
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2285
1871
  default:
2286
1872
  const parsedBody = parsedOutput.body;
2287
- const $metadata = deserializeMetadata(output);
2288
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2289
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2290
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2291
- $fault: "client",
2292
- $metadata,
1873
+ (0, smithy_client_1.throwDefaultError)({
1874
+ output,
1875
+ parsedBody,
1876
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1877
+ errorCode,
2293
1878
  });
2294
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2295
1879
  }
2296
1880
  };
2297
1881
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2298
1882
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2299
1883
  return deserializeAws_restJson1TagResourceCommandError(output, context);
2300
1884
  }
2301
- const contents = {
1885
+ const contents = map({
2302
1886
  $metadata: deserializeMetadata(output),
2303
- };
1887
+ });
2304
1888
  await collectBody(output.body, context);
2305
- return Promise.resolve(contents);
1889
+ return contents;
2306
1890
  };
2307
1891
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2308
1892
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -2310,7 +1894,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2310
1894
  ...output,
2311
1895
  body: await parseBody(output.body, context),
2312
1896
  };
2313
- let response;
2314
1897
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2315
1898
  switch (errorCode) {
2316
1899
  case "AccessDeniedException":
@@ -2324,25 +1907,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2324
1907
  throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
2325
1908
  default:
2326
1909
  const parsedBody = parsedOutput.body;
2327
- const $metadata = deserializeMetadata(output);
2328
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2329
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2330
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2331
- $fault: "client",
2332
- $metadata,
1910
+ (0, smithy_client_1.throwDefaultError)({
1911
+ output,
1912
+ parsedBody,
1913
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1914
+ errorCode,
2333
1915
  });
2334
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2335
1916
  }
2336
1917
  };
2337
1918
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2338
1919
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2339
1920
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2340
1921
  }
2341
- const contents = {
1922
+ const contents = map({
2342
1923
  $metadata: deserializeMetadata(output),
2343
- };
1924
+ });
2344
1925
  await collectBody(output.body, context);
2345
- return Promise.resolve(contents);
1926
+ return contents;
2346
1927
  };
2347
1928
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2348
1929
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2350,7 +1931,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2350
1931
  ...output,
2351
1932
  body: await parseBody(output.body, context),
2352
1933
  };
2353
- let response;
2354
1934
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2355
1935
  switch (errorCode) {
2356
1936
  case "AccessDeniedException":
@@ -2361,41 +1941,35 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2361
1941
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2362
1942
  default:
2363
1943
  const parsedBody = parsedOutput.body;
2364
- const $metadata = deserializeMetadata(output);
2365
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2366
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2367
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2368
- $fault: "client",
2369
- $metadata,
1944
+ (0, smithy_client_1.throwDefaultError)({
1945
+ output,
1946
+ parsedBody,
1947
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
1948
+ errorCode,
2370
1949
  });
2371
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2372
1950
  }
2373
1951
  };
2374
1952
  const deserializeAws_restJson1UpdateComponentTypeCommand = async (output, context) => {
2375
1953
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2376
1954
  return deserializeAws_restJson1UpdateComponentTypeCommandError(output, context);
2377
1955
  }
2378
- const contents = {
1956
+ const contents = map({
2379
1957
  $metadata: deserializeMetadata(output),
2380
- arn: undefined,
2381
- componentTypeId: undefined,
2382
- state: undefined,
2383
- workspaceId: undefined,
2384
- };
1958
+ });
2385
1959
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2386
- if (data.arn !== undefined && data.arn !== null) {
1960
+ if (data.arn != null) {
2387
1961
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2388
1962
  }
2389
- if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
1963
+ if (data.componentTypeId != null) {
2390
1964
  contents.componentTypeId = (0, smithy_client_1.expectString)(data.componentTypeId);
2391
1965
  }
2392
- if (data.state !== undefined && data.state !== null) {
1966
+ if (data.state != null) {
2393
1967
  contents.state = (0, smithy_client_1.expectString)(data.state);
2394
1968
  }
2395
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1969
+ if (data.workspaceId != null) {
2396
1970
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
2397
1971
  }
2398
- return Promise.resolve(contents);
1972
+ return contents;
2399
1973
  };
2400
1974
  exports.deserializeAws_restJson1UpdateComponentTypeCommand = deserializeAws_restJson1UpdateComponentTypeCommand;
2401
1975
  const deserializeAws_restJson1UpdateComponentTypeCommandError = async (output, context) => {
@@ -2403,7 +1977,6 @@ const deserializeAws_restJson1UpdateComponentTypeCommandError = async (output, c
2403
1977
  ...output,
2404
1978
  body: await parseBody(output.body, context),
2405
1979
  };
2406
- let response;
2407
1980
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2408
1981
  switch (errorCode) {
2409
1982
  case "AccessDeniedException":
@@ -2426,33 +1999,29 @@ const deserializeAws_restJson1UpdateComponentTypeCommandError = async (output, c
2426
1999
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2427
2000
  default:
2428
2001
  const parsedBody = parsedOutput.body;
2429
- const $metadata = deserializeMetadata(output);
2430
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2431
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2432
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2433
- $fault: "client",
2434
- $metadata,
2002
+ (0, smithy_client_1.throwDefaultError)({
2003
+ output,
2004
+ parsedBody,
2005
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
2006
+ errorCode,
2435
2007
  });
2436
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2437
2008
  }
2438
2009
  };
2439
2010
  const deserializeAws_restJson1UpdateEntityCommand = async (output, context) => {
2440
2011
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2441
2012
  return deserializeAws_restJson1UpdateEntityCommandError(output, context);
2442
2013
  }
2443
- const contents = {
2014
+ const contents = map({
2444
2015
  $metadata: deserializeMetadata(output),
2445
- state: undefined,
2446
- updateDateTime: undefined,
2447
- };
2016
+ });
2448
2017
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2449
- if (data.state !== undefined && data.state !== null) {
2018
+ if (data.state != null) {
2450
2019
  contents.state = (0, smithy_client_1.expectString)(data.state);
2451
2020
  }
2452
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2021
+ if (data.updateDateTime != null) {
2453
2022
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
2454
2023
  }
2455
- return Promise.resolve(contents);
2024
+ return contents;
2456
2025
  };
2457
2026
  exports.deserializeAws_restJson1UpdateEntityCommand = deserializeAws_restJson1UpdateEntityCommand;
2458
2027
  const deserializeAws_restJson1UpdateEntityCommandError = async (output, context) => {
@@ -2460,7 +2029,6 @@ const deserializeAws_restJson1UpdateEntityCommandError = async (output, context)
2460
2029
  ...output,
2461
2030
  body: await parseBody(output.body, context),
2462
2031
  };
2463
- let response;
2464
2032
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2465
2033
  switch (errorCode) {
2466
2034
  case "AccessDeniedException":
@@ -2486,29 +2054,26 @@ const deserializeAws_restJson1UpdateEntityCommandError = async (output, context)
2486
2054
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2487
2055
  default:
2488
2056
  const parsedBody = parsedOutput.body;
2489
- const $metadata = deserializeMetadata(output);
2490
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2491
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2492
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2493
- $fault: "client",
2494
- $metadata,
2057
+ (0, smithy_client_1.throwDefaultError)({
2058
+ output,
2059
+ parsedBody,
2060
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
2061
+ errorCode,
2495
2062
  });
2496
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2497
2063
  }
2498
2064
  };
2499
2065
  const deserializeAws_restJson1UpdateSceneCommand = async (output, context) => {
2500
2066
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2501
2067
  return deserializeAws_restJson1UpdateSceneCommandError(output, context);
2502
2068
  }
2503
- const contents = {
2069
+ const contents = map({
2504
2070
  $metadata: deserializeMetadata(output),
2505
- updateDateTime: undefined,
2506
- };
2071
+ });
2507
2072
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2508
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2073
+ if (data.updateDateTime != null) {
2509
2074
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
2510
2075
  }
2511
- return Promise.resolve(contents);
2076
+ return contents;
2512
2077
  };
2513
2078
  exports.deserializeAws_restJson1UpdateSceneCommand = deserializeAws_restJson1UpdateSceneCommand;
2514
2079
  const deserializeAws_restJson1UpdateSceneCommandError = async (output, context) => {
@@ -2516,7 +2081,6 @@ const deserializeAws_restJson1UpdateSceneCommandError = async (output, context)
2516
2081
  ...output,
2517
2082
  body: await parseBody(output.body, context),
2518
2083
  };
2519
- let response;
2520
2084
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2521
2085
  switch (errorCode) {
2522
2086
  case "AccessDeniedException":
@@ -2536,29 +2100,26 @@ const deserializeAws_restJson1UpdateSceneCommandError = async (output, context)
2536
2100
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2537
2101
  default:
2538
2102
  const parsedBody = parsedOutput.body;
2539
- const $metadata = deserializeMetadata(output);
2540
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2541
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2542
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2543
- $fault: "client",
2544
- $metadata,
2103
+ (0, smithy_client_1.throwDefaultError)({
2104
+ output,
2105
+ parsedBody,
2106
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
2107
+ errorCode,
2545
2108
  });
2546
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2547
2109
  }
2548
2110
  };
2549
2111
  const deserializeAws_restJson1UpdateWorkspaceCommand = async (output, context) => {
2550
2112
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2551
2113
  return deserializeAws_restJson1UpdateWorkspaceCommandError(output, context);
2552
2114
  }
2553
- const contents = {
2115
+ const contents = map({
2554
2116
  $metadata: deserializeMetadata(output),
2555
- updateDateTime: undefined,
2556
- };
2117
+ });
2557
2118
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2558
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2119
+ if (data.updateDateTime != null) {
2559
2120
  contents.updateDateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.updateDateTime)));
2560
2121
  }
2561
- return Promise.resolve(contents);
2122
+ return contents;
2562
2123
  };
2563
2124
  exports.deserializeAws_restJson1UpdateWorkspaceCommand = deserializeAws_restJson1UpdateWorkspaceCommand;
2564
2125
  const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, context) => {
@@ -2566,7 +2127,6 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, conte
2566
2127
  ...output,
2567
2128
  body: await parseBody(output.body, context),
2568
2129
  };
2569
- let response;
2570
2130
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2571
2131
  switch (errorCode) {
2572
2132
  case "AccessDeniedException":
@@ -2589,20 +2149,19 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, conte
2589
2149
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2590
2150
  default:
2591
2151
  const parsedBody = parsedOutput.body;
2592
- const $metadata = deserializeMetadata(output);
2593
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2594
- response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2595
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2596
- $fault: "client",
2597
- $metadata,
2152
+ (0, smithy_client_1.throwDefaultError)({
2153
+ output,
2154
+ parsedBody,
2155
+ exceptionCtor: IoTTwinMakerServiceException_1.IoTTwinMakerServiceException,
2156
+ errorCode,
2598
2157
  });
2599
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2600
2158
  }
2601
2159
  };
2160
+ const map = smithy_client_1.map;
2602
2161
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2603
- const contents = {};
2162
+ const contents = map({});
2604
2163
  const data = parsedOutput.body;
2605
- if (data.message !== undefined && data.message !== null) {
2164
+ if (data.message != null) {
2606
2165
  contents.message = (0, smithy_client_1.expectString)(data.message);
2607
2166
  }
2608
2167
  const exception = new models_0_1.AccessDeniedException({
@@ -2612,9 +2171,9 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
2612
2171
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2613
2172
  };
2614
2173
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2615
- const contents = {};
2174
+ const contents = map({});
2616
2175
  const data = parsedOutput.body;
2617
- if (data.message !== undefined && data.message !== null) {
2176
+ if (data.message != null) {
2618
2177
  contents.message = (0, smithy_client_1.expectString)(data.message);
2619
2178
  }
2620
2179
  const exception = new models_0_1.ConflictException({
@@ -2624,9 +2183,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2624
2183
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2625
2184
  };
2626
2185
  const deserializeAws_restJson1ConnectorFailureExceptionResponse = async (parsedOutput, context) => {
2627
- const contents = {};
2186
+ const contents = map({});
2628
2187
  const data = parsedOutput.body;
2629
- if (data.message !== undefined && data.message !== null) {
2188
+ if (data.message != null) {
2630
2189
  contents.message = (0, smithy_client_1.expectString)(data.message);
2631
2190
  }
2632
2191
  const exception = new models_0_1.ConnectorFailureException({
@@ -2636,9 +2195,9 @@ const deserializeAws_restJson1ConnectorFailureExceptionResponse = async (parsedO
2636
2195
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2637
2196
  };
2638
2197
  const deserializeAws_restJson1ConnectorTimeoutExceptionResponse = async (parsedOutput, context) => {
2639
- const contents = {};
2198
+ const contents = map({});
2640
2199
  const data = parsedOutput.body;
2641
- if (data.message !== undefined && data.message !== null) {
2200
+ if (data.message != null) {
2642
2201
  contents.message = (0, smithy_client_1.expectString)(data.message);
2643
2202
  }
2644
2203
  const exception = new models_0_1.ConnectorTimeoutException({
@@ -2648,9 +2207,9 @@ const deserializeAws_restJson1ConnectorTimeoutExceptionResponse = async (parsedO
2648
2207
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2649
2208
  };
2650
2209
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2651
- const contents = {};
2210
+ const contents = map({});
2652
2211
  const data = parsedOutput.body;
2653
- if (data.message !== undefined && data.message !== null) {
2212
+ if (data.message != null) {
2654
2213
  contents.message = (0, smithy_client_1.expectString)(data.message);
2655
2214
  }
2656
2215
  const exception = new models_0_1.InternalServerException({
@@ -2660,9 +2219,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
2660
2219
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2661
2220
  };
2662
2221
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2663
- const contents = {};
2222
+ const contents = map({});
2664
2223
  const data = parsedOutput.body;
2665
- if (data.message !== undefined && data.message !== null) {
2224
+ if (data.message != null) {
2666
2225
  contents.message = (0, smithy_client_1.expectString)(data.message);
2667
2226
  }
2668
2227
  const exception = new models_0_1.ResourceNotFoundException({
@@ -2672,9 +2231,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2672
2231
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2673
2232
  };
2674
2233
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2675
- const contents = {};
2234
+ const contents = map({});
2676
2235
  const data = parsedOutput.body;
2677
- if (data.message !== undefined && data.message !== null) {
2236
+ if (data.message != null) {
2678
2237
  contents.message = (0, smithy_client_1.expectString)(data.message);
2679
2238
  }
2680
2239
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -2684,9 +2243,9 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
2684
2243
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2685
2244
  };
2686
2245
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2687
- const contents = {};
2246
+ const contents = map({});
2688
2247
  const data = parsedOutput.body;
2689
- if (data.message !== undefined && data.message !== null) {
2248
+ if (data.message != null) {
2690
2249
  contents.message = (0, smithy_client_1.expectString)(data.message);
2691
2250
  }
2692
2251
  const exception = new models_0_1.ThrottlingException({
@@ -2696,9 +2255,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2696
2255
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2697
2256
  };
2698
2257
  const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
2699
- const contents = {};
2258
+ const contents = map({});
2700
2259
  const data = parsedOutput.body;
2701
- if (data.message !== undefined && data.message !== null) {
2260
+ if (data.message != null) {
2702
2261
  contents.message = (0, smithy_client_1.expectString)(data.message);
2703
2262
  }
2704
2263
  const exception = new models_0_1.TooManyTagsException({
@@ -2708,9 +2267,9 @@ const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput
2708
2267
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2709
2268
  };
2710
2269
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
2711
- const contents = {};
2270
+ const contents = map({});
2712
2271
  const data = parsedOutput.body;
2713
- if (data.message !== undefined && data.message !== null) {
2272
+ if (data.message != null) {
2714
2273
  contents.message = (0, smithy_client_1.expectString)(data.message);
2715
2274
  }
2716
2275
  const exception = new models_0_1.ValidationException({
@@ -2807,9 +2366,6 @@ const serializeAws_restJson1DataValueList = (input, context) => {
2807
2366
  return input
2808
2367
  .filter((e) => e != null)
2809
2368
  .map((entry) => {
2810
- if (entry === null) {
2811
- return null;
2812
- }
2813
2369
  return serializeAws_restJson1DataValue(entry, context);
2814
2370
  });
2815
2371
  };
@@ -2838,9 +2394,6 @@ const serializeAws_restJson1Entries = (input, context) => {
2838
2394
  return input
2839
2395
  .filter((e) => e != null)
2840
2396
  .map((entry) => {
2841
- if (entry === null) {
2842
- return null;
2843
- }
2844
2397
  return serializeAws_restJson1PropertyValueEntry(entry, context);
2845
2398
  });
2846
2399
  };
@@ -2848,9 +2401,6 @@ const serializeAws_restJson1ExtendsFrom = (input, context) => {
2848
2401
  return input
2849
2402
  .filter((e) => e != null)
2850
2403
  .map((entry) => {
2851
- if (entry === null) {
2852
- return null;
2853
- }
2854
2404
  return entry;
2855
2405
  });
2856
2406
  };
@@ -2910,9 +2460,6 @@ const serializeAws_restJson1ListComponentTypesFilters = (input, context) => {
2910
2460
  return input
2911
2461
  .filter((e) => e != null)
2912
2462
  .map((entry) => {
2913
- if (entry === null) {
2914
- return null;
2915
- }
2916
2463
  return serializeAws_restJson1ListComponentTypesFilter(entry, context);
2917
2464
  });
2918
2465
  };
@@ -2928,9 +2475,6 @@ const serializeAws_restJson1ListEntitiesFilters = (input, context) => {
2928
2475
  return input
2929
2476
  .filter((e) => e != null)
2930
2477
  .map((entry) => {
2931
- if (entry === null) {
2932
- return null;
2933
- }
2934
2478
  return serializeAws_restJson1ListEntitiesFilter(entry, context);
2935
2479
  });
2936
2480
  };
@@ -2975,9 +2519,6 @@ const serializeAws_restJson1PropertyFilters = (input, context) => {
2975
2519
  return input
2976
2520
  .filter((e) => e != null)
2977
2521
  .map((entry) => {
2978
- if (entry === null) {
2979
- return null;
2980
- }
2981
2522
  return serializeAws_restJson1PropertyFilter(entry, context);
2982
2523
  });
2983
2524
  };
@@ -3022,9 +2563,6 @@ const serializeAws_restJson1PropertyValues = (input, context) => {
3022
2563
  return input
3023
2564
  .filter((e) => e != null)
3024
2565
  .map((entry) => {
3025
- if (entry === null) {
3026
- return null;
3027
- }
3028
2566
  return serializeAws_restJson1PropertyValue(entry, context);
3029
2567
  });
3030
2568
  };
@@ -3044,9 +2582,6 @@ const serializeAws_restJson1RequiredProperties = (input, context) => {
3044
2582
  return input
3045
2583
  .filter((e) => e != null)
3046
2584
  .map((entry) => {
3047
- if (entry === null) {
3048
- return null;
3049
- }
3050
2585
  return entry;
3051
2586
  });
3052
2587
  };
@@ -3054,9 +2589,6 @@ const serializeAws_restJson1SceneCapabilities = (input, context) => {
3054
2589
  return input
3055
2590
  .filter((e) => e != null)
3056
2591
  .map((entry) => {
3057
- if (entry === null) {
3058
- return null;
3059
- }
3060
2592
  return entry;
3061
2593
  });
3062
2594
  };
@@ -3064,9 +2596,6 @@ const serializeAws_restJson1SelectedPropertyList = (input, context) => {
3064
2596
  return input
3065
2597
  .filter((e) => e != null)
3066
2598
  .map((entry) => {
3067
- if (entry === null) {
3068
- return null;
3069
- }
3070
2599
  return entry;
3071
2600
  });
3072
2601
  };