@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.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { IoTTwinMakerServiceException as __BaseException } from "../models/IoTTwinMakerServiceException";
5
5
  import { AccessDeniedException, ConflictException, ConnectorFailureException, ConnectorTimeoutException, InternalServerException, ListComponentTypesFilter, ListEntitiesFilter, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, TooManyTagsException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1BatchPutPropertyValuesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -15,16 +15,7 @@ export var serializeAws_restJson1BatchPutPropertyValuesCommand = function (input
15
15
  };
16
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
17
  "/workspaces/{workspaceId}/entity-properties";
18
- if (input.workspaceId !== undefined) {
19
- labelValue = input.workspaceId;
20
- if (labelValue.length <= 0) {
21
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
22
- }
23
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
24
- }
25
- else {
26
- throw new Error("No value provided for input HTTP label: workspaceId.");
27
- }
18
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
28
19
  body = JSON.stringify(__assign({}, (input.entries != null && { entries: serializeAws_restJson1Entries(input.entries, context) })));
29
20
  return [4, context.endpoint()];
30
21
  case 2:
@@ -48,7 +39,7 @@ export var serializeAws_restJson1BatchPutPropertyValuesCommand = function (input
48
39
  });
49
40
  }); };
50
41
  export var serializeAws_restJson1CreateComponentTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
42
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
52
43
  return __generator(this, function (_c) {
53
44
  switch (_c.label) {
54
45
  case 0: return [4, context.endpoint()];
@@ -59,26 +50,8 @@ export var serializeAws_restJson1CreateComponentTypeCommand = function (input, c
59
50
  };
60
51
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
61
52
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
62
- if (input.workspaceId !== undefined) {
63
- labelValue = input.workspaceId;
64
- if (labelValue.length <= 0) {
65
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
66
- }
67
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
68
- }
69
- else {
70
- throw new Error("No value provided for input HTTP label: workspaceId.");
71
- }
72
- if (input.componentTypeId !== undefined) {
73
- labelValue = input.componentTypeId;
74
- if (labelValue.length <= 0) {
75
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
76
- }
77
- resolvedPath = resolvedPath.replace("{componentTypeId}", __extendedEncodeURIComponent(labelValue));
78
- }
79
- else {
80
- throw new Error("No value provided for input HTTP label: componentTypeId.");
81
- }
53
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
54
+ resolvedPath = __resolvedPath(resolvedPath, input, "componentTypeId", function () { return input.componentTypeId; }, "{componentTypeId}", false);
82
55
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.extendsFrom != null && { extendsFrom: serializeAws_restJson1ExtendsFrom(input.extendsFrom, context) })), (input.functions != null && { functions: serializeAws_restJson1FunctionsRequest(input.functions, context) })), (input.isSingleton != null && { isSingleton: input.isSingleton })), (input.propertyDefinitions != null && {
83
56
  propertyDefinitions: serializeAws_restJson1PropertyDefinitionsRequest(input.propertyDefinitions, context),
84
57
  })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
@@ -104,7 +77,7 @@ export var serializeAws_restJson1CreateComponentTypeCommand = function (input, c
104
77
  });
105
78
  }); };
106
79
  export var serializeAws_restJson1CreateEntityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
80
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
108
81
  return __generator(this, function (_c) {
109
82
  switch (_c.label) {
110
83
  case 0: return [4, context.endpoint()];
@@ -114,16 +87,7 @@ export var serializeAws_restJson1CreateEntityCommand = function (input, context)
114
87
  "content-type": "application/json",
115
88
  };
116
89
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/entities";
117
- if (input.workspaceId !== undefined) {
118
- labelValue = input.workspaceId;
119
- if (labelValue.length <= 0) {
120
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
121
- }
122
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
123
- }
124
- else {
125
- throw new Error("No value provided for input HTTP label: workspaceId.");
126
- }
90
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
127
91
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.components != null && {
128
92
  components: serializeAws_restJson1ComponentsMapRequest(input.components, context),
129
93
  })), (input.description != null && { description: input.description })), (input.entityId != null && { entityId: input.entityId })), (input.entityName != null && { entityName: input.entityName })), (input.parentEntityId != null && { parentEntityId: input.parentEntityId })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
@@ -149,7 +113,7 @@ export var serializeAws_restJson1CreateEntityCommand = function (input, context)
149
113
  });
150
114
  }); };
151
115
  export var serializeAws_restJson1CreateSceneCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
152
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
116
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
153
117
  return __generator(this, function (_c) {
154
118
  switch (_c.label) {
155
119
  case 0: return [4, context.endpoint()];
@@ -159,16 +123,7 @@ export var serializeAws_restJson1CreateSceneCommand = function (input, context)
159
123
  "content-type": "application/json",
160
124
  };
161
125
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/scenes";
162
- if (input.workspaceId !== undefined) {
163
- labelValue = input.workspaceId;
164
- if (labelValue.length <= 0) {
165
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
166
- }
167
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
168
- }
169
- else {
170
- throw new Error("No value provided for input HTTP label: workspaceId.");
171
- }
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
172
127
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.capabilities != null && {
173
128
  capabilities: serializeAws_restJson1SceneCapabilities(input.capabilities, context),
174
129
  })), (input.contentLocation != null && { contentLocation: input.contentLocation })), (input.description != null && { description: input.description })), (input.sceneId != null && { sceneId: input.sceneId })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
@@ -194,7 +149,7 @@ export var serializeAws_restJson1CreateSceneCommand = function (input, context)
194
149
  });
195
150
  }); };
196
151
  export var serializeAws_restJson1CreateWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
197
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
152
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
198
153
  return __generator(this, function (_c) {
199
154
  switch (_c.label) {
200
155
  case 0: return [4, context.endpoint()];
@@ -204,16 +159,7 @@ export var serializeAws_restJson1CreateWorkspaceCommand = function (input, conte
204
159
  "content-type": "application/json",
205
160
  };
206
161
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
207
- if (input.workspaceId !== undefined) {
208
- labelValue = input.workspaceId;
209
- if (labelValue.length <= 0) {
210
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
211
- }
212
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
213
- }
214
- else {
215
- throw new Error("No value provided for input HTTP label: workspaceId.");
216
- }
162
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
217
163
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.role != null && { role: input.role })), (input.s3Location != null && { s3Location: input.s3Location })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
218
164
  return [4, context.endpoint()];
219
165
  case 2:
@@ -237,7 +183,7 @@ export var serializeAws_restJson1CreateWorkspaceCommand = function (input, conte
237
183
  });
238
184
  }); };
239
185
  export var serializeAws_restJson1DeleteComponentTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
240
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
186
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
241
187
  return __generator(this, function (_c) {
242
188
  switch (_c.label) {
243
189
  case 0: return [4, context.endpoint()];
@@ -246,26 +192,8 @@ export var serializeAws_restJson1DeleteComponentTypeCommand = function (input, c
246
192
  headers = {};
247
193
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
248
194
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
249
- if (input.workspaceId !== undefined) {
250
- labelValue = input.workspaceId;
251
- if (labelValue.length <= 0) {
252
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
253
- }
254
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
255
- }
256
- else {
257
- throw new Error("No value provided for input HTTP label: workspaceId.");
258
- }
259
- if (input.componentTypeId !== undefined) {
260
- labelValue = input.componentTypeId;
261
- if (labelValue.length <= 0) {
262
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
263
- }
264
- resolvedPath = resolvedPath.replace("{componentTypeId}", __extendedEncodeURIComponent(labelValue));
265
- }
266
- else {
267
- throw new Error("No value provided for input HTTP label: componentTypeId.");
268
- }
195
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
196
+ resolvedPath = __resolvedPath(resolvedPath, input, "componentTypeId", function () { return input.componentTypeId; }, "{componentTypeId}", false);
269
197
  return [4, context.endpoint()];
270
198
  case 2:
271
199
  resolvedHostname = (_c.sent()).hostname;
@@ -288,7 +216,7 @@ export var serializeAws_restJson1DeleteComponentTypeCommand = function (input, c
288
216
  });
289
217
  }); };
290
218
  export var serializeAws_restJson1DeleteEntityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
291
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body, resolvedHostname;
219
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body, resolvedHostname;
292
220
  return __generator(this, function (_c) {
293
221
  switch (_c.label) {
294
222
  case 0: return [4, context.endpoint()];
@@ -297,27 +225,11 @@ export var serializeAws_restJson1DeleteEntityCommand = function (input, context)
297
225
  headers = {};
298
226
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
299
227
  "/workspaces/{workspaceId}/entities/{entityId}";
300
- if (input.workspaceId !== undefined) {
301
- labelValue = input.workspaceId;
302
- if (labelValue.length <= 0) {
303
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
304
- }
305
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
306
- }
307
- else {
308
- throw new Error("No value provided for input HTTP label: workspaceId.");
309
- }
310
- if (input.entityId !== undefined) {
311
- labelValue = input.entityId;
312
- if (labelValue.length <= 0) {
313
- throw new Error("Empty value provided for input HTTP label: entityId.");
314
- }
315
- resolvedPath = resolvedPath.replace("{entityId}", __extendedEncodeURIComponent(labelValue));
316
- }
317
- else {
318
- throw new Error("No value provided for input HTTP label: entityId.");
319
- }
320
- query = __assign({}, (input.isRecursive !== undefined && { isRecursive: input.isRecursive.toString() }));
228
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
229
+ resolvedPath = __resolvedPath(resolvedPath, input, "entityId", function () { return input.entityId; }, "{entityId}", false);
230
+ query = map({
231
+ isRecursive: [function () { return input.isRecursive !== void 0; }, function () { return input.isRecursive.toString(); }],
232
+ });
321
233
  return [4, context.endpoint()];
322
234
  case 2:
323
235
  resolvedHostname = (_c.sent()).hostname;
@@ -341,7 +253,7 @@ export var serializeAws_restJson1DeleteEntityCommand = function (input, context)
341
253
  });
342
254
  }); };
343
255
  export var serializeAws_restJson1DeleteSceneCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
344
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
256
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
345
257
  return __generator(this, function (_c) {
346
258
  switch (_c.label) {
347
259
  case 0: return [4, context.endpoint()];
@@ -350,26 +262,8 @@ export var serializeAws_restJson1DeleteSceneCommand = function (input, context)
350
262
  headers = {};
351
263
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
352
264
  "/workspaces/{workspaceId}/scenes/{sceneId}";
353
- if (input.workspaceId !== undefined) {
354
- labelValue = input.workspaceId;
355
- if (labelValue.length <= 0) {
356
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
357
- }
358
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
359
- }
360
- else {
361
- throw new Error("No value provided for input HTTP label: workspaceId.");
362
- }
363
- if (input.sceneId !== undefined) {
364
- labelValue = input.sceneId;
365
- if (labelValue.length <= 0) {
366
- throw new Error("Empty value provided for input HTTP label: sceneId.");
367
- }
368
- resolvedPath = resolvedPath.replace("{sceneId}", __extendedEncodeURIComponent(labelValue));
369
- }
370
- else {
371
- throw new Error("No value provided for input HTTP label: sceneId.");
372
- }
265
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
266
+ resolvedPath = __resolvedPath(resolvedPath, input, "sceneId", function () { return input.sceneId; }, "{sceneId}", false);
373
267
  return [4, context.endpoint()];
374
268
  case 2:
375
269
  resolvedHostname = (_c.sent()).hostname;
@@ -392,7 +286,7 @@ export var serializeAws_restJson1DeleteSceneCommand = function (input, context)
392
286
  });
393
287
  }); };
394
288
  export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
395
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
289
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
396
290
  return __generator(this, function (_c) {
397
291
  switch (_c.label) {
398
292
  case 0: return [4, context.endpoint()];
@@ -400,16 +294,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
400
294
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
401
295
  headers = {};
402
296
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
403
- if (input.workspaceId !== undefined) {
404
- labelValue = input.workspaceId;
405
- if (labelValue.length <= 0) {
406
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
407
- }
408
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
409
- }
410
- else {
411
- throw new Error("No value provided for input HTTP label: workspaceId.");
412
- }
297
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
413
298
  return [4, context.endpoint()];
414
299
  case 2:
415
300
  resolvedHostname = (_c.sent()).hostname;
@@ -432,7 +317,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
432
317
  });
433
318
  }); };
434
319
  export var serializeAws_restJson1GetComponentTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
435
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
320
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
436
321
  return __generator(this, function (_c) {
437
322
  switch (_c.label) {
438
323
  case 0: return [4, context.endpoint()];
@@ -441,26 +326,8 @@ export var serializeAws_restJson1GetComponentTypeCommand = function (input, cont
441
326
  headers = {};
442
327
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
443
328
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
444
- if (input.workspaceId !== undefined) {
445
- labelValue = input.workspaceId;
446
- if (labelValue.length <= 0) {
447
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
448
- }
449
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
450
- }
451
- else {
452
- throw new Error("No value provided for input HTTP label: workspaceId.");
453
- }
454
- if (input.componentTypeId !== undefined) {
455
- labelValue = input.componentTypeId;
456
- if (labelValue.length <= 0) {
457
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
458
- }
459
- resolvedPath = resolvedPath.replace("{componentTypeId}", __extendedEncodeURIComponent(labelValue));
460
- }
461
- else {
462
- throw new Error("No value provided for input HTTP label: componentTypeId.");
463
- }
329
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
330
+ resolvedPath = __resolvedPath(resolvedPath, input, "componentTypeId", function () { return input.componentTypeId; }, "{componentTypeId}", false);
464
331
  return [4, context.endpoint()];
465
332
  case 2:
466
333
  resolvedHostname = (_c.sent()).hostname;
@@ -483,7 +350,7 @@ export var serializeAws_restJson1GetComponentTypeCommand = function (input, cont
483
350
  });
484
351
  }); };
485
352
  export var serializeAws_restJson1GetEntityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
486
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
353
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
487
354
  return __generator(this, function (_c) {
488
355
  switch (_c.label) {
489
356
  case 0: return [4, context.endpoint()];
@@ -492,26 +359,8 @@ export var serializeAws_restJson1GetEntityCommand = function (input, context) {
492
359
  headers = {};
493
360
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
494
361
  "/workspaces/{workspaceId}/entities/{entityId}";
495
- if (input.workspaceId !== undefined) {
496
- labelValue = input.workspaceId;
497
- if (labelValue.length <= 0) {
498
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
499
- }
500
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
501
- }
502
- else {
503
- throw new Error("No value provided for input HTTP label: workspaceId.");
504
- }
505
- if (input.entityId !== undefined) {
506
- labelValue = input.entityId;
507
- if (labelValue.length <= 0) {
508
- throw new Error("Empty value provided for input HTTP label: entityId.");
509
- }
510
- resolvedPath = resolvedPath.replace("{entityId}", __extendedEncodeURIComponent(labelValue));
511
- }
512
- else {
513
- throw new Error("No value provided for input HTTP label: entityId.");
514
- }
362
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
363
+ resolvedPath = __resolvedPath(resolvedPath, input, "entityId", function () { return input.entityId; }, "{entityId}", false);
515
364
  return [4, context.endpoint()];
516
365
  case 2:
517
366
  resolvedHostname = (_c.sent()).hostname;
@@ -534,7 +383,7 @@ export var serializeAws_restJson1GetEntityCommand = function (input, context) {
534
383
  });
535
384
  }); };
536
385
  export var serializeAws_restJson1GetPropertyValueCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
537
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
386
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
538
387
  return __generator(this, function (_c) {
539
388
  switch (_c.label) {
540
389
  case 0: return [4, context.endpoint()];
@@ -545,16 +394,7 @@ export var serializeAws_restJson1GetPropertyValueCommand = function (input, cont
545
394
  };
546
395
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
547
396
  "/workspaces/{workspaceId}/entity-properties/value";
548
- if (input.workspaceId !== undefined) {
549
- labelValue = input.workspaceId;
550
- if (labelValue.length <= 0) {
551
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
552
- }
553
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
554
- }
555
- else {
556
- throw new Error("No value provided for input HTTP label: workspaceId.");
557
- }
397
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
558
398
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.componentName != null && { componentName: input.componentName })), (input.componentTypeId != null && { componentTypeId: input.componentTypeId })), (input.entityId != null && { entityId: input.entityId })), (input.selectedProperties != null && {
559
399
  selectedProperties: serializeAws_restJson1SelectedPropertyList(input.selectedProperties, context),
560
400
  })));
@@ -580,7 +420,7 @@ export var serializeAws_restJson1GetPropertyValueCommand = function (input, cont
580
420
  });
581
421
  }); };
582
422
  export var serializeAws_restJson1GetPropertyValueHistoryCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
583
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
423
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
584
424
  return __generator(this, function (_c) {
585
425
  switch (_c.label) {
586
426
  case 0: return [4, context.endpoint()];
@@ -591,16 +431,7 @@ export var serializeAws_restJson1GetPropertyValueHistoryCommand = function (inpu
591
431
  };
592
432
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
593
433
  "/workspaces/{workspaceId}/entity-properties/history";
594
- if (input.workspaceId !== undefined) {
595
- labelValue = input.workspaceId;
596
- if (labelValue.length <= 0) {
597
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
598
- }
599
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
600
- }
601
- else {
602
- throw new Error("No value provided for input HTTP label: workspaceId.");
603
- }
434
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
604
435
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.componentName != null && { componentName: input.componentName })), (input.componentTypeId != null && { componentTypeId: input.componentTypeId })), (input.endDateTime != null && { endDateTime: Math.round(input.endDateTime.getTime() / 1000) })), (input.endTime != null && { endTime: input.endTime })), (input.entityId != null && { entityId: input.entityId })), (input.interpolation != null && {
605
436
  interpolation: serializeAws_restJson1InterpolationParameters(input.interpolation, context),
606
437
  })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })), (input.orderByTime != null && { orderByTime: input.orderByTime })), (input.propertyFilters != null && {
@@ -630,7 +461,7 @@ export var serializeAws_restJson1GetPropertyValueHistoryCommand = function (inpu
630
461
  });
631
462
  }); };
632
463
  export var serializeAws_restJson1GetSceneCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
633
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
464
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
634
465
  return __generator(this, function (_c) {
635
466
  switch (_c.label) {
636
467
  case 0: return [4, context.endpoint()];
@@ -639,26 +470,8 @@ export var serializeAws_restJson1GetSceneCommand = function (input, context) { r
639
470
  headers = {};
640
471
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
641
472
  "/workspaces/{workspaceId}/scenes/{sceneId}";
642
- if (input.workspaceId !== undefined) {
643
- labelValue = input.workspaceId;
644
- if (labelValue.length <= 0) {
645
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
646
- }
647
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
648
- }
649
- else {
650
- throw new Error("No value provided for input HTTP label: workspaceId.");
651
- }
652
- if (input.sceneId !== undefined) {
653
- labelValue = input.sceneId;
654
- if (labelValue.length <= 0) {
655
- throw new Error("Empty value provided for input HTTP label: sceneId.");
656
- }
657
- resolvedPath = resolvedPath.replace("{sceneId}", __extendedEncodeURIComponent(labelValue));
658
- }
659
- else {
660
- throw new Error("No value provided for input HTTP label: sceneId.");
661
- }
473
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
474
+ resolvedPath = __resolvedPath(resolvedPath, input, "sceneId", function () { return input.sceneId; }, "{sceneId}", false);
662
475
  return [4, context.endpoint()];
663
476
  case 2:
664
477
  resolvedHostname = (_c.sent()).hostname;
@@ -681,7 +494,7 @@ export var serializeAws_restJson1GetSceneCommand = function (input, context) { r
681
494
  });
682
495
  }); };
683
496
  export var serializeAws_restJson1GetWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
684
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
497
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
685
498
  return __generator(this, function (_c) {
686
499
  switch (_c.label) {
687
500
  case 0: return [4, context.endpoint()];
@@ -689,16 +502,7 @@ export var serializeAws_restJson1GetWorkspaceCommand = function (input, context)
689
502
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
690
503
  headers = {};
691
504
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
692
- if (input.workspaceId !== undefined) {
693
- labelValue = input.workspaceId;
694
- if (labelValue.length <= 0) {
695
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
696
- }
697
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
698
- }
699
- else {
700
- throw new Error("No value provided for input HTTP label: workspaceId.");
701
- }
505
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
702
506
  return [4, context.endpoint()];
703
507
  case 2:
704
508
  resolvedHostname = (_c.sent()).hostname;
@@ -721,7 +525,7 @@ export var serializeAws_restJson1GetWorkspaceCommand = function (input, context)
721
525
  });
722
526
  }); };
723
527
  export var serializeAws_restJson1ListComponentTypesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
724
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
528
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
725
529
  return __generator(this, function (_c) {
726
530
  switch (_c.label) {
727
531
  case 0: return [4, context.endpoint()];
@@ -732,16 +536,7 @@ export var serializeAws_restJson1ListComponentTypesCommand = function (input, co
732
536
  };
733
537
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
734
538
  "/workspaces/{workspaceId}/component-types-list";
735
- if (input.workspaceId !== undefined) {
736
- labelValue = input.workspaceId;
737
- if (labelValue.length <= 0) {
738
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
739
- }
740
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
741
- }
742
- else {
743
- throw new Error("No value provided for input HTTP label: workspaceId.");
744
- }
539
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
745
540
  body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1ListComponentTypesFilters(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
746
541
  return [4, context.endpoint()];
747
542
  case 2:
@@ -765,7 +560,7 @@ export var serializeAws_restJson1ListComponentTypesCommand = function (input, co
765
560
  });
766
561
  }); };
767
562
  export var serializeAws_restJson1ListEntitiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
768
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
563
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
769
564
  return __generator(this, function (_c) {
770
565
  switch (_c.label) {
771
566
  case 0: return [4, context.endpoint()];
@@ -775,16 +570,7 @@ export var serializeAws_restJson1ListEntitiesCommand = function (input, context)
775
570
  "content-type": "application/json",
776
571
  };
777
572
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/entities-list";
778
- if (input.workspaceId !== undefined) {
779
- labelValue = input.workspaceId;
780
- if (labelValue.length <= 0) {
781
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
782
- }
783
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
784
- }
785
- else {
786
- throw new Error("No value provided for input HTTP label: workspaceId.");
787
- }
573
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
788
574
  body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1ListEntitiesFilters(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
789
575
  return [4, context.endpoint()];
790
576
  case 2:
@@ -808,7 +594,7 @@ export var serializeAws_restJson1ListEntitiesCommand = function (input, context)
808
594
  });
809
595
  }); };
810
596
  export var serializeAws_restJson1ListScenesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
811
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
597
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
812
598
  return __generator(this, function (_c) {
813
599
  switch (_c.label) {
814
600
  case 0: return [4, context.endpoint()];
@@ -818,16 +604,7 @@ export var serializeAws_restJson1ListScenesCommand = function (input, context) {
818
604
  "content-type": "application/json",
819
605
  };
820
606
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/scenes-list";
821
- if (input.workspaceId !== undefined) {
822
- labelValue = input.workspaceId;
823
- if (labelValue.length <= 0) {
824
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
825
- }
826
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
827
- }
828
- else {
829
- throw new Error("No value provided for input HTTP label: workspaceId.");
830
- }
607
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
831
608
  body = JSON.stringify(__assign(__assign({}, (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
832
609
  return [4, context.endpoint()];
833
610
  case 2:
@@ -958,7 +735,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
958
735
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
959
736
  headers = {};
960
737
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
961
- query = __assign(__assign({}, (input.resourceARN !== undefined && { resourceARN: input.resourceARN })), (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
738
+ query = map({
739
+ resourceARN: [, input.resourceARN],
740
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
741
+ });
962
742
  return [4, context.endpoint()];
963
743
  case 2:
964
744
  resolvedHostname = (_c.sent()).hostname;
@@ -982,7 +762,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
982
762
  });
983
763
  }); };
984
764
  export var serializeAws_restJson1UpdateComponentTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
985
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
765
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
986
766
  return __generator(this, function (_c) {
987
767
  switch (_c.label) {
988
768
  case 0: return [4, context.endpoint()];
@@ -993,26 +773,8 @@ export var serializeAws_restJson1UpdateComponentTypeCommand = function (input, c
993
773
  };
994
774
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
995
775
  "/workspaces/{workspaceId}/component-types/{componentTypeId}";
996
- if (input.workspaceId !== undefined) {
997
- labelValue = input.workspaceId;
998
- if (labelValue.length <= 0) {
999
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1000
- }
1001
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
1002
- }
1003
- else {
1004
- throw new Error("No value provided for input HTTP label: workspaceId.");
1005
- }
1006
- if (input.componentTypeId !== undefined) {
1007
- labelValue = input.componentTypeId;
1008
- if (labelValue.length <= 0) {
1009
- throw new Error("Empty value provided for input HTTP label: componentTypeId.");
1010
- }
1011
- resolvedPath = resolvedPath.replace("{componentTypeId}", __extendedEncodeURIComponent(labelValue));
1012
- }
1013
- else {
1014
- throw new Error("No value provided for input HTTP label: componentTypeId.");
1015
- }
776
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
777
+ resolvedPath = __resolvedPath(resolvedPath, input, "componentTypeId", function () { return input.componentTypeId; }, "{componentTypeId}", false);
1016
778
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.extendsFrom != null && { extendsFrom: serializeAws_restJson1ExtendsFrom(input.extendsFrom, context) })), (input.functions != null && { functions: serializeAws_restJson1FunctionsRequest(input.functions, context) })), (input.isSingleton != null && { isSingleton: input.isSingleton })), (input.propertyDefinitions != null && {
1017
779
  propertyDefinitions: serializeAws_restJson1PropertyDefinitionsRequest(input.propertyDefinitions, context),
1018
780
  })));
@@ -1038,7 +800,7 @@ export var serializeAws_restJson1UpdateComponentTypeCommand = function (input, c
1038
800
  });
1039
801
  }); };
1040
802
  export var serializeAws_restJson1UpdateEntityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1041
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
803
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
1042
804
  return __generator(this, function (_c) {
1043
805
  switch (_c.label) {
1044
806
  case 0: return [4, context.endpoint()];
@@ -1049,26 +811,8 @@ export var serializeAws_restJson1UpdateEntityCommand = function (input, context)
1049
811
  };
1050
812
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1051
813
  "/workspaces/{workspaceId}/entities/{entityId}";
1052
- if (input.workspaceId !== undefined) {
1053
- labelValue = input.workspaceId;
1054
- if (labelValue.length <= 0) {
1055
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1056
- }
1057
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
1058
- }
1059
- else {
1060
- throw new Error("No value provided for input HTTP label: workspaceId.");
1061
- }
1062
- if (input.entityId !== undefined) {
1063
- labelValue = input.entityId;
1064
- if (labelValue.length <= 0) {
1065
- throw new Error("Empty value provided for input HTTP label: entityId.");
1066
- }
1067
- resolvedPath = resolvedPath.replace("{entityId}", __extendedEncodeURIComponent(labelValue));
1068
- }
1069
- else {
1070
- throw new Error("No value provided for input HTTP label: entityId.");
1071
- }
814
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
815
+ resolvedPath = __resolvedPath(resolvedPath, input, "entityId", function () { return input.entityId; }, "{entityId}", false);
1072
816
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.componentUpdates != null && {
1073
817
  componentUpdates: serializeAws_restJson1ComponentUpdatesMapRequest(input.componentUpdates, context),
1074
818
  })), (input.description != null && { description: input.description })), (input.entityName != null && { entityName: input.entityName })), (input.parentEntityUpdate != null && {
@@ -1096,7 +840,7 @@ export var serializeAws_restJson1UpdateEntityCommand = function (input, context)
1096
840
  });
1097
841
  }); };
1098
842
  export var serializeAws_restJson1UpdateSceneCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1099
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body, resolvedHostname;
843
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
1100
844
  return __generator(this, function (_c) {
1101
845
  switch (_c.label) {
1102
846
  case 0: return [4, context.endpoint()];
@@ -1107,26 +851,8 @@ export var serializeAws_restJson1UpdateSceneCommand = function (input, context)
1107
851
  };
1108
852
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1109
853
  "/workspaces/{workspaceId}/scenes/{sceneId}";
1110
- if (input.workspaceId !== undefined) {
1111
- labelValue = input.workspaceId;
1112
- if (labelValue.length <= 0) {
1113
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1114
- }
1115
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
1116
- }
1117
- else {
1118
- throw new Error("No value provided for input HTTP label: workspaceId.");
1119
- }
1120
- if (input.sceneId !== undefined) {
1121
- labelValue = input.sceneId;
1122
- if (labelValue.length <= 0) {
1123
- throw new Error("Empty value provided for input HTTP label: sceneId.");
1124
- }
1125
- resolvedPath = resolvedPath.replace("{sceneId}", __extendedEncodeURIComponent(labelValue));
1126
- }
1127
- else {
1128
- throw new Error("No value provided for input HTTP label: sceneId.");
1129
- }
854
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
855
+ resolvedPath = __resolvedPath(resolvedPath, input, "sceneId", function () { return input.sceneId; }, "{sceneId}", false);
1130
856
  body = JSON.stringify(__assign(__assign(__assign({}, (input.capabilities != null && {
1131
857
  capabilities: serializeAws_restJson1SceneCapabilities(input.capabilities, context),
1132
858
  })), (input.contentLocation != null && { contentLocation: input.contentLocation })), (input.description != null && { description: input.description })));
@@ -1152,7 +878,7 @@ export var serializeAws_restJson1UpdateSceneCommand = function (input, context)
1152
878
  });
1153
879
  }); };
1154
880
  export var serializeAws_restJson1UpdateWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1155
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body, resolvedHostname;
881
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
1156
882
  return __generator(this, function (_c) {
1157
883
  switch (_c.label) {
1158
884
  case 0: return [4, context.endpoint()];
@@ -1162,16 +888,7 @@ export var serializeAws_restJson1UpdateWorkspaceCommand = function (input, conte
1162
888
  "content-type": "application/json",
1163
889
  };
1164
890
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
1165
- if (input.workspaceId !== undefined) {
1166
- labelValue = input.workspaceId;
1167
- if (labelValue.length <= 0) {
1168
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
1169
- }
1170
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
1171
- }
1172
- else {
1173
- throw new Error("No value provided for input HTTP label: workspaceId.");
1174
- }
891
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
1175
892
  body = JSON.stringify(__assign(__assign({}, (input.description != null && { description: input.description })), (input.role != null && { role: input.role })));
1176
893
  return [4, context.endpoint()];
1177
894
  case 2:
@@ -1202,24 +919,23 @@ export var deserializeAws_restJson1BatchPutPropertyValuesCommand = function (out
1202
919
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1203
920
  return [2, deserializeAws_restJson1BatchPutPropertyValuesCommandError(output, context)];
1204
921
  }
1205
- contents = {
922
+ contents = map({
1206
923
  $metadata: deserializeMetadata(output),
1207
- errorEntries: undefined,
1208
- };
924
+ });
1209
925
  _a = __expectNonNull;
1210
926
  _b = __expectObject;
1211
927
  return [4, parseBody(output.body, context)];
1212
928
  case 1:
1213
929
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1214
- if (data.errorEntries !== undefined && data.errorEntries !== null) {
930
+ if (data.errorEntries != null) {
1215
931
  contents.errorEntries = deserializeAws_restJson1ErrorEntries(data.errorEntries, context);
1216
932
  }
1217
- return [2, Promise.resolve(contents)];
933
+ return [2, contents];
1218
934
  }
1219
935
  });
1220
936
  }); };
1221
937
  var deserializeAws_restJson1BatchPutPropertyValuesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1222
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
938
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1223
939
  var _c;
1224
940
  return __generator(this, function (_d) {
1225
941
  switch (_d.label) {
@@ -1252,14 +968,14 @@ var deserializeAws_restJson1BatchPutPropertyValuesCommandError = function (outpu
1252
968
  case 9: throw _d.sent();
1253
969
  case 10:
1254
970
  parsedBody = parsedOutput.body;
1255
- $metadata = deserializeMetadata(output);
1256
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1257
- response = new __BaseException({
1258
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1259
- $fault: "client",
1260
- $metadata: $metadata,
971
+ throwDefaultError({
972
+ output: output,
973
+ parsedBody: parsedBody,
974
+ exceptionCtor: __BaseException,
975
+ errorCode: errorCode,
1261
976
  });
1262
- throw __decorateServiceException(response, parsedBody);
977
+ _d.label = 11;
978
+ case 11: return [2];
1263
979
  }
1264
980
  });
1265
981
  }); };
@@ -1271,32 +987,29 @@ export var deserializeAws_restJson1CreateComponentTypeCommand = function (output
1271
987
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1272
988
  return [2, deserializeAws_restJson1CreateComponentTypeCommandError(output, context)];
1273
989
  }
1274
- contents = {
990
+ contents = map({
1275
991
  $metadata: deserializeMetadata(output),
1276
- arn: undefined,
1277
- creationDateTime: undefined,
1278
- state: undefined,
1279
- };
992
+ });
1280
993
  _a = __expectNonNull;
1281
994
  _b = __expectObject;
1282
995
  return [4, parseBody(output.body, context)];
1283
996
  case 1:
1284
997
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1285
- if (data.arn !== undefined && data.arn !== null) {
998
+ if (data.arn != null) {
1286
999
  contents.arn = __expectString(data.arn);
1287
1000
  }
1288
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1001
+ if (data.creationDateTime != null) {
1289
1002
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
1290
1003
  }
1291
- if (data.state !== undefined && data.state !== null) {
1004
+ if (data.state != null) {
1292
1005
  contents.state = __expectString(data.state);
1293
1006
  }
1294
- return [2, Promise.resolve(contents)];
1007
+ return [2, contents];
1295
1008
  }
1296
1009
  });
1297
1010
  }); };
1298
1011
  var deserializeAws_restJson1CreateComponentTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1299
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1012
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1300
1013
  var _c;
1301
1014
  return __generator(this, function (_d) {
1302
1015
  switch (_d.label) {
@@ -1337,14 +1050,14 @@ var deserializeAws_restJson1CreateComponentTypeCommandError = function (output,
1337
1050
  case 13: throw _d.sent();
1338
1051
  case 14:
1339
1052
  parsedBody = parsedOutput.body;
1340
- $metadata = deserializeMetadata(output);
1341
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1342
- response = new __BaseException({
1343
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1344
- $fault: "client",
1345
- $metadata: $metadata,
1053
+ throwDefaultError({
1054
+ output: output,
1055
+ parsedBody: parsedBody,
1056
+ exceptionCtor: __BaseException,
1057
+ errorCode: errorCode,
1346
1058
  });
1347
- throw __decorateServiceException(response, parsedBody);
1059
+ _d.label = 15;
1060
+ case 15: return [2];
1348
1061
  }
1349
1062
  });
1350
1063
  }); };
@@ -1356,36 +1069,32 @@ export var deserializeAws_restJson1CreateEntityCommand = function (output, conte
1356
1069
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1357
1070
  return [2, deserializeAws_restJson1CreateEntityCommandError(output, context)];
1358
1071
  }
1359
- contents = {
1072
+ contents = map({
1360
1073
  $metadata: deserializeMetadata(output),
1361
- arn: undefined,
1362
- creationDateTime: undefined,
1363
- entityId: undefined,
1364
- state: undefined,
1365
- };
1074
+ });
1366
1075
  _a = __expectNonNull;
1367
1076
  _b = __expectObject;
1368
1077
  return [4, parseBody(output.body, context)];
1369
1078
  case 1:
1370
1079
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1371
- if (data.arn !== undefined && data.arn !== null) {
1080
+ if (data.arn != null) {
1372
1081
  contents.arn = __expectString(data.arn);
1373
1082
  }
1374
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1083
+ if (data.creationDateTime != null) {
1375
1084
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
1376
1085
  }
1377
- if (data.entityId !== undefined && data.entityId !== null) {
1086
+ if (data.entityId != null) {
1378
1087
  contents.entityId = __expectString(data.entityId);
1379
1088
  }
1380
- if (data.state !== undefined && data.state !== null) {
1089
+ if (data.state != null) {
1381
1090
  contents.state = __expectString(data.state);
1382
1091
  }
1383
- return [2, Promise.resolve(contents)];
1092
+ return [2, contents];
1384
1093
  }
1385
1094
  });
1386
1095
  }); };
1387
1096
  var deserializeAws_restJson1CreateEntityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1388
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1097
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1389
1098
  var _c;
1390
1099
  return __generator(this, function (_d) {
1391
1100
  switch (_d.label) {
@@ -1426,14 +1135,14 @@ var deserializeAws_restJson1CreateEntityCommandError = function (output, context
1426
1135
  case 13: throw _d.sent();
1427
1136
  case 14:
1428
1137
  parsedBody = parsedOutput.body;
1429
- $metadata = deserializeMetadata(output);
1430
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1431
- response = new __BaseException({
1432
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1433
- $fault: "client",
1434
- $metadata: $metadata,
1138
+ throwDefaultError({
1139
+ output: output,
1140
+ parsedBody: parsedBody,
1141
+ exceptionCtor: __BaseException,
1142
+ errorCode: errorCode,
1435
1143
  });
1436
- throw __decorateServiceException(response, parsedBody);
1144
+ _d.label = 15;
1145
+ case 15: return [2];
1437
1146
  }
1438
1147
  });
1439
1148
  }); };
@@ -1445,28 +1154,26 @@ export var deserializeAws_restJson1CreateSceneCommand = function (output, contex
1445
1154
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1446
1155
  return [2, deserializeAws_restJson1CreateSceneCommandError(output, context)];
1447
1156
  }
1448
- contents = {
1157
+ contents = map({
1449
1158
  $metadata: deserializeMetadata(output),
1450
- arn: undefined,
1451
- creationDateTime: undefined,
1452
- };
1159
+ });
1453
1160
  _a = __expectNonNull;
1454
1161
  _b = __expectObject;
1455
1162
  return [4, parseBody(output.body, context)];
1456
1163
  case 1:
1457
1164
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1458
- if (data.arn !== undefined && data.arn !== null) {
1165
+ if (data.arn != null) {
1459
1166
  contents.arn = __expectString(data.arn);
1460
1167
  }
1461
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1168
+ if (data.creationDateTime != null) {
1462
1169
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
1463
1170
  }
1464
- return [2, Promise.resolve(contents)];
1171
+ return [2, contents];
1465
1172
  }
1466
1173
  });
1467
1174
  }); };
1468
1175
  var deserializeAws_restJson1CreateSceneCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1469
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1176
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1470
1177
  var _c;
1471
1178
  return __generator(this, function (_d) {
1472
1179
  switch (_d.label) {
@@ -1507,14 +1214,14 @@ var deserializeAws_restJson1CreateSceneCommandError = function (output, context)
1507
1214
  case 13: throw _d.sent();
1508
1215
  case 14:
1509
1216
  parsedBody = parsedOutput.body;
1510
- $metadata = deserializeMetadata(output);
1511
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1512
- response = new __BaseException({
1513
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1514
- $fault: "client",
1515
- $metadata: $metadata,
1217
+ throwDefaultError({
1218
+ output: output,
1219
+ parsedBody: parsedBody,
1220
+ exceptionCtor: __BaseException,
1221
+ errorCode: errorCode,
1516
1222
  });
1517
- throw __decorateServiceException(response, parsedBody);
1223
+ _d.label = 15;
1224
+ case 15: return [2];
1518
1225
  }
1519
1226
  });
1520
1227
  }); };
@@ -1526,28 +1233,26 @@ export var deserializeAws_restJson1CreateWorkspaceCommand = function (output, co
1526
1233
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1527
1234
  return [2, deserializeAws_restJson1CreateWorkspaceCommandError(output, context)];
1528
1235
  }
1529
- contents = {
1236
+ contents = map({
1530
1237
  $metadata: deserializeMetadata(output),
1531
- arn: undefined,
1532
- creationDateTime: undefined,
1533
- };
1238
+ });
1534
1239
  _a = __expectNonNull;
1535
1240
  _b = __expectObject;
1536
1241
  return [4, parseBody(output.body, context)];
1537
1242
  case 1:
1538
1243
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1539
- if (data.arn !== undefined && data.arn !== null) {
1244
+ if (data.arn != null) {
1540
1245
  contents.arn = __expectString(data.arn);
1541
1246
  }
1542
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1247
+ if (data.creationDateTime != null) {
1543
1248
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
1544
1249
  }
1545
- return [2, Promise.resolve(contents)];
1250
+ return [2, contents];
1546
1251
  }
1547
1252
  });
1548
1253
  }); };
1549
1254
  var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1550
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1255
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1551
1256
  var _c;
1552
1257
  return __generator(this, function (_d) {
1553
1258
  switch (_d.label) {
@@ -1588,14 +1293,14 @@ var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, cont
1588
1293
  case 13: throw _d.sent();
1589
1294
  case 14:
1590
1295
  parsedBody = parsedOutput.body;
1591
- $metadata = deserializeMetadata(output);
1592
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1593
- response = new __BaseException({
1594
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1595
- $fault: "client",
1596
- $metadata: $metadata,
1296
+ throwDefaultError({
1297
+ output: output,
1298
+ parsedBody: parsedBody,
1299
+ exceptionCtor: __BaseException,
1300
+ errorCode: errorCode,
1597
1301
  });
1598
- throw __decorateServiceException(response, parsedBody);
1302
+ _d.label = 15;
1303
+ case 15: return [2];
1599
1304
  }
1600
1305
  });
1601
1306
  }); };
@@ -1607,24 +1312,23 @@ export var deserializeAws_restJson1DeleteComponentTypeCommand = function (output
1607
1312
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1608
1313
  return [2, deserializeAws_restJson1DeleteComponentTypeCommandError(output, context)];
1609
1314
  }
1610
- contents = {
1315
+ contents = map({
1611
1316
  $metadata: deserializeMetadata(output),
1612
- state: undefined,
1613
- };
1317
+ });
1614
1318
  _a = __expectNonNull;
1615
1319
  _b = __expectObject;
1616
1320
  return [4, parseBody(output.body, context)];
1617
1321
  case 1:
1618
1322
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1619
- if (data.state !== undefined && data.state !== null) {
1323
+ if (data.state != null) {
1620
1324
  contents.state = __expectString(data.state);
1621
1325
  }
1622
- return [2, Promise.resolve(contents)];
1326
+ return [2, contents];
1623
1327
  }
1624
1328
  });
1625
1329
  }); };
1626
1330
  var deserializeAws_restJson1DeleteComponentTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1627
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1331
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1628
1332
  var _c;
1629
1333
  return __generator(this, function (_d) {
1630
1334
  switch (_d.label) {
@@ -1661,14 +1365,14 @@ var deserializeAws_restJson1DeleteComponentTypeCommandError = function (output,
1661
1365
  case 11: throw _d.sent();
1662
1366
  case 12:
1663
1367
  parsedBody = parsedOutput.body;
1664
- $metadata = deserializeMetadata(output);
1665
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1666
- response = new __BaseException({
1667
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1668
- $fault: "client",
1669
- $metadata: $metadata,
1368
+ throwDefaultError({
1369
+ output: output,
1370
+ parsedBody: parsedBody,
1371
+ exceptionCtor: __BaseException,
1372
+ errorCode: errorCode,
1670
1373
  });
1671
- throw __decorateServiceException(response, parsedBody);
1374
+ _d.label = 13;
1375
+ case 13: return [2];
1672
1376
  }
1673
1377
  });
1674
1378
  }); };
@@ -1680,24 +1384,23 @@ export var deserializeAws_restJson1DeleteEntityCommand = function (output, conte
1680
1384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1681
1385
  return [2, deserializeAws_restJson1DeleteEntityCommandError(output, context)];
1682
1386
  }
1683
- contents = {
1387
+ contents = map({
1684
1388
  $metadata: deserializeMetadata(output),
1685
- state: undefined,
1686
- };
1389
+ });
1687
1390
  _a = __expectNonNull;
1688
1391
  _b = __expectObject;
1689
1392
  return [4, parseBody(output.body, context)];
1690
1393
  case 1:
1691
1394
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1692
- if (data.state !== undefined && data.state !== null) {
1395
+ if (data.state != null) {
1693
1396
  contents.state = __expectString(data.state);
1694
1397
  }
1695
- return [2, Promise.resolve(contents)];
1398
+ return [2, contents];
1696
1399
  }
1697
1400
  });
1698
1401
  }); };
1699
1402
  var deserializeAws_restJson1DeleteEntityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1700
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1403
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1701
1404
  var _c;
1702
1405
  return __generator(this, function (_d) {
1703
1406
  switch (_d.label) {
@@ -1734,14 +1437,14 @@ var deserializeAws_restJson1DeleteEntityCommandError = function (output, context
1734
1437
  case 11: throw _d.sent();
1735
1438
  case 12:
1736
1439
  parsedBody = parsedOutput.body;
1737
- $metadata = deserializeMetadata(output);
1738
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1739
- response = new __BaseException({
1740
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1741
- $fault: "client",
1742
- $metadata: $metadata,
1440
+ throwDefaultError({
1441
+ output: output,
1442
+ parsedBody: parsedBody,
1443
+ exceptionCtor: __BaseException,
1444
+ errorCode: errorCode,
1743
1445
  });
1744
- throw __decorateServiceException(response, parsedBody);
1446
+ _d.label = 13;
1447
+ case 13: return [2];
1745
1448
  }
1746
1449
  });
1747
1450
  }); };
@@ -1753,18 +1456,18 @@ export var deserializeAws_restJson1DeleteSceneCommand = function (output, contex
1753
1456
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1754
1457
  return [2, deserializeAws_restJson1DeleteSceneCommandError(output, context)];
1755
1458
  }
1756
- contents = {
1459
+ contents = map({
1757
1460
  $metadata: deserializeMetadata(output),
1758
- };
1461
+ });
1759
1462
  return [4, collectBody(output.body, context)];
1760
1463
  case 1:
1761
1464
  _a.sent();
1762
- return [2, Promise.resolve(contents)];
1465
+ return [2, contents];
1763
1466
  }
1764
1467
  });
1765
1468
  }); };
1766
1469
  var deserializeAws_restJson1DeleteSceneCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1767
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1470
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1768
1471
  var _c;
1769
1472
  return __generator(this, function (_d) {
1770
1473
  switch (_d.label) {
@@ -1801,14 +1504,14 @@ var deserializeAws_restJson1DeleteSceneCommandError = function (output, context)
1801
1504
  case 11: throw _d.sent();
1802
1505
  case 12:
1803
1506
  parsedBody = parsedOutput.body;
1804
- $metadata = deserializeMetadata(output);
1805
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1806
- response = new __BaseException({
1807
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1808
- $fault: "client",
1809
- $metadata: $metadata,
1507
+ throwDefaultError({
1508
+ output: output,
1509
+ parsedBody: parsedBody,
1510
+ exceptionCtor: __BaseException,
1511
+ errorCode: errorCode,
1810
1512
  });
1811
- throw __decorateServiceException(response, parsedBody);
1513
+ _d.label = 13;
1514
+ case 13: return [2];
1812
1515
  }
1813
1516
  });
1814
1517
  }); };
@@ -1820,18 +1523,18 @@ export var deserializeAws_restJson1DeleteWorkspaceCommand = function (output, co
1820
1523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1821
1524
  return [2, deserializeAws_restJson1DeleteWorkspaceCommandError(output, context)];
1822
1525
  }
1823
- contents = {
1526
+ contents = map({
1824
1527
  $metadata: deserializeMetadata(output),
1825
- };
1528
+ });
1826
1529
  return [4, collectBody(output.body, context)];
1827
1530
  case 1:
1828
1531
  _a.sent();
1829
- return [2, Promise.resolve(contents)];
1532
+ return [2, contents];
1830
1533
  }
1831
1534
  });
1832
1535
  }); };
1833
1536
  var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1834
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1537
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1835
1538
  var _c;
1836
1539
  return __generator(this, function (_d) {
1837
1540
  switch (_d.label) {
@@ -1868,14 +1571,14 @@ var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, cont
1868
1571
  case 11: throw _d.sent();
1869
1572
  case 12:
1870
1573
  parsedBody = parsedOutput.body;
1871
- $metadata = deserializeMetadata(output);
1872
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1873
- response = new __BaseException({
1874
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1875
- $fault: "client",
1876
- $metadata: $metadata,
1574
+ throwDefaultError({
1575
+ output: output,
1576
+ parsedBody: parsedBody,
1577
+ exceptionCtor: __BaseException,
1578
+ errorCode: errorCode,
1877
1579
  });
1878
- throw __decorateServiceException(response, parsedBody);
1580
+ _d.label = 13;
1581
+ case 13: return [2];
1879
1582
  }
1880
1583
  });
1881
1584
  }); };
@@ -1887,72 +1590,59 @@ export var deserializeAws_restJson1GetComponentTypeCommand = function (output, c
1887
1590
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1888
1591
  return [2, deserializeAws_restJson1GetComponentTypeCommandError(output, context)];
1889
1592
  }
1890
- contents = {
1593
+ contents = map({
1891
1594
  $metadata: deserializeMetadata(output),
1892
- arn: undefined,
1893
- componentTypeId: undefined,
1894
- creationDateTime: undefined,
1895
- description: undefined,
1896
- extendsFrom: undefined,
1897
- functions: undefined,
1898
- isAbstract: undefined,
1899
- isSchemaInitialized: undefined,
1900
- isSingleton: undefined,
1901
- propertyDefinitions: undefined,
1902
- status: undefined,
1903
- updateDateTime: undefined,
1904
- workspaceId: undefined,
1905
- };
1595
+ });
1906
1596
  _a = __expectNonNull;
1907
1597
  _b = __expectObject;
1908
1598
  return [4, parseBody(output.body, context)];
1909
1599
  case 1:
1910
1600
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1911
- if (data.arn !== undefined && data.arn !== null) {
1601
+ if (data.arn != null) {
1912
1602
  contents.arn = __expectString(data.arn);
1913
1603
  }
1914
- if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
1604
+ if (data.componentTypeId != null) {
1915
1605
  contents.componentTypeId = __expectString(data.componentTypeId);
1916
1606
  }
1917
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1607
+ if (data.creationDateTime != null) {
1918
1608
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
1919
1609
  }
1920
- if (data.description !== undefined && data.description !== null) {
1610
+ if (data.description != null) {
1921
1611
  contents.description = __expectString(data.description);
1922
1612
  }
1923
- if (data.extendsFrom !== undefined && data.extendsFrom !== null) {
1613
+ if (data.extendsFrom != null) {
1924
1614
  contents.extendsFrom = deserializeAws_restJson1ExtendsFrom(data.extendsFrom, context);
1925
1615
  }
1926
- if (data.functions !== undefined && data.functions !== null) {
1616
+ if (data.functions != null) {
1927
1617
  contents.functions = deserializeAws_restJson1FunctionsResponse(data.functions, context);
1928
1618
  }
1929
- if (data.isAbstract !== undefined && data.isAbstract !== null) {
1619
+ if (data.isAbstract != null) {
1930
1620
  contents.isAbstract = __expectBoolean(data.isAbstract);
1931
1621
  }
1932
- if (data.isSchemaInitialized !== undefined && data.isSchemaInitialized !== null) {
1622
+ if (data.isSchemaInitialized != null) {
1933
1623
  contents.isSchemaInitialized = __expectBoolean(data.isSchemaInitialized);
1934
1624
  }
1935
- if (data.isSingleton !== undefined && data.isSingleton !== null) {
1625
+ if (data.isSingleton != null) {
1936
1626
  contents.isSingleton = __expectBoolean(data.isSingleton);
1937
1627
  }
1938
- if (data.propertyDefinitions !== undefined && data.propertyDefinitions !== null) {
1628
+ if (data.propertyDefinitions != null) {
1939
1629
  contents.propertyDefinitions = deserializeAws_restJson1PropertyDefinitionsResponse(data.propertyDefinitions, context);
1940
1630
  }
1941
- if (data.status !== undefined && data.status !== null) {
1631
+ if (data.status != null) {
1942
1632
  contents.status = deserializeAws_restJson1Status(data.status, context);
1943
1633
  }
1944
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1634
+ if (data.updateDateTime != null) {
1945
1635
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
1946
1636
  }
1947
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1637
+ if (data.workspaceId != null) {
1948
1638
  contents.workspaceId = __expectString(data.workspaceId);
1949
1639
  }
1950
- return [2, Promise.resolve(contents)];
1640
+ return [2, contents];
1951
1641
  }
1952
1642
  });
1953
1643
  }); };
1954
1644
  var deserializeAws_restJson1GetComponentTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1955
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1645
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1956
1646
  var _c;
1957
1647
  return __generator(this, function (_d) {
1958
1648
  switch (_d.label) {
@@ -1985,14 +1675,14 @@ var deserializeAws_restJson1GetComponentTypeCommandError = function (output, con
1985
1675
  case 9: throw _d.sent();
1986
1676
  case 10:
1987
1677
  parsedBody = parsedOutput.body;
1988
- $metadata = deserializeMetadata(output);
1989
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1990
- response = new __BaseException({
1991
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1992
- $fault: "client",
1993
- $metadata: $metadata,
1678
+ throwDefaultError({
1679
+ output: output,
1680
+ parsedBody: parsedBody,
1681
+ exceptionCtor: __BaseException,
1682
+ errorCode: errorCode,
1994
1683
  });
1995
- throw __decorateServiceException(response, parsedBody);
1684
+ _d.label = 11;
1685
+ case 11: return [2];
1996
1686
  }
1997
1687
  });
1998
1688
  }); };
@@ -2004,64 +1694,53 @@ export var deserializeAws_restJson1GetEntityCommand = function (output, context)
2004
1694
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2005
1695
  return [2, deserializeAws_restJson1GetEntityCommandError(output, context)];
2006
1696
  }
2007
- contents = {
1697
+ contents = map({
2008
1698
  $metadata: deserializeMetadata(output),
2009
- arn: undefined,
2010
- components: undefined,
2011
- creationDateTime: undefined,
2012
- description: undefined,
2013
- entityId: undefined,
2014
- entityName: undefined,
2015
- hasChildEntities: undefined,
2016
- parentEntityId: undefined,
2017
- status: undefined,
2018
- updateDateTime: undefined,
2019
- workspaceId: undefined,
2020
- };
1699
+ });
2021
1700
  _a = __expectNonNull;
2022
1701
  _b = __expectObject;
2023
1702
  return [4, parseBody(output.body, context)];
2024
1703
  case 1:
2025
1704
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2026
- if (data.arn !== undefined && data.arn !== null) {
1705
+ if (data.arn != null) {
2027
1706
  contents.arn = __expectString(data.arn);
2028
1707
  }
2029
- if (data.components !== undefined && data.components !== null) {
1708
+ if (data.components != null) {
2030
1709
  contents.components = deserializeAws_restJson1ComponentsMap(data.components, context);
2031
1710
  }
2032
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1711
+ if (data.creationDateTime != null) {
2033
1712
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
2034
1713
  }
2035
- if (data.description !== undefined && data.description !== null) {
1714
+ if (data.description != null) {
2036
1715
  contents.description = __expectString(data.description);
2037
1716
  }
2038
- if (data.entityId !== undefined && data.entityId !== null) {
1717
+ if (data.entityId != null) {
2039
1718
  contents.entityId = __expectString(data.entityId);
2040
1719
  }
2041
- if (data.entityName !== undefined && data.entityName !== null) {
1720
+ if (data.entityName != null) {
2042
1721
  contents.entityName = __expectString(data.entityName);
2043
1722
  }
2044
- if (data.hasChildEntities !== undefined && data.hasChildEntities !== null) {
1723
+ if (data.hasChildEntities != null) {
2045
1724
  contents.hasChildEntities = __expectBoolean(data.hasChildEntities);
2046
1725
  }
2047
- if (data.parentEntityId !== undefined && data.parentEntityId !== null) {
1726
+ if (data.parentEntityId != null) {
2048
1727
  contents.parentEntityId = __expectString(data.parentEntityId);
2049
1728
  }
2050
- if (data.status !== undefined && data.status !== null) {
1729
+ if (data.status != null) {
2051
1730
  contents.status = deserializeAws_restJson1Status(data.status, context);
2052
1731
  }
2053
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1732
+ if (data.updateDateTime != null) {
2054
1733
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
2055
1734
  }
2056
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1735
+ if (data.workspaceId != null) {
2057
1736
  contents.workspaceId = __expectString(data.workspaceId);
2058
1737
  }
2059
- return [2, Promise.resolve(contents)];
1738
+ return [2, contents];
2060
1739
  }
2061
1740
  });
2062
1741
  }); };
2063
1742
  var deserializeAws_restJson1GetEntityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2064
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1743
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2065
1744
  var _c;
2066
1745
  return __generator(this, function (_d) {
2067
1746
  switch (_d.label) {
@@ -2098,14 +1777,14 @@ var deserializeAws_restJson1GetEntityCommandError = function (output, context) {
2098
1777
  case 11: throw _d.sent();
2099
1778
  case 12:
2100
1779
  parsedBody = parsedOutput.body;
2101
- $metadata = deserializeMetadata(output);
2102
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2103
- response = new __BaseException({
2104
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2105
- $fault: "client",
2106
- $metadata: $metadata,
1780
+ throwDefaultError({
1781
+ output: output,
1782
+ parsedBody: parsedBody,
1783
+ exceptionCtor: __BaseException,
1784
+ errorCode: errorCode,
2107
1785
  });
2108
- throw __decorateServiceException(response, parsedBody);
1786
+ _d.label = 13;
1787
+ case 13: return [2];
2109
1788
  }
2110
1789
  });
2111
1790
  }); };
@@ -2117,24 +1796,23 @@ export var deserializeAws_restJson1GetPropertyValueCommand = function (output, c
2117
1796
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2118
1797
  return [2, deserializeAws_restJson1GetPropertyValueCommandError(output, context)];
2119
1798
  }
2120
- contents = {
1799
+ contents = map({
2121
1800
  $metadata: deserializeMetadata(output),
2122
- propertyValues: undefined,
2123
- };
1801
+ });
2124
1802
  _a = __expectNonNull;
2125
1803
  _b = __expectObject;
2126
1804
  return [4, parseBody(output.body, context)];
2127
1805
  case 1:
2128
1806
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2129
- if (data.propertyValues !== undefined && data.propertyValues !== null) {
1807
+ if (data.propertyValues != null) {
2130
1808
  contents.propertyValues = deserializeAws_restJson1PropertyLatestValueMap(data.propertyValues, context);
2131
1809
  }
2132
- return [2, Promise.resolve(contents)];
1810
+ return [2, contents];
2133
1811
  }
2134
1812
  });
2135
1813
  }); };
2136
1814
  var deserializeAws_restJson1GetPropertyValueCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2137
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1815
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2138
1816
  var _c;
2139
1817
  return __generator(this, function (_d) {
2140
1818
  switch (_d.label) {
@@ -2179,14 +1857,14 @@ var deserializeAws_restJson1GetPropertyValueCommandError = function (output, con
2179
1857
  case 15: throw _d.sent();
2180
1858
  case 16:
2181
1859
  parsedBody = parsedOutput.body;
2182
- $metadata = deserializeMetadata(output);
2183
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2184
- response = new __BaseException({
2185
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2186
- $fault: "client",
2187
- $metadata: $metadata,
1860
+ throwDefaultError({
1861
+ output: output,
1862
+ parsedBody: parsedBody,
1863
+ exceptionCtor: __BaseException,
1864
+ errorCode: errorCode,
2188
1865
  });
2189
- throw __decorateServiceException(response, parsedBody);
1866
+ _d.label = 17;
1867
+ case 17: return [2];
2190
1868
  }
2191
1869
  });
2192
1870
  }); };
@@ -2198,28 +1876,26 @@ export var deserializeAws_restJson1GetPropertyValueHistoryCommand = function (ou
2198
1876
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2199
1877
  return [2, deserializeAws_restJson1GetPropertyValueHistoryCommandError(output, context)];
2200
1878
  }
2201
- contents = {
1879
+ contents = map({
2202
1880
  $metadata: deserializeMetadata(output),
2203
- nextToken: undefined,
2204
- propertyValues: undefined,
2205
- };
1881
+ });
2206
1882
  _a = __expectNonNull;
2207
1883
  _b = __expectObject;
2208
1884
  return [4, parseBody(output.body, context)];
2209
1885
  case 1:
2210
1886
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2211
- if (data.nextToken !== undefined && data.nextToken !== null) {
1887
+ if (data.nextToken != null) {
2212
1888
  contents.nextToken = __expectString(data.nextToken);
2213
1889
  }
2214
- if (data.propertyValues !== undefined && data.propertyValues !== null) {
1890
+ if (data.propertyValues != null) {
2215
1891
  contents.propertyValues = deserializeAws_restJson1PropertyValueList(data.propertyValues, context);
2216
1892
  }
2217
- return [2, Promise.resolve(contents)];
1893
+ return [2, contents];
2218
1894
  }
2219
1895
  });
2220
1896
  }); };
2221
1897
  var deserializeAws_restJson1GetPropertyValueHistoryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2222
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1898
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2223
1899
  var _c;
2224
1900
  return __generator(this, function (_d) {
2225
1901
  switch (_d.label) {
@@ -2264,14 +1940,14 @@ var deserializeAws_restJson1GetPropertyValueHistoryCommandError = function (outp
2264
1940
  case 15: throw _d.sent();
2265
1941
  case 16:
2266
1942
  parsedBody = parsedOutput.body;
2267
- $metadata = deserializeMetadata(output);
2268
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2269
- response = new __BaseException({
2270
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2271
- $fault: "client",
2272
- $metadata: $metadata,
1943
+ throwDefaultError({
1944
+ output: output,
1945
+ parsedBody: parsedBody,
1946
+ exceptionCtor: __BaseException,
1947
+ errorCode: errorCode,
2273
1948
  });
2274
- throw __decorateServiceException(response, parsedBody);
1949
+ _d.label = 17;
1950
+ case 17: return [2];
2275
1951
  }
2276
1952
  });
2277
1953
  }); };
@@ -2283,52 +1959,44 @@ export var deserializeAws_restJson1GetSceneCommand = function (output, context)
2283
1959
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2284
1960
  return [2, deserializeAws_restJson1GetSceneCommandError(output, context)];
2285
1961
  }
2286
- contents = {
1962
+ contents = map({
2287
1963
  $metadata: deserializeMetadata(output),
2288
- arn: undefined,
2289
- capabilities: undefined,
2290
- contentLocation: undefined,
2291
- creationDateTime: undefined,
2292
- description: undefined,
2293
- sceneId: undefined,
2294
- updateDateTime: undefined,
2295
- workspaceId: undefined,
2296
- };
1964
+ });
2297
1965
  _a = __expectNonNull;
2298
1966
  _b = __expectObject;
2299
1967
  return [4, parseBody(output.body, context)];
2300
1968
  case 1:
2301
1969
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2302
- if (data.arn !== undefined && data.arn !== null) {
1970
+ if (data.arn != null) {
2303
1971
  contents.arn = __expectString(data.arn);
2304
1972
  }
2305
- if (data.capabilities !== undefined && data.capabilities !== null) {
1973
+ if (data.capabilities != null) {
2306
1974
  contents.capabilities = deserializeAws_restJson1SceneCapabilities(data.capabilities, context);
2307
1975
  }
2308
- if (data.contentLocation !== undefined && data.contentLocation !== null) {
1976
+ if (data.contentLocation != null) {
2309
1977
  contents.contentLocation = __expectString(data.contentLocation);
2310
1978
  }
2311
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
1979
+ if (data.creationDateTime != null) {
2312
1980
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
2313
1981
  }
2314
- if (data.description !== undefined && data.description !== null) {
1982
+ if (data.description != null) {
2315
1983
  contents.description = __expectString(data.description);
2316
1984
  }
2317
- if (data.sceneId !== undefined && data.sceneId !== null) {
1985
+ if (data.sceneId != null) {
2318
1986
  contents.sceneId = __expectString(data.sceneId);
2319
1987
  }
2320
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
1988
+ if (data.updateDateTime != null) {
2321
1989
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
2322
1990
  }
2323
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
1991
+ if (data.workspaceId != null) {
2324
1992
  contents.workspaceId = __expectString(data.workspaceId);
2325
1993
  }
2326
- return [2, Promise.resolve(contents)];
1994
+ return [2, contents];
2327
1995
  }
2328
1996
  });
2329
1997
  }); };
2330
1998
  var deserializeAws_restJson1GetSceneCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2331
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1999
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2332
2000
  var _c;
2333
2001
  return __generator(this, function (_d) {
2334
2002
  switch (_d.label) {
@@ -2365,14 +2033,14 @@ var deserializeAws_restJson1GetSceneCommandError = function (output, context) {
2365
2033
  case 11: throw _d.sent();
2366
2034
  case 12:
2367
2035
  parsedBody = parsedOutput.body;
2368
- $metadata = deserializeMetadata(output);
2369
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2370
- response = new __BaseException({
2371
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2372
- $fault: "client",
2373
- $metadata: $metadata,
2036
+ throwDefaultError({
2037
+ output: output,
2038
+ parsedBody: parsedBody,
2039
+ exceptionCtor: __BaseException,
2040
+ errorCode: errorCode,
2374
2041
  });
2375
- throw __decorateServiceException(response, parsedBody);
2042
+ _d.label = 13;
2043
+ case 13: return [2];
2376
2044
  }
2377
2045
  });
2378
2046
  }); };
@@ -2384,48 +2052,41 @@ export var deserializeAws_restJson1GetWorkspaceCommand = function (output, conte
2384
2052
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2385
2053
  return [2, deserializeAws_restJson1GetWorkspaceCommandError(output, context)];
2386
2054
  }
2387
- contents = {
2055
+ contents = map({
2388
2056
  $metadata: deserializeMetadata(output),
2389
- arn: undefined,
2390
- creationDateTime: undefined,
2391
- description: undefined,
2392
- role: undefined,
2393
- s3Location: undefined,
2394
- updateDateTime: undefined,
2395
- workspaceId: undefined,
2396
- };
2057
+ });
2397
2058
  _a = __expectNonNull;
2398
2059
  _b = __expectObject;
2399
2060
  return [4, parseBody(output.body, context)];
2400
2061
  case 1:
2401
2062
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2402
- if (data.arn !== undefined && data.arn !== null) {
2063
+ if (data.arn != null) {
2403
2064
  contents.arn = __expectString(data.arn);
2404
2065
  }
2405
- if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
2066
+ if (data.creationDateTime != null) {
2406
2067
  contents.creationDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.creationDateTime)));
2407
2068
  }
2408
- if (data.description !== undefined && data.description !== null) {
2069
+ if (data.description != null) {
2409
2070
  contents.description = __expectString(data.description);
2410
2071
  }
2411
- if (data.role !== undefined && data.role !== null) {
2072
+ if (data.role != null) {
2412
2073
  contents.role = __expectString(data.role);
2413
2074
  }
2414
- if (data.s3Location !== undefined && data.s3Location !== null) {
2075
+ if (data.s3Location != null) {
2415
2076
  contents.s3Location = __expectString(data.s3Location);
2416
2077
  }
2417
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2078
+ if (data.updateDateTime != null) {
2418
2079
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
2419
2080
  }
2420
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
2081
+ if (data.workspaceId != null) {
2421
2082
  contents.workspaceId = __expectString(data.workspaceId);
2422
2083
  }
2423
- return [2, Promise.resolve(contents)];
2084
+ return [2, contents];
2424
2085
  }
2425
2086
  });
2426
2087
  }); };
2427
2088
  var deserializeAws_restJson1GetWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2428
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2089
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2429
2090
  var _c;
2430
2091
  return __generator(this, function (_d) {
2431
2092
  switch (_d.label) {
@@ -2462,14 +2123,14 @@ var deserializeAws_restJson1GetWorkspaceCommandError = function (output, context
2462
2123
  case 11: throw _d.sent();
2463
2124
  case 12:
2464
2125
  parsedBody = parsedOutput.body;
2465
- $metadata = deserializeMetadata(output);
2466
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2467
- response = new __BaseException({
2468
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2469
- $fault: "client",
2470
- $metadata: $metadata,
2126
+ throwDefaultError({
2127
+ output: output,
2128
+ parsedBody: parsedBody,
2129
+ exceptionCtor: __BaseException,
2130
+ errorCode: errorCode,
2471
2131
  });
2472
- throw __decorateServiceException(response, parsedBody);
2132
+ _d.label = 13;
2133
+ case 13: return [2];
2473
2134
  }
2474
2135
  });
2475
2136
  }); };
@@ -2481,36 +2142,32 @@ export var deserializeAws_restJson1ListComponentTypesCommand = function (output,
2481
2142
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2482
2143
  return [2, deserializeAws_restJson1ListComponentTypesCommandError(output, context)];
2483
2144
  }
2484
- contents = {
2145
+ contents = map({
2485
2146
  $metadata: deserializeMetadata(output),
2486
- componentTypeSummaries: undefined,
2487
- maxResults: undefined,
2488
- nextToken: undefined,
2489
- workspaceId: undefined,
2490
- };
2147
+ });
2491
2148
  _a = __expectNonNull;
2492
2149
  _b = __expectObject;
2493
2150
  return [4, parseBody(output.body, context)];
2494
2151
  case 1:
2495
2152
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2496
- if (data.componentTypeSummaries !== undefined && data.componentTypeSummaries !== null) {
2153
+ if (data.componentTypeSummaries != null) {
2497
2154
  contents.componentTypeSummaries = deserializeAws_restJson1ComponentTypeSummaries(data.componentTypeSummaries, context);
2498
2155
  }
2499
- if (data.maxResults !== undefined && data.maxResults !== null) {
2156
+ if (data.maxResults != null) {
2500
2157
  contents.maxResults = __expectInt32(data.maxResults);
2501
2158
  }
2502
- if (data.nextToken !== undefined && data.nextToken !== null) {
2159
+ if (data.nextToken != null) {
2503
2160
  contents.nextToken = __expectString(data.nextToken);
2504
2161
  }
2505
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
2162
+ if (data.workspaceId != null) {
2506
2163
  contents.workspaceId = __expectString(data.workspaceId);
2507
2164
  }
2508
- return [2, Promise.resolve(contents)];
2165
+ return [2, contents];
2509
2166
  }
2510
2167
  });
2511
2168
  }); };
2512
2169
  var deserializeAws_restJson1ListComponentTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2513
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2170
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2514
2171
  var _c;
2515
2172
  return __generator(this, function (_d) {
2516
2173
  switch (_d.label) {
@@ -2543,14 +2200,14 @@ var deserializeAws_restJson1ListComponentTypesCommandError = function (output, c
2543
2200
  case 9: throw _d.sent();
2544
2201
  case 10:
2545
2202
  parsedBody = parsedOutput.body;
2546
- $metadata = deserializeMetadata(output);
2547
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2548
- response = new __BaseException({
2549
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2550
- $fault: "client",
2551
- $metadata: $metadata,
2203
+ throwDefaultError({
2204
+ output: output,
2205
+ parsedBody: parsedBody,
2206
+ exceptionCtor: __BaseException,
2207
+ errorCode: errorCode,
2552
2208
  });
2553
- throw __decorateServiceException(response, parsedBody);
2209
+ _d.label = 11;
2210
+ case 11: return [2];
2554
2211
  }
2555
2212
  });
2556
2213
  }); };
@@ -2562,28 +2219,26 @@ export var deserializeAws_restJson1ListEntitiesCommand = function (output, conte
2562
2219
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2563
2220
  return [2, deserializeAws_restJson1ListEntitiesCommandError(output, context)];
2564
2221
  }
2565
- contents = {
2222
+ contents = map({
2566
2223
  $metadata: deserializeMetadata(output),
2567
- entitySummaries: undefined,
2568
- nextToken: undefined,
2569
- };
2224
+ });
2570
2225
  _a = __expectNonNull;
2571
2226
  _b = __expectObject;
2572
2227
  return [4, parseBody(output.body, context)];
2573
2228
  case 1:
2574
2229
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2575
- if (data.entitySummaries !== undefined && data.entitySummaries !== null) {
2230
+ if (data.entitySummaries != null) {
2576
2231
  contents.entitySummaries = deserializeAws_restJson1EntitySummaries(data.entitySummaries, context);
2577
2232
  }
2578
- if (data.nextToken !== undefined && data.nextToken !== null) {
2233
+ if (data.nextToken != null) {
2579
2234
  contents.nextToken = __expectString(data.nextToken);
2580
2235
  }
2581
- return [2, Promise.resolve(contents)];
2236
+ return [2, contents];
2582
2237
  }
2583
2238
  });
2584
2239
  }); };
2585
2240
  var deserializeAws_restJson1ListEntitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2586
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2241
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2587
2242
  var _c;
2588
2243
  return __generator(this, function (_d) {
2589
2244
  switch (_d.label) {
@@ -2616,14 +2271,14 @@ var deserializeAws_restJson1ListEntitiesCommandError = function (output, context
2616
2271
  case 9: throw _d.sent();
2617
2272
  case 10:
2618
2273
  parsedBody = parsedOutput.body;
2619
- $metadata = deserializeMetadata(output);
2620
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2621
- response = new __BaseException({
2622
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2623
- $fault: "client",
2624
- $metadata: $metadata,
2274
+ throwDefaultError({
2275
+ output: output,
2276
+ parsedBody: parsedBody,
2277
+ exceptionCtor: __BaseException,
2278
+ errorCode: errorCode,
2625
2279
  });
2626
- throw __decorateServiceException(response, parsedBody);
2280
+ _d.label = 11;
2281
+ case 11: return [2];
2627
2282
  }
2628
2283
  });
2629
2284
  }); };
@@ -2635,28 +2290,26 @@ export var deserializeAws_restJson1ListScenesCommand = function (output, context
2635
2290
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2636
2291
  return [2, deserializeAws_restJson1ListScenesCommandError(output, context)];
2637
2292
  }
2638
- contents = {
2293
+ contents = map({
2639
2294
  $metadata: deserializeMetadata(output),
2640
- nextToken: undefined,
2641
- sceneSummaries: undefined,
2642
- };
2295
+ });
2643
2296
  _a = __expectNonNull;
2644
2297
  _b = __expectObject;
2645
2298
  return [4, parseBody(output.body, context)];
2646
2299
  case 1:
2647
2300
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2648
- if (data.nextToken !== undefined && data.nextToken !== null) {
2301
+ if (data.nextToken != null) {
2649
2302
  contents.nextToken = __expectString(data.nextToken);
2650
2303
  }
2651
- if (data.sceneSummaries !== undefined && data.sceneSummaries !== null) {
2304
+ if (data.sceneSummaries != null) {
2652
2305
  contents.sceneSummaries = deserializeAws_restJson1SceneSummaries(data.sceneSummaries, context);
2653
2306
  }
2654
- return [2, Promise.resolve(contents)];
2307
+ return [2, contents];
2655
2308
  }
2656
2309
  });
2657
2310
  }); };
2658
2311
  var deserializeAws_restJson1ListScenesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2659
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2312
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2660
2313
  var _c;
2661
2314
  return __generator(this, function (_d) {
2662
2315
  switch (_d.label) {
@@ -2689,14 +2342,14 @@ var deserializeAws_restJson1ListScenesCommandError = function (output, context)
2689
2342
  case 9: throw _d.sent();
2690
2343
  case 10:
2691
2344
  parsedBody = parsedOutput.body;
2692
- $metadata = deserializeMetadata(output);
2693
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2694
- response = new __BaseException({
2695
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2696
- $fault: "client",
2697
- $metadata: $metadata,
2345
+ throwDefaultError({
2346
+ output: output,
2347
+ parsedBody: parsedBody,
2348
+ exceptionCtor: __BaseException,
2349
+ errorCode: errorCode,
2698
2350
  });
2699
- throw __decorateServiceException(response, parsedBody);
2351
+ _d.label = 11;
2352
+ case 11: return [2];
2700
2353
  }
2701
2354
  });
2702
2355
  }); };
@@ -2708,28 +2361,26 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2708
2361
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2709
2362
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2710
2363
  }
2711
- contents = {
2364
+ contents = map({
2712
2365
  $metadata: deserializeMetadata(output),
2713
- nextToken: undefined,
2714
- tags: undefined,
2715
- };
2366
+ });
2716
2367
  _a = __expectNonNull;
2717
2368
  _b = __expectObject;
2718
2369
  return [4, parseBody(output.body, context)];
2719
2370
  case 1:
2720
2371
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2721
- if (data.nextToken !== undefined && data.nextToken !== null) {
2372
+ if (data.nextToken != null) {
2722
2373
  contents.nextToken = __expectString(data.nextToken);
2723
2374
  }
2724
- if (data.tags !== undefined && data.tags !== null) {
2375
+ if (data.tags != null) {
2725
2376
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
2726
2377
  }
2727
- return [2, Promise.resolve(contents)];
2378
+ return [2, contents];
2728
2379
  }
2729
2380
  });
2730
2381
  }); };
2731
2382
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2732
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2383
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2733
2384
  var _c;
2734
2385
  return __generator(this, function (_d) {
2735
2386
  switch (_d.label) {
@@ -2754,14 +2405,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2754
2405
  case 5: throw _d.sent();
2755
2406
  case 6:
2756
2407
  parsedBody = parsedOutput.body;
2757
- $metadata = deserializeMetadata(output);
2758
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2759
- response = new __BaseException({
2760
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2761
- $fault: "client",
2762
- $metadata: $metadata,
2408
+ throwDefaultError({
2409
+ output: output,
2410
+ parsedBody: parsedBody,
2411
+ exceptionCtor: __BaseException,
2412
+ errorCode: errorCode,
2763
2413
  });
2764
- throw __decorateServiceException(response, parsedBody);
2414
+ _d.label = 7;
2415
+ case 7: return [2];
2765
2416
  }
2766
2417
  });
2767
2418
  }); };
@@ -2773,28 +2424,26 @@ export var deserializeAws_restJson1ListWorkspacesCommand = function (output, con
2773
2424
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2774
2425
  return [2, deserializeAws_restJson1ListWorkspacesCommandError(output, context)];
2775
2426
  }
2776
- contents = {
2427
+ contents = map({
2777
2428
  $metadata: deserializeMetadata(output),
2778
- nextToken: undefined,
2779
- workspaceSummaries: undefined,
2780
- };
2429
+ });
2781
2430
  _a = __expectNonNull;
2782
2431
  _b = __expectObject;
2783
2432
  return [4, parseBody(output.body, context)];
2784
2433
  case 1:
2785
2434
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2786
- if (data.nextToken !== undefined && data.nextToken !== null) {
2435
+ if (data.nextToken != null) {
2787
2436
  contents.nextToken = __expectString(data.nextToken);
2788
2437
  }
2789
- if (data.workspaceSummaries !== undefined && data.workspaceSummaries !== null) {
2438
+ if (data.workspaceSummaries != null) {
2790
2439
  contents.workspaceSummaries = deserializeAws_restJson1WorkspaceSummaries(data.workspaceSummaries, context);
2791
2440
  }
2792
- return [2, Promise.resolve(contents)];
2441
+ return [2, contents];
2793
2442
  }
2794
2443
  });
2795
2444
  }); };
2796
2445
  var deserializeAws_restJson1ListWorkspacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2797
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2446
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2798
2447
  var _c;
2799
2448
  return __generator(this, function (_d) {
2800
2449
  switch (_d.label) {
@@ -2827,14 +2476,14 @@ var deserializeAws_restJson1ListWorkspacesCommandError = function (output, conte
2827
2476
  case 9: throw _d.sent();
2828
2477
  case 10:
2829
2478
  parsedBody = parsedOutput.body;
2830
- $metadata = deserializeMetadata(output);
2831
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2832
- response = new __BaseException({
2833
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2834
- $fault: "client",
2835
- $metadata: $metadata,
2479
+ throwDefaultError({
2480
+ output: output,
2481
+ parsedBody: parsedBody,
2482
+ exceptionCtor: __BaseException,
2483
+ errorCode: errorCode,
2836
2484
  });
2837
- throw __decorateServiceException(response, parsedBody);
2485
+ _d.label = 11;
2486
+ case 11: return [2];
2838
2487
  }
2839
2488
  });
2840
2489
  }); };
@@ -2846,18 +2495,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2846
2495
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2847
2496
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2848
2497
  }
2849
- contents = {
2498
+ contents = map({
2850
2499
  $metadata: deserializeMetadata(output),
2851
- };
2500
+ });
2852
2501
  return [4, collectBody(output.body, context)];
2853
2502
  case 1:
2854
2503
  _a.sent();
2855
- return [2, Promise.resolve(contents)];
2504
+ return [2, contents];
2856
2505
  }
2857
2506
  });
2858
2507
  }); };
2859
2508
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2860
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2509
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2861
2510
  var _c;
2862
2511
  return __generator(this, function (_d) {
2863
2512
  switch (_d.label) {
@@ -2886,14 +2535,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2886
2535
  case 7: throw _d.sent();
2887
2536
  case 8:
2888
2537
  parsedBody = parsedOutput.body;
2889
- $metadata = deserializeMetadata(output);
2890
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2891
- response = new __BaseException({
2892
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2893
- $fault: "client",
2894
- $metadata: $metadata,
2538
+ throwDefaultError({
2539
+ output: output,
2540
+ parsedBody: parsedBody,
2541
+ exceptionCtor: __BaseException,
2542
+ errorCode: errorCode,
2895
2543
  });
2896
- throw __decorateServiceException(response, parsedBody);
2544
+ _d.label = 9;
2545
+ case 9: return [2];
2897
2546
  }
2898
2547
  });
2899
2548
  }); };
@@ -2905,18 +2554,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2905
2554
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2906
2555
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2907
2556
  }
2908
- contents = {
2557
+ contents = map({
2909
2558
  $metadata: deserializeMetadata(output),
2910
- };
2559
+ });
2911
2560
  return [4, collectBody(output.body, context)];
2912
2561
  case 1:
2913
2562
  _a.sent();
2914
- return [2, Promise.resolve(contents)];
2563
+ return [2, contents];
2915
2564
  }
2916
2565
  });
2917
2566
  }); };
2918
2567
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2919
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2568
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2920
2569
  var _c;
2921
2570
  return __generator(this, function (_d) {
2922
2571
  switch (_d.label) {
@@ -2941,14 +2590,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2941
2590
  case 5: throw _d.sent();
2942
2591
  case 6:
2943
2592
  parsedBody = parsedOutput.body;
2944
- $metadata = deserializeMetadata(output);
2945
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2946
- response = new __BaseException({
2947
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2948
- $fault: "client",
2949
- $metadata: $metadata,
2593
+ throwDefaultError({
2594
+ output: output,
2595
+ parsedBody: parsedBody,
2596
+ exceptionCtor: __BaseException,
2597
+ errorCode: errorCode,
2950
2598
  });
2951
- throw __decorateServiceException(response, parsedBody);
2599
+ _d.label = 7;
2600
+ case 7: return [2];
2952
2601
  }
2953
2602
  });
2954
2603
  }); };
@@ -2960,36 +2609,32 @@ export var deserializeAws_restJson1UpdateComponentTypeCommand = function (output
2960
2609
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2961
2610
  return [2, deserializeAws_restJson1UpdateComponentTypeCommandError(output, context)];
2962
2611
  }
2963
- contents = {
2612
+ contents = map({
2964
2613
  $metadata: deserializeMetadata(output),
2965
- arn: undefined,
2966
- componentTypeId: undefined,
2967
- state: undefined,
2968
- workspaceId: undefined,
2969
- };
2614
+ });
2970
2615
  _a = __expectNonNull;
2971
2616
  _b = __expectObject;
2972
2617
  return [4, parseBody(output.body, context)];
2973
2618
  case 1:
2974
2619
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2975
- if (data.arn !== undefined && data.arn !== null) {
2620
+ if (data.arn != null) {
2976
2621
  contents.arn = __expectString(data.arn);
2977
2622
  }
2978
- if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
2623
+ if (data.componentTypeId != null) {
2979
2624
  contents.componentTypeId = __expectString(data.componentTypeId);
2980
2625
  }
2981
- if (data.state !== undefined && data.state !== null) {
2626
+ if (data.state != null) {
2982
2627
  contents.state = __expectString(data.state);
2983
2628
  }
2984
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
2629
+ if (data.workspaceId != null) {
2985
2630
  contents.workspaceId = __expectString(data.workspaceId);
2986
2631
  }
2987
- return [2, Promise.resolve(contents)];
2632
+ return [2, contents];
2988
2633
  }
2989
2634
  });
2990
2635
  }); };
2991
2636
  var deserializeAws_restJson1UpdateComponentTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2992
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2637
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2993
2638
  var _c;
2994
2639
  return __generator(this, function (_d) {
2995
2640
  switch (_d.label) {
@@ -3030,14 +2675,14 @@ var deserializeAws_restJson1UpdateComponentTypeCommandError = function (output,
3030
2675
  case 13: throw _d.sent();
3031
2676
  case 14:
3032
2677
  parsedBody = parsedOutput.body;
3033
- $metadata = deserializeMetadata(output);
3034
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3035
- response = new __BaseException({
3036
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3037
- $fault: "client",
3038
- $metadata: $metadata,
2678
+ throwDefaultError({
2679
+ output: output,
2680
+ parsedBody: parsedBody,
2681
+ exceptionCtor: __BaseException,
2682
+ errorCode: errorCode,
3039
2683
  });
3040
- throw __decorateServiceException(response, parsedBody);
2684
+ _d.label = 15;
2685
+ case 15: return [2];
3041
2686
  }
3042
2687
  });
3043
2688
  }); };
@@ -3049,28 +2694,26 @@ export var deserializeAws_restJson1UpdateEntityCommand = function (output, conte
3049
2694
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3050
2695
  return [2, deserializeAws_restJson1UpdateEntityCommandError(output, context)];
3051
2696
  }
3052
- contents = {
2697
+ contents = map({
3053
2698
  $metadata: deserializeMetadata(output),
3054
- state: undefined,
3055
- updateDateTime: undefined,
3056
- };
2699
+ });
3057
2700
  _a = __expectNonNull;
3058
2701
  _b = __expectObject;
3059
2702
  return [4, parseBody(output.body, context)];
3060
2703
  case 1:
3061
2704
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3062
- if (data.state !== undefined && data.state !== null) {
2705
+ if (data.state != null) {
3063
2706
  contents.state = __expectString(data.state);
3064
2707
  }
3065
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2708
+ if (data.updateDateTime != null) {
3066
2709
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
3067
2710
  }
3068
- return [2, Promise.resolve(contents)];
2711
+ return [2, contents];
3069
2712
  }
3070
2713
  });
3071
2714
  }); };
3072
2715
  var deserializeAws_restJson1UpdateEntityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3073
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2716
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3074
2717
  var _c;
3075
2718
  return __generator(this, function (_d) {
3076
2719
  switch (_d.label) {
@@ -3115,14 +2758,14 @@ var deserializeAws_restJson1UpdateEntityCommandError = function (output, context
3115
2758
  case 15: throw _d.sent();
3116
2759
  case 16:
3117
2760
  parsedBody = parsedOutput.body;
3118
- $metadata = deserializeMetadata(output);
3119
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3120
- response = new __BaseException({
3121
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3122
- $fault: "client",
3123
- $metadata: $metadata,
2761
+ throwDefaultError({
2762
+ output: output,
2763
+ parsedBody: parsedBody,
2764
+ exceptionCtor: __BaseException,
2765
+ errorCode: errorCode,
3124
2766
  });
3125
- throw __decorateServiceException(response, parsedBody);
2767
+ _d.label = 17;
2768
+ case 17: return [2];
3126
2769
  }
3127
2770
  });
3128
2771
  }); };
@@ -3134,24 +2777,23 @@ export var deserializeAws_restJson1UpdateSceneCommand = function (output, contex
3134
2777
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3135
2778
  return [2, deserializeAws_restJson1UpdateSceneCommandError(output, context)];
3136
2779
  }
3137
- contents = {
2780
+ contents = map({
3138
2781
  $metadata: deserializeMetadata(output),
3139
- updateDateTime: undefined,
3140
- };
2782
+ });
3141
2783
  _a = __expectNonNull;
3142
2784
  _b = __expectObject;
3143
2785
  return [4, parseBody(output.body, context)];
3144
2786
  case 1:
3145
2787
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3146
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2788
+ if (data.updateDateTime != null) {
3147
2789
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
3148
2790
  }
3149
- return [2, Promise.resolve(contents)];
2791
+ return [2, contents];
3150
2792
  }
3151
2793
  });
3152
2794
  }); };
3153
2795
  var deserializeAws_restJson1UpdateSceneCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3154
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2796
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3155
2797
  var _c;
3156
2798
  return __generator(this, function (_d) {
3157
2799
  switch (_d.label) {
@@ -3188,14 +2830,14 @@ var deserializeAws_restJson1UpdateSceneCommandError = function (output, context)
3188
2830
  case 11: throw _d.sent();
3189
2831
  case 12:
3190
2832
  parsedBody = parsedOutput.body;
3191
- $metadata = deserializeMetadata(output);
3192
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3193
- response = new __BaseException({
3194
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3195
- $fault: "client",
3196
- $metadata: $metadata,
2833
+ throwDefaultError({
2834
+ output: output,
2835
+ parsedBody: parsedBody,
2836
+ exceptionCtor: __BaseException,
2837
+ errorCode: errorCode,
3197
2838
  });
3198
- throw __decorateServiceException(response, parsedBody);
2839
+ _d.label = 13;
2840
+ case 13: return [2];
3199
2841
  }
3200
2842
  });
3201
2843
  }); };
@@ -3207,24 +2849,23 @@ export var deserializeAws_restJson1UpdateWorkspaceCommand = function (output, co
3207
2849
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3208
2850
  return [2, deserializeAws_restJson1UpdateWorkspaceCommandError(output, context)];
3209
2851
  }
3210
- contents = {
2852
+ contents = map({
3211
2853
  $metadata: deserializeMetadata(output),
3212
- updateDateTime: undefined,
3213
- };
2854
+ });
3214
2855
  _a = __expectNonNull;
3215
2856
  _b = __expectObject;
3216
2857
  return [4, parseBody(output.body, context)];
3217
2858
  case 1:
3218
2859
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3219
- if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
2860
+ if (data.updateDateTime != null) {
3220
2861
  contents.updateDateTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.updateDateTime)));
3221
2862
  }
3222
- return [2, Promise.resolve(contents)];
2863
+ return [2, contents];
3223
2864
  }
3224
2865
  });
3225
2866
  }); };
3226
2867
  var deserializeAws_restJson1UpdateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3227
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2868
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3228
2869
  var _c;
3229
2870
  return __generator(this, function (_d) {
3230
2871
  switch (_d.label) {
@@ -3265,23 +2906,24 @@ var deserializeAws_restJson1UpdateWorkspaceCommandError = function (output, cont
3265
2906
  case 13: throw _d.sent();
3266
2907
  case 14:
3267
2908
  parsedBody = parsedOutput.body;
3268
- $metadata = deserializeMetadata(output);
3269
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3270
- response = new __BaseException({
3271
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3272
- $fault: "client",
3273
- $metadata: $metadata,
2909
+ throwDefaultError({
2910
+ output: output,
2911
+ parsedBody: parsedBody,
2912
+ exceptionCtor: __BaseException,
2913
+ errorCode: errorCode,
3274
2914
  });
3275
- throw __decorateServiceException(response, parsedBody);
2915
+ _d.label = 15;
2916
+ case 15: return [2];
3276
2917
  }
3277
2918
  });
3278
2919
  }); };
2920
+ var map = __map;
3279
2921
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3280
2922
  var contents, data, exception;
3281
2923
  return __generator(this, function (_a) {
3282
- contents = {};
2924
+ contents = map({});
3283
2925
  data = parsedOutput.body;
3284
- if (data.message !== undefined && data.message !== null) {
2926
+ if (data.message != null) {
3285
2927
  contents.message = __expectString(data.message);
3286
2928
  }
3287
2929
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3291,9 +2933,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3291
2933
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3292
2934
  var contents, data, exception;
3293
2935
  return __generator(this, function (_a) {
3294
- contents = {};
2936
+ contents = map({});
3295
2937
  data = parsedOutput.body;
3296
- if (data.message !== undefined && data.message !== null) {
2938
+ if (data.message != null) {
3297
2939
  contents.message = __expectString(data.message);
3298
2940
  }
3299
2941
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3303,9 +2945,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3303
2945
  var deserializeAws_restJson1ConnectorFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3304
2946
  var contents, data, exception;
3305
2947
  return __generator(this, function (_a) {
3306
- contents = {};
2948
+ contents = map({});
3307
2949
  data = parsedOutput.body;
3308
- if (data.message !== undefined && data.message !== null) {
2950
+ if (data.message != null) {
3309
2951
  contents.message = __expectString(data.message);
3310
2952
  }
3311
2953
  exception = new ConnectorFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3315,9 +2957,9 @@ var deserializeAws_restJson1ConnectorFailureExceptionResponse = function (parsed
3315
2957
  var deserializeAws_restJson1ConnectorTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3316
2958
  var contents, data, exception;
3317
2959
  return __generator(this, function (_a) {
3318
- contents = {};
2960
+ contents = map({});
3319
2961
  data = parsedOutput.body;
3320
- if (data.message !== undefined && data.message !== null) {
2962
+ if (data.message != null) {
3321
2963
  contents.message = __expectString(data.message);
3322
2964
  }
3323
2965
  exception = new ConnectorTimeoutException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3327,9 +2969,9 @@ var deserializeAws_restJson1ConnectorTimeoutExceptionResponse = function (parsed
3327
2969
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3328
2970
  var contents, data, exception;
3329
2971
  return __generator(this, function (_a) {
3330
- contents = {};
2972
+ contents = map({});
3331
2973
  data = parsedOutput.body;
3332
- if (data.message !== undefined && data.message !== null) {
2974
+ if (data.message != null) {
3333
2975
  contents.message = __expectString(data.message);
3334
2976
  }
3335
2977
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3339,9 +2981,9 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
3339
2981
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3340
2982
  var contents, data, exception;
3341
2983
  return __generator(this, function (_a) {
3342
- contents = {};
2984
+ contents = map({});
3343
2985
  data = parsedOutput.body;
3344
- if (data.message !== undefined && data.message !== null) {
2986
+ if (data.message != null) {
3345
2987
  contents.message = __expectString(data.message);
3346
2988
  }
3347
2989
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3351,9 +2993,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3351
2993
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3352
2994
  var contents, data, exception;
3353
2995
  return __generator(this, function (_a) {
3354
- contents = {};
2996
+ contents = map({});
3355
2997
  data = parsedOutput.body;
3356
- if (data.message !== undefined && data.message !== null) {
2998
+ if (data.message != null) {
3357
2999
  contents.message = __expectString(data.message);
3358
3000
  }
3359
3001
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3363,9 +3005,9 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
3363
3005
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3364
3006
  var contents, data, exception;
3365
3007
  return __generator(this, function (_a) {
3366
- contents = {};
3008
+ contents = map({});
3367
3009
  data = parsedOutput.body;
3368
- if (data.message !== undefined && data.message !== null) {
3010
+ if (data.message != null) {
3369
3011
  contents.message = __expectString(data.message);
3370
3012
  }
3371
3013
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3375,9 +3017,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
3375
3017
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3376
3018
  var contents, data, exception;
3377
3019
  return __generator(this, function (_a) {
3378
- contents = {};
3020
+ contents = map({});
3379
3021
  data = parsedOutput.body;
3380
- if (data.message !== undefined && data.message !== null) {
3022
+ if (data.message != null) {
3381
3023
  contents.message = __expectString(data.message);
3382
3024
  }
3383
3025
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3387,9 +3029,9 @@ var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutpu
3387
3029
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3388
3030
  var contents, data, exception;
3389
3031
  return __generator(this, function (_a) {
3390
- contents = {};
3032
+ contents = map({});
3391
3033
  data = parsedOutput.body;
3392
- if (data.message !== undefined && data.message !== null) {
3034
+ if (data.message != null) {
3393
3035
  contents.message = __expectString(data.message);
3394
3036
  }
3395
3037
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3453,9 +3095,6 @@ var serializeAws_restJson1DataValueList = function (input, context) {
3453
3095
  return input
3454
3096
  .filter(function (e) { return e != null; })
3455
3097
  .map(function (entry) {
3456
- if (entry === null) {
3457
- return null;
3458
- }
3459
3098
  return serializeAws_restJson1DataValue(entry, context);
3460
3099
  });
3461
3100
  };
@@ -3478,9 +3117,6 @@ var serializeAws_restJson1Entries = function (input, context) {
3478
3117
  return input
3479
3118
  .filter(function (e) { return e != null; })
3480
3119
  .map(function (entry) {
3481
- if (entry === null) {
3482
- return null;
3483
- }
3484
3120
  return serializeAws_restJson1PropertyValueEntry(entry, context);
3485
3121
  });
3486
3122
  };
@@ -3488,9 +3124,6 @@ var serializeAws_restJson1ExtendsFrom = function (input, context) {
3488
3124
  return input
3489
3125
  .filter(function (e) { return e != null; })
3490
3126
  .map(function (entry) {
3491
- if (entry === null) {
3492
- return null;
3493
- }
3494
3127
  return entry;
3495
3128
  });
3496
3129
  };
@@ -3539,9 +3172,6 @@ var serializeAws_restJson1ListComponentTypesFilters = function (input, context)
3539
3172
  return input
3540
3173
  .filter(function (e) { return e != null; })
3541
3174
  .map(function (entry) {
3542
- if (entry === null) {
3543
- return null;
3544
- }
3545
3175
  return serializeAws_restJson1ListComponentTypesFilter(entry, context);
3546
3176
  });
3547
3177
  };
@@ -3557,9 +3187,6 @@ var serializeAws_restJson1ListEntitiesFilters = function (input, context) {
3557
3187
  return input
3558
3188
  .filter(function (e) { return e != null; })
3559
3189
  .map(function (entry) {
3560
- if (entry === null) {
3561
- return null;
3562
- }
3563
3190
  return serializeAws_restJson1ListEntitiesFilter(entry, context);
3564
3191
  });
3565
3192
  };
@@ -3588,9 +3215,6 @@ var serializeAws_restJson1PropertyFilters = function (input, context) {
3588
3215
  return input
3589
3216
  .filter(function (e) { return e != null; })
3590
3217
  .map(function (entry) {
3591
- if (entry === null) {
3592
- return null;
3593
- }
3594
3218
  return serializeAws_restJson1PropertyFilter(entry, context);
3595
3219
  });
3596
3220
  };
@@ -3623,9 +3247,6 @@ var serializeAws_restJson1PropertyValues = function (input, context) {
3623
3247
  return input
3624
3248
  .filter(function (e) { return e != null; })
3625
3249
  .map(function (entry) {
3626
- if (entry === null) {
3627
- return null;
3628
- }
3629
3250
  return serializeAws_restJson1PropertyValue(entry, context);
3630
3251
  });
3631
3252
  };
@@ -3639,9 +3260,6 @@ var serializeAws_restJson1RequiredProperties = function (input, context) {
3639
3260
  return input
3640
3261
  .filter(function (e) { return e != null; })
3641
3262
  .map(function (entry) {
3642
- if (entry === null) {
3643
- return null;
3644
- }
3645
3263
  return entry;
3646
3264
  });
3647
3265
  };
@@ -3649,9 +3267,6 @@ var serializeAws_restJson1SceneCapabilities = function (input, context) {
3649
3267
  return input
3650
3268
  .filter(function (e) { return e != null; })
3651
3269
  .map(function (entry) {
3652
- if (entry === null) {
3653
- return null;
3654
- }
3655
3270
  return entry;
3656
3271
  });
3657
3272
  };
@@ -3659,9 +3274,6 @@ var serializeAws_restJson1SelectedPropertyList = function (input, context) {
3659
3274
  return input
3660
3275
  .filter(function (e) { return e != null; })
3661
3276
  .map(function (entry) {
3662
- if (entry === null) {
3663
- return null;
3664
- }
3665
3277
  return entry;
3666
3278
  });
3667
3279
  };