@aws-sdk/client-iot-events 3.141.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,16 +101,7 @@ const serializeAws_restJson1DeleteAlarmModelCommand = async (input, context) =>
101
101
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
102
102
  const headers = {};
103
103
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/alarm-models/{alarmModelName}";
104
- if (input.alarmModelName !== undefined) {
105
- const labelValue = input.alarmModelName;
106
- if (labelValue.length <= 0) {
107
- throw new Error("Empty value provided for input HTTP label: alarmModelName.");
108
- }
109
- resolvedPath = resolvedPath.replace("{alarmModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
110
- }
111
- else {
112
- throw new Error("No value provided for input HTTP label: alarmModelName.");
113
- }
104
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
114
105
  let body;
115
106
  return new protocol_http_1.HttpRequest({
116
107
  protocol,
@@ -127,16 +118,7 @@ const serializeAws_restJson1DeleteDetectorModelCommand = async (input, context)
127
118
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
128
119
  const headers = {};
129
120
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/detector-models/{detectorModelName}";
130
- if (input.detectorModelName !== undefined) {
131
- const labelValue = input.detectorModelName;
132
- if (labelValue.length <= 0) {
133
- throw new Error("Empty value provided for input HTTP label: detectorModelName.");
134
- }
135
- resolvedPath = resolvedPath.replace("{detectorModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
136
- }
137
- else {
138
- throw new Error("No value provided for input HTTP label: detectorModelName.");
139
- }
121
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
140
122
  let body;
141
123
  return new protocol_http_1.HttpRequest({
142
124
  protocol,
@@ -153,16 +135,7 @@ const serializeAws_restJson1DeleteInputCommand = async (input, context) => {
153
135
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
136
  const headers = {};
155
137
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/inputs/{inputName}";
156
- if (input.inputName !== undefined) {
157
- const labelValue = input.inputName;
158
- if (labelValue.length <= 0) {
159
- throw new Error("Empty value provided for input HTTP label: inputName.");
160
- }
161
- resolvedPath = resolvedPath.replace("{inputName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
162
- }
163
- else {
164
- throw new Error("No value provided for input HTTP label: inputName.");
165
- }
138
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "inputName", () => input.inputName, "{inputName}", false);
166
139
  let body;
167
140
  return new protocol_http_1.HttpRequest({
168
141
  protocol,
@@ -179,19 +152,10 @@ const serializeAws_restJson1DescribeAlarmModelCommand = async (input, context) =
179
152
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
180
153
  const headers = {};
181
154
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/alarm-models/{alarmModelName}";
182
- if (input.alarmModelName !== undefined) {
183
- const labelValue = input.alarmModelName;
184
- if (labelValue.length <= 0) {
185
- throw new Error("Empty value provided for input HTTP label: alarmModelName.");
186
- }
187
- resolvedPath = resolvedPath.replace("{alarmModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
188
- }
189
- else {
190
- throw new Error("No value provided for input HTTP label: alarmModelName.");
191
- }
192
- const query = {
193
- ...(input.alarmModelVersion !== undefined && { version: input.alarmModelVersion }),
194
- };
155
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
156
+ const query = map({
157
+ version: [, input.alarmModelVersion],
158
+ });
195
159
  let body;
196
160
  return new protocol_http_1.HttpRequest({
197
161
  protocol,
@@ -209,19 +173,10 @@ const serializeAws_restJson1DescribeDetectorModelCommand = async (input, context
209
173
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
210
174
  const headers = {};
211
175
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/detector-models/{detectorModelName}";
212
- if (input.detectorModelName !== undefined) {
213
- const labelValue = input.detectorModelName;
214
- if (labelValue.length <= 0) {
215
- throw new Error("Empty value provided for input HTTP label: detectorModelName.");
216
- }
217
- resolvedPath = resolvedPath.replace("{detectorModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
218
- }
219
- else {
220
- throw new Error("No value provided for input HTTP label: detectorModelName.");
221
- }
222
- const query = {
223
- ...(input.detectorModelVersion !== undefined && { version: input.detectorModelVersion }),
224
- };
176
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
177
+ const query = map({
178
+ version: [, input.detectorModelVersion],
179
+ });
225
180
  let body;
226
181
  return new protocol_http_1.HttpRequest({
227
182
  protocol,
@@ -239,16 +194,7 @@ const serializeAws_restJson1DescribeDetectorModelAnalysisCommand = async (input,
239
194
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
240
195
  const headers = {};
241
196
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/analysis/detector-models/{analysisId}";
242
- if (input.analysisId !== undefined) {
243
- const labelValue = input.analysisId;
244
- if (labelValue.length <= 0) {
245
- throw new Error("Empty value provided for input HTTP label: analysisId.");
246
- }
247
- resolvedPath = resolvedPath.replace("{analysisId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
248
- }
249
- else {
250
- throw new Error("No value provided for input HTTP label: analysisId.");
251
- }
197
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "analysisId", () => input.analysisId, "{analysisId}", false);
252
198
  let body;
253
199
  return new protocol_http_1.HttpRequest({
254
200
  protocol,
@@ -265,16 +211,7 @@ const serializeAws_restJson1DescribeInputCommand = async (input, context) => {
265
211
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
266
212
  const headers = {};
267
213
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/inputs/{inputName}";
268
- if (input.inputName !== undefined) {
269
- const labelValue = input.inputName;
270
- if (labelValue.length <= 0) {
271
- throw new Error("Empty value provided for input HTTP label: inputName.");
272
- }
273
- resolvedPath = resolvedPath.replace("{inputName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
274
- }
275
- else {
276
- throw new Error("No value provided for input HTTP label: inputName.");
277
- }
214
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "inputName", () => input.inputName, "{inputName}", false);
278
215
  let body;
279
216
  return new protocol_http_1.HttpRequest({
280
217
  protocol,
@@ -311,20 +248,11 @@ const serializeAws_restJson1GetDetectorModelAnalysisResultsCommand = async (inpu
311
248
  const headers = {};
312
249
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
313
250
  "/analysis/detector-models/{analysisId}/results";
314
- if (input.analysisId !== undefined) {
315
- const labelValue = input.analysisId;
316
- if (labelValue.length <= 0) {
317
- throw new Error("Empty value provided for input HTTP label: analysisId.");
318
- }
319
- resolvedPath = resolvedPath.replace("{analysisId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
320
- }
321
- else {
322
- throw new Error("No value provided for input HTTP label: analysisId.");
323
- }
324
- const query = {
325
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
326
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
327
- };
251
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "analysisId", () => input.analysisId, "{analysisId}", false);
252
+ const query = map({
253
+ nextToken: [, input.nextToken],
254
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
255
+ });
328
256
  let body;
329
257
  return new protocol_http_1.HttpRequest({
330
258
  protocol,
@@ -342,10 +270,10 @@ const serializeAws_restJson1ListAlarmModelsCommand = async (input, context) => {
342
270
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
343
271
  const headers = {};
344
272
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/alarm-models";
345
- const query = {
346
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
347
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
348
- };
273
+ const query = map({
274
+ nextToken: [, input.nextToken],
275
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
276
+ });
349
277
  let body;
350
278
  return new protocol_http_1.HttpRequest({
351
279
  protocol,
@@ -363,20 +291,11 @@ const serializeAws_restJson1ListAlarmModelVersionsCommand = async (input, contex
363
291
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
364
292
  const headers = {};
365
293
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/alarm-models/{alarmModelName}/versions";
366
- if (input.alarmModelName !== undefined) {
367
- const labelValue = input.alarmModelName;
368
- if (labelValue.length <= 0) {
369
- throw new Error("Empty value provided for input HTTP label: alarmModelName.");
370
- }
371
- resolvedPath = resolvedPath.replace("{alarmModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
372
- }
373
- else {
374
- throw new Error("No value provided for input HTTP label: alarmModelName.");
375
- }
376
- const query = {
377
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
378
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
379
- };
294
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
295
+ const query = map({
296
+ nextToken: [, input.nextToken],
297
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
298
+ });
380
299
  let body;
381
300
  return new protocol_http_1.HttpRequest({
382
301
  protocol,
@@ -394,10 +313,10 @@ const serializeAws_restJson1ListDetectorModelsCommand = async (input, context) =
394
313
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
395
314
  const headers = {};
396
315
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/detector-models";
397
- const query = {
398
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
399
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
400
- };
316
+ const query = map({
317
+ nextToken: [, input.nextToken],
318
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
319
+ });
401
320
  let body;
402
321
  return new protocol_http_1.HttpRequest({
403
322
  protocol,
@@ -416,20 +335,11 @@ const serializeAws_restJson1ListDetectorModelVersionsCommand = async (input, con
416
335
  const headers = {};
417
336
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
418
337
  "/detector-models/{detectorModelName}/versions";
419
- if (input.detectorModelName !== undefined) {
420
- const labelValue = input.detectorModelName;
421
- if (labelValue.length <= 0) {
422
- throw new Error("Empty value provided for input HTTP label: detectorModelName.");
423
- }
424
- resolvedPath = resolvedPath.replace("{detectorModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
425
- }
426
- else {
427
- throw new Error("No value provided for input HTTP label: detectorModelName.");
428
- }
429
- const query = {
430
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
431
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
432
- };
338
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
339
+ const query = map({
340
+ nextToken: [, input.nextToken],
341
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
342
+ });
433
343
  let body;
434
344
  return new protocol_http_1.HttpRequest({
435
345
  protocol,
@@ -472,10 +382,10 @@ const serializeAws_restJson1ListInputsCommand = async (input, context) => {
472
382
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
473
383
  const headers = {};
474
384
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/inputs";
475
- const query = {
476
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
477
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
478
- };
385
+ const query = map({
386
+ nextToken: [, input.nextToken],
387
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
388
+ });
479
389
  let body;
480
390
  return new protocol_http_1.HttpRequest({
481
391
  protocol,
@@ -493,9 +403,9 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
493
403
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
494
404
  const headers = {};
495
405
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
496
- const query = {
497
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
498
- };
406
+ const query = map({
407
+ resourceArn: [, input.resourceArn],
408
+ });
499
409
  let body;
500
410
  return new protocol_http_1.HttpRequest({
501
411
  protocol,
@@ -561,9 +471,9 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
561
471
  "content-type": "application/json",
562
472
  };
563
473
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
564
- const query = {
565
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
566
- };
474
+ const query = map({
475
+ resourceArn: [, input.resourceArn],
476
+ });
567
477
  let body;
568
478
  body = JSON.stringify({
569
479
  ...(input.tags != null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
@@ -584,10 +494,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
584
494
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
585
495
  const headers = {};
586
496
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
587
- const query = {
588
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
589
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
590
- };
497
+ const query = map({
498
+ resourceArn: [, input.resourceArn],
499
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
500
+ });
591
501
  let body;
592
502
  return new protocol_http_1.HttpRequest({
593
503
  protocol,
@@ -607,16 +517,7 @@ const serializeAws_restJson1UpdateAlarmModelCommand = async (input, context) =>
607
517
  "content-type": "application/json",
608
518
  };
609
519
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/alarm-models/{alarmModelName}";
610
- if (input.alarmModelName !== undefined) {
611
- const labelValue = input.alarmModelName;
612
- if (labelValue.length <= 0) {
613
- throw new Error("Empty value provided for input HTTP label: alarmModelName.");
614
- }
615
- resolvedPath = resolvedPath.replace("{alarmModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
616
- }
617
- else {
618
- throw new Error("No value provided for input HTTP label: alarmModelName.");
619
- }
520
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
620
521
  let body;
621
522
  body = JSON.stringify({
622
523
  ...(input.alarmCapabilities != null && {
@@ -650,16 +551,7 @@ const serializeAws_restJson1UpdateDetectorModelCommand = async (input, context)
650
551
  "content-type": "application/json",
651
552
  };
652
553
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/detector-models/{detectorModelName}";
653
- if (input.detectorModelName !== undefined) {
654
- const labelValue = input.detectorModelName;
655
- if (labelValue.length <= 0) {
656
- throw new Error("Empty value provided for input HTTP label: detectorModelName.");
657
- }
658
- resolvedPath = resolvedPath.replace("{detectorModelName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
659
- }
660
- else {
661
- throw new Error("No value provided for input HTTP label: detectorModelName.");
662
- }
554
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
663
555
  let body;
664
556
  body = JSON.stringify({
665
557
  ...(input.detectorModelDefinition != null && {
@@ -686,16 +578,7 @@ const serializeAws_restJson1UpdateInputCommand = async (input, context) => {
686
578
  "content-type": "application/json",
687
579
  };
688
580
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/inputs/{inputName}";
689
- if (input.inputName !== undefined) {
690
- const labelValue = input.inputName;
691
- if (labelValue.length <= 0) {
692
- throw new Error("Empty value provided for input HTTP label: inputName.");
693
- }
694
- resolvedPath = resolvedPath.replace("{inputName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
695
- }
696
- else {
697
- throw new Error("No value provided for input HTTP label: inputName.");
698
- }
581
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "inputName", () => input.inputName, "{inputName}", false);
699
582
  let body;
700
583
  body = JSON.stringify({
701
584
  ...(input.inputDefinition != null && {
@@ -718,31 +601,26 @@ const deserializeAws_restJson1CreateAlarmModelCommand = async (output, context)
718
601
  if (output.statusCode !== 200 && output.statusCode >= 300) {
719
602
  return deserializeAws_restJson1CreateAlarmModelCommandError(output, context);
720
603
  }
721
- const contents = {
604
+ const contents = map({
722
605
  $metadata: deserializeMetadata(output),
723
- alarmModelArn: undefined,
724
- alarmModelVersion: undefined,
725
- creationTime: undefined,
726
- lastUpdateTime: undefined,
727
- status: undefined,
728
- };
606
+ });
729
607
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
730
- if (data.alarmModelArn !== undefined && data.alarmModelArn !== null) {
608
+ if (data.alarmModelArn != null) {
731
609
  contents.alarmModelArn = (0, smithy_client_1.expectString)(data.alarmModelArn);
732
610
  }
733
- if (data.alarmModelVersion !== undefined && data.alarmModelVersion !== null) {
611
+ if (data.alarmModelVersion != null) {
734
612
  contents.alarmModelVersion = (0, smithy_client_1.expectString)(data.alarmModelVersion);
735
613
  }
736
- if (data.creationTime !== undefined && data.creationTime !== null) {
614
+ if (data.creationTime != null) {
737
615
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
738
616
  }
739
- if (data.lastUpdateTime !== undefined && data.lastUpdateTime !== null) {
617
+ if (data.lastUpdateTime != null) {
740
618
  contents.lastUpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastUpdateTime)));
741
619
  }
742
- if (data.status !== undefined && data.status !== null) {
620
+ if (data.status != null) {
743
621
  contents.status = (0, smithy_client_1.expectString)(data.status);
744
622
  }
745
- return Promise.resolve(contents);
623
+ return contents;
746
624
  };
747
625
  exports.deserializeAws_restJson1CreateAlarmModelCommand = deserializeAws_restJson1CreateAlarmModelCommand;
748
626
  const deserializeAws_restJson1CreateAlarmModelCommandError = async (output, context) => {
@@ -750,7 +628,6 @@ const deserializeAws_restJson1CreateAlarmModelCommandError = async (output, cont
750
628
  ...output,
751
629
  body: await parseBody(output.body, context),
752
630
  };
753
- let response;
754
631
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
755
632
  switch (errorCode) {
756
633
  case "InternalFailureException":
@@ -776,29 +653,26 @@ const deserializeAws_restJson1CreateAlarmModelCommandError = async (output, cont
776
653
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
777
654
  default:
778
655
  const parsedBody = parsedOutput.body;
779
- const $metadata = deserializeMetadata(output);
780
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
781
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
782
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
783
- $fault: "client",
784
- $metadata,
656
+ (0, smithy_client_1.throwDefaultError)({
657
+ output,
658
+ parsedBody,
659
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
660
+ errorCode,
785
661
  });
786
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
787
662
  }
788
663
  };
789
664
  const deserializeAws_restJson1CreateDetectorModelCommand = async (output, context) => {
790
665
  if (output.statusCode !== 200 && output.statusCode >= 300) {
791
666
  return deserializeAws_restJson1CreateDetectorModelCommandError(output, context);
792
667
  }
793
- const contents = {
668
+ const contents = map({
794
669
  $metadata: deserializeMetadata(output),
795
- detectorModelConfiguration: undefined,
796
- };
670
+ });
797
671
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
798
- if (data.detectorModelConfiguration !== undefined && data.detectorModelConfiguration !== null) {
672
+ if (data.detectorModelConfiguration != null) {
799
673
  contents.detectorModelConfiguration = deserializeAws_restJson1DetectorModelConfiguration(data.detectorModelConfiguration, context);
800
674
  }
801
- return Promise.resolve(contents);
675
+ return contents;
802
676
  };
803
677
  exports.deserializeAws_restJson1CreateDetectorModelCommand = deserializeAws_restJson1CreateDetectorModelCommand;
804
678
  const deserializeAws_restJson1CreateDetectorModelCommandError = async (output, context) => {
@@ -806,7 +680,6 @@ const deserializeAws_restJson1CreateDetectorModelCommandError = async (output, c
806
680
  ...output,
807
681
  body: await parseBody(output.body, context),
808
682
  };
809
- let response;
810
683
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
811
684
  switch (errorCode) {
812
685
  case "InternalFailureException":
@@ -832,29 +705,26 @@ const deserializeAws_restJson1CreateDetectorModelCommandError = async (output, c
832
705
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
833
706
  default:
834
707
  const parsedBody = parsedOutput.body;
835
- const $metadata = deserializeMetadata(output);
836
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
837
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
838
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
839
- $fault: "client",
840
- $metadata,
708
+ (0, smithy_client_1.throwDefaultError)({
709
+ output,
710
+ parsedBody,
711
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
712
+ errorCode,
841
713
  });
842
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
843
714
  }
844
715
  };
845
716
  const deserializeAws_restJson1CreateInputCommand = async (output, context) => {
846
717
  if (output.statusCode !== 201 && output.statusCode >= 300) {
847
718
  return deserializeAws_restJson1CreateInputCommandError(output, context);
848
719
  }
849
- const contents = {
720
+ const contents = map({
850
721
  $metadata: deserializeMetadata(output),
851
- inputConfiguration: undefined,
852
- };
722
+ });
853
723
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
854
- if (data.inputConfiguration !== undefined && data.inputConfiguration !== null) {
724
+ if (data.inputConfiguration != null) {
855
725
  contents.inputConfiguration = deserializeAws_restJson1InputConfiguration(data.inputConfiguration, context);
856
726
  }
857
- return Promise.resolve(contents);
727
+ return contents;
858
728
  };
859
729
  exports.deserializeAws_restJson1CreateInputCommand = deserializeAws_restJson1CreateInputCommand;
860
730
  const deserializeAws_restJson1CreateInputCommandError = async (output, context) => {
@@ -862,7 +732,6 @@ const deserializeAws_restJson1CreateInputCommandError = async (output, context)
862
732
  ...output,
863
733
  body: await parseBody(output.body, context),
864
734
  };
865
- let response;
866
735
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
867
736
  switch (errorCode) {
868
737
  case "InternalFailureException":
@@ -882,25 +751,23 @@ const deserializeAws_restJson1CreateInputCommandError = async (output, context)
882
751
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
883
752
  default:
884
753
  const parsedBody = parsedOutput.body;
885
- const $metadata = deserializeMetadata(output);
886
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
887
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
888
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
889
- $fault: "client",
890
- $metadata,
754
+ (0, smithy_client_1.throwDefaultError)({
755
+ output,
756
+ parsedBody,
757
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
758
+ errorCode,
891
759
  });
892
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
893
760
  }
894
761
  };
895
762
  const deserializeAws_restJson1DeleteAlarmModelCommand = async (output, context) => {
896
763
  if (output.statusCode !== 204 && output.statusCode >= 300) {
897
764
  return deserializeAws_restJson1DeleteAlarmModelCommandError(output, context);
898
765
  }
899
- const contents = {
766
+ const contents = map({
900
767
  $metadata: deserializeMetadata(output),
901
- };
768
+ });
902
769
  await collectBody(output.body, context);
903
- return Promise.resolve(contents);
770
+ return contents;
904
771
  };
905
772
  exports.deserializeAws_restJson1DeleteAlarmModelCommand = deserializeAws_restJson1DeleteAlarmModelCommand;
906
773
  const deserializeAws_restJson1DeleteAlarmModelCommandError = async (output, context) => {
@@ -908,7 +775,6 @@ const deserializeAws_restJson1DeleteAlarmModelCommandError = async (output, cont
908
775
  ...output,
909
776
  body: await parseBody(output.body, context),
910
777
  };
911
- let response;
912
778
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
913
779
  switch (errorCode) {
914
780
  case "InternalFailureException":
@@ -931,25 +797,23 @@ const deserializeAws_restJson1DeleteAlarmModelCommandError = async (output, cont
931
797
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
932
798
  default:
933
799
  const parsedBody = parsedOutput.body;
934
- const $metadata = deserializeMetadata(output);
935
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
936
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
937
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
938
- $fault: "client",
939
- $metadata,
800
+ (0, smithy_client_1.throwDefaultError)({
801
+ output,
802
+ parsedBody,
803
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
804
+ errorCode,
940
805
  });
941
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
942
806
  }
943
807
  };
944
808
  const deserializeAws_restJson1DeleteDetectorModelCommand = async (output, context) => {
945
809
  if (output.statusCode !== 204 && output.statusCode >= 300) {
946
810
  return deserializeAws_restJson1DeleteDetectorModelCommandError(output, context);
947
811
  }
948
- const contents = {
812
+ const contents = map({
949
813
  $metadata: deserializeMetadata(output),
950
- };
814
+ });
951
815
  await collectBody(output.body, context);
952
- return Promise.resolve(contents);
816
+ return contents;
953
817
  };
954
818
  exports.deserializeAws_restJson1DeleteDetectorModelCommand = deserializeAws_restJson1DeleteDetectorModelCommand;
955
819
  const deserializeAws_restJson1DeleteDetectorModelCommandError = async (output, context) => {
@@ -957,7 +821,6 @@ const deserializeAws_restJson1DeleteDetectorModelCommandError = async (output, c
957
821
  ...output,
958
822
  body: await parseBody(output.body, context),
959
823
  };
960
- let response;
961
824
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
962
825
  switch (errorCode) {
963
826
  case "InternalFailureException":
@@ -980,25 +843,23 @@ const deserializeAws_restJson1DeleteDetectorModelCommandError = async (output, c
980
843
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
981
844
  default:
982
845
  const parsedBody = parsedOutput.body;
983
- const $metadata = deserializeMetadata(output);
984
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
985
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
986
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
987
- $fault: "client",
988
- $metadata,
846
+ (0, smithy_client_1.throwDefaultError)({
847
+ output,
848
+ parsedBody,
849
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
850
+ errorCode,
989
851
  });
990
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
991
852
  }
992
853
  };
993
854
  const deserializeAws_restJson1DeleteInputCommand = async (output, context) => {
994
855
  if (output.statusCode !== 200 && output.statusCode >= 300) {
995
856
  return deserializeAws_restJson1DeleteInputCommandError(output, context);
996
857
  }
997
- const contents = {
858
+ const contents = map({
998
859
  $metadata: deserializeMetadata(output),
999
- };
860
+ });
1000
861
  await collectBody(output.body, context);
1001
- return Promise.resolve(contents);
862
+ return contents;
1002
863
  };
1003
864
  exports.deserializeAws_restJson1DeleteInputCommand = deserializeAws_restJson1DeleteInputCommand;
1004
865
  const deserializeAws_restJson1DeleteInputCommandError = async (output, context) => {
@@ -1006,7 +867,6 @@ const deserializeAws_restJson1DeleteInputCommandError = async (output, context)
1006
867
  ...output,
1007
868
  body: await parseBody(output.body, context),
1008
869
  };
1009
- let response;
1010
870
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1011
871
  switch (errorCode) {
1012
872
  case "InternalFailureException":
@@ -1029,85 +889,68 @@ const deserializeAws_restJson1DeleteInputCommandError = async (output, context)
1029
889
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1030
890
  default:
1031
891
  const parsedBody = parsedOutput.body;
1032
- const $metadata = deserializeMetadata(output);
1033
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1034
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1035
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1036
- $fault: "client",
1037
- $metadata,
892
+ (0, smithy_client_1.throwDefaultError)({
893
+ output,
894
+ parsedBody,
895
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
896
+ errorCode,
1038
897
  });
1039
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1040
898
  }
1041
899
  };
1042
900
  const deserializeAws_restJson1DescribeAlarmModelCommand = async (output, context) => {
1043
901
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1044
902
  return deserializeAws_restJson1DescribeAlarmModelCommandError(output, context);
1045
903
  }
1046
- const contents = {
904
+ const contents = map({
1047
905
  $metadata: deserializeMetadata(output),
1048
- alarmCapabilities: undefined,
1049
- alarmEventActions: undefined,
1050
- alarmModelArn: undefined,
1051
- alarmModelDescription: undefined,
1052
- alarmModelName: undefined,
1053
- alarmModelVersion: undefined,
1054
- alarmNotification: undefined,
1055
- alarmRule: undefined,
1056
- creationTime: undefined,
1057
- key: undefined,
1058
- lastUpdateTime: undefined,
1059
- roleArn: undefined,
1060
- severity: undefined,
1061
- status: undefined,
1062
- statusMessage: undefined,
1063
- };
906
+ });
1064
907
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1065
- if (data.alarmCapabilities !== undefined && data.alarmCapabilities !== null) {
908
+ if (data.alarmCapabilities != null) {
1066
909
  contents.alarmCapabilities = deserializeAws_restJson1AlarmCapabilities(data.alarmCapabilities, context);
1067
910
  }
1068
- if (data.alarmEventActions !== undefined && data.alarmEventActions !== null) {
911
+ if (data.alarmEventActions != null) {
1069
912
  contents.alarmEventActions = deserializeAws_restJson1AlarmEventActions(data.alarmEventActions, context);
1070
913
  }
1071
- if (data.alarmModelArn !== undefined && data.alarmModelArn !== null) {
914
+ if (data.alarmModelArn != null) {
1072
915
  contents.alarmModelArn = (0, smithy_client_1.expectString)(data.alarmModelArn);
1073
916
  }
1074
- if (data.alarmModelDescription !== undefined && data.alarmModelDescription !== null) {
917
+ if (data.alarmModelDescription != null) {
1075
918
  contents.alarmModelDescription = (0, smithy_client_1.expectString)(data.alarmModelDescription);
1076
919
  }
1077
- if (data.alarmModelName !== undefined && data.alarmModelName !== null) {
920
+ if (data.alarmModelName != null) {
1078
921
  contents.alarmModelName = (0, smithy_client_1.expectString)(data.alarmModelName);
1079
922
  }
1080
- if (data.alarmModelVersion !== undefined && data.alarmModelVersion !== null) {
923
+ if (data.alarmModelVersion != null) {
1081
924
  contents.alarmModelVersion = (0, smithy_client_1.expectString)(data.alarmModelVersion);
1082
925
  }
1083
- if (data.alarmNotification !== undefined && data.alarmNotification !== null) {
926
+ if (data.alarmNotification != null) {
1084
927
  contents.alarmNotification = deserializeAws_restJson1AlarmNotification(data.alarmNotification, context);
1085
928
  }
1086
- if (data.alarmRule !== undefined && data.alarmRule !== null) {
929
+ if (data.alarmRule != null) {
1087
930
  contents.alarmRule = deserializeAws_restJson1AlarmRule(data.alarmRule, context);
1088
931
  }
1089
- if (data.creationTime !== undefined && data.creationTime !== null) {
932
+ if (data.creationTime != null) {
1090
933
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1091
934
  }
1092
- if (data.key !== undefined && data.key !== null) {
935
+ if (data.key != null) {
1093
936
  contents.key = (0, smithy_client_1.expectString)(data.key);
1094
937
  }
1095
- if (data.lastUpdateTime !== undefined && data.lastUpdateTime !== null) {
938
+ if (data.lastUpdateTime != null) {
1096
939
  contents.lastUpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastUpdateTime)));
1097
940
  }
1098
- if (data.roleArn !== undefined && data.roleArn !== null) {
941
+ if (data.roleArn != null) {
1099
942
  contents.roleArn = (0, smithy_client_1.expectString)(data.roleArn);
1100
943
  }
1101
- if (data.severity !== undefined && data.severity !== null) {
944
+ if (data.severity != null) {
1102
945
  contents.severity = (0, smithy_client_1.expectInt32)(data.severity);
1103
946
  }
1104
- if (data.status !== undefined && data.status !== null) {
947
+ if (data.status != null) {
1105
948
  contents.status = (0, smithy_client_1.expectString)(data.status);
1106
949
  }
1107
- if (data.statusMessage !== undefined && data.statusMessage !== null) {
950
+ if (data.statusMessage != null) {
1108
951
  contents.statusMessage = (0, smithy_client_1.expectString)(data.statusMessage);
1109
952
  }
1110
- return Promise.resolve(contents);
953
+ return contents;
1111
954
  };
1112
955
  exports.deserializeAws_restJson1DescribeAlarmModelCommand = deserializeAws_restJson1DescribeAlarmModelCommand;
1113
956
  const deserializeAws_restJson1DescribeAlarmModelCommandError = async (output, context) => {
@@ -1115,7 +958,6 @@ const deserializeAws_restJson1DescribeAlarmModelCommandError = async (output, co
1115
958
  ...output,
1116
959
  body: await parseBody(output.body, context),
1117
960
  };
1118
- let response;
1119
961
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1120
962
  switch (errorCode) {
1121
963
  case "InternalFailureException":
@@ -1135,29 +977,26 @@ const deserializeAws_restJson1DescribeAlarmModelCommandError = async (output, co
1135
977
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1136
978
  default:
1137
979
  const parsedBody = parsedOutput.body;
1138
- const $metadata = deserializeMetadata(output);
1139
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1140
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1141
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1142
- $fault: "client",
1143
- $metadata,
980
+ (0, smithy_client_1.throwDefaultError)({
981
+ output,
982
+ parsedBody,
983
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
984
+ errorCode,
1144
985
  });
1145
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1146
986
  }
1147
987
  };
1148
988
  const deserializeAws_restJson1DescribeDetectorModelCommand = async (output, context) => {
1149
989
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1150
990
  return deserializeAws_restJson1DescribeDetectorModelCommandError(output, context);
1151
991
  }
1152
- const contents = {
992
+ const contents = map({
1153
993
  $metadata: deserializeMetadata(output),
1154
- detectorModel: undefined,
1155
- };
994
+ });
1156
995
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1157
- if (data.detectorModel !== undefined && data.detectorModel !== null) {
996
+ if (data.detectorModel != null) {
1158
997
  contents.detectorModel = deserializeAws_restJson1DetectorModel(data.detectorModel, context);
1159
998
  }
1160
- return Promise.resolve(contents);
999
+ return contents;
1161
1000
  };
1162
1001
  exports.deserializeAws_restJson1DescribeDetectorModelCommand = deserializeAws_restJson1DescribeDetectorModelCommand;
1163
1002
  const deserializeAws_restJson1DescribeDetectorModelCommandError = async (output, context) => {
@@ -1165,7 +1004,6 @@ const deserializeAws_restJson1DescribeDetectorModelCommandError = async (output,
1165
1004
  ...output,
1166
1005
  body: await parseBody(output.body, context),
1167
1006
  };
1168
- let response;
1169
1007
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1170
1008
  switch (errorCode) {
1171
1009
  case "InternalFailureException":
@@ -1185,29 +1023,26 @@ const deserializeAws_restJson1DescribeDetectorModelCommandError = async (output,
1185
1023
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1186
1024
  default:
1187
1025
  const parsedBody = parsedOutput.body;
1188
- const $metadata = deserializeMetadata(output);
1189
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1190
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1191
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1192
- $fault: "client",
1193
- $metadata,
1026
+ (0, smithy_client_1.throwDefaultError)({
1027
+ output,
1028
+ parsedBody,
1029
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1030
+ errorCode,
1194
1031
  });
1195
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1196
1032
  }
1197
1033
  };
1198
1034
  const deserializeAws_restJson1DescribeDetectorModelAnalysisCommand = async (output, context) => {
1199
1035
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1200
1036
  return deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError(output, context);
1201
1037
  }
1202
- const contents = {
1038
+ const contents = map({
1203
1039
  $metadata: deserializeMetadata(output),
1204
- status: undefined,
1205
- };
1040
+ });
1206
1041
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1207
- if (data.status !== undefined && data.status !== null) {
1042
+ if (data.status != null) {
1208
1043
  contents.status = (0, smithy_client_1.expectString)(data.status);
1209
1044
  }
1210
- return Promise.resolve(contents);
1045
+ return contents;
1211
1046
  };
1212
1047
  exports.deserializeAws_restJson1DescribeDetectorModelAnalysisCommand = deserializeAws_restJson1DescribeDetectorModelAnalysisCommand;
1213
1048
  const deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError = async (output, context) => {
@@ -1215,7 +1050,6 @@ const deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError = async
1215
1050
  ...output,
1216
1051
  body: await parseBody(output.body, context),
1217
1052
  };
1218
- let response;
1219
1053
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1220
1054
  switch (errorCode) {
1221
1055
  case "InternalFailureException":
@@ -1235,29 +1069,26 @@ const deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError = async
1235
1069
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1236
1070
  default:
1237
1071
  const parsedBody = parsedOutput.body;
1238
- const $metadata = deserializeMetadata(output);
1239
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1240
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1241
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1242
- $fault: "client",
1243
- $metadata,
1072
+ (0, smithy_client_1.throwDefaultError)({
1073
+ output,
1074
+ parsedBody,
1075
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1076
+ errorCode,
1244
1077
  });
1245
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1246
1078
  }
1247
1079
  };
1248
1080
  const deserializeAws_restJson1DescribeInputCommand = async (output, context) => {
1249
1081
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1250
1082
  return deserializeAws_restJson1DescribeInputCommandError(output, context);
1251
1083
  }
1252
- const contents = {
1084
+ const contents = map({
1253
1085
  $metadata: deserializeMetadata(output),
1254
- input: undefined,
1255
- };
1086
+ });
1256
1087
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1257
- if (data.input !== undefined && data.input !== null) {
1088
+ if (data.input != null) {
1258
1089
  contents.input = deserializeAws_restJson1Input(data.input, context);
1259
1090
  }
1260
- return Promise.resolve(contents);
1091
+ return contents;
1261
1092
  };
1262
1093
  exports.deserializeAws_restJson1DescribeInputCommand = deserializeAws_restJson1DescribeInputCommand;
1263
1094
  const deserializeAws_restJson1DescribeInputCommandError = async (output, context) => {
@@ -1265,7 +1096,6 @@ const deserializeAws_restJson1DescribeInputCommandError = async (output, context
1265
1096
  ...output,
1266
1097
  body: await parseBody(output.body, context),
1267
1098
  };
1268
- let response;
1269
1099
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1270
1100
  switch (errorCode) {
1271
1101
  case "InternalFailureException":
@@ -1285,29 +1115,26 @@ const deserializeAws_restJson1DescribeInputCommandError = async (output, context
1285
1115
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1286
1116
  default:
1287
1117
  const parsedBody = parsedOutput.body;
1288
- const $metadata = deserializeMetadata(output);
1289
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1290
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1291
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1292
- $fault: "client",
1293
- $metadata,
1118
+ (0, smithy_client_1.throwDefaultError)({
1119
+ output,
1120
+ parsedBody,
1121
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1122
+ errorCode,
1294
1123
  });
1295
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1296
1124
  }
1297
1125
  };
1298
1126
  const deserializeAws_restJson1DescribeLoggingOptionsCommand = async (output, context) => {
1299
1127
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1300
1128
  return deserializeAws_restJson1DescribeLoggingOptionsCommandError(output, context);
1301
1129
  }
1302
- const contents = {
1130
+ const contents = map({
1303
1131
  $metadata: deserializeMetadata(output),
1304
- loggingOptions: undefined,
1305
- };
1132
+ });
1306
1133
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1307
- if (data.loggingOptions !== undefined && data.loggingOptions !== null) {
1134
+ if (data.loggingOptions != null) {
1308
1135
  contents.loggingOptions = deserializeAws_restJson1LoggingOptions(data.loggingOptions, context);
1309
1136
  }
1310
- return Promise.resolve(contents);
1137
+ return contents;
1311
1138
  };
1312
1139
  exports.deserializeAws_restJson1DescribeLoggingOptionsCommand = deserializeAws_restJson1DescribeLoggingOptionsCommand;
1313
1140
  const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async (output, context) => {
@@ -1315,7 +1142,6 @@ const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async (output
1315
1142
  ...output,
1316
1143
  body: await parseBody(output.body, context),
1317
1144
  };
1318
- let response;
1319
1145
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1320
1146
  switch (errorCode) {
1321
1147
  case "InternalFailureException":
@@ -1338,33 +1164,29 @@ const deserializeAws_restJson1DescribeLoggingOptionsCommandError = async (output
1338
1164
  throw await deserializeAws_restJson1UnsupportedOperationExceptionResponse(parsedOutput, context);
1339
1165
  default:
1340
1166
  const parsedBody = parsedOutput.body;
1341
- const $metadata = deserializeMetadata(output);
1342
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1343
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1344
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1345
- $fault: "client",
1346
- $metadata,
1167
+ (0, smithy_client_1.throwDefaultError)({
1168
+ output,
1169
+ parsedBody,
1170
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1171
+ errorCode,
1347
1172
  });
1348
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1349
1173
  }
1350
1174
  };
1351
1175
  const deserializeAws_restJson1GetDetectorModelAnalysisResultsCommand = async (output, context) => {
1352
1176
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1353
1177
  return deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError(output, context);
1354
1178
  }
1355
- const contents = {
1179
+ const contents = map({
1356
1180
  $metadata: deserializeMetadata(output),
1357
- analysisResults: undefined,
1358
- nextToken: undefined,
1359
- };
1181
+ });
1360
1182
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1361
- if (data.analysisResults !== undefined && data.analysisResults !== null) {
1183
+ if (data.analysisResults != null) {
1362
1184
  contents.analysisResults = deserializeAws_restJson1AnalysisResults(data.analysisResults, context);
1363
1185
  }
1364
- if (data.nextToken !== undefined && data.nextToken !== null) {
1186
+ if (data.nextToken != null) {
1365
1187
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1366
1188
  }
1367
- return Promise.resolve(contents);
1189
+ return contents;
1368
1190
  };
1369
1191
  exports.deserializeAws_restJson1GetDetectorModelAnalysisResultsCommand = deserializeAws_restJson1GetDetectorModelAnalysisResultsCommand;
1370
1192
  const deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError = async (output, context) => {
@@ -1372,7 +1194,6 @@ const deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError = asyn
1372
1194
  ...output,
1373
1195
  body: await parseBody(output.body, context),
1374
1196
  };
1375
- let response;
1376
1197
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1377
1198
  switch (errorCode) {
1378
1199
  case "InternalFailureException":
@@ -1392,33 +1213,29 @@ const deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError = asyn
1392
1213
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1393
1214
  default:
1394
1215
  const parsedBody = parsedOutput.body;
1395
- const $metadata = deserializeMetadata(output);
1396
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1397
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1398
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1399
- $fault: "client",
1400
- $metadata,
1216
+ (0, smithy_client_1.throwDefaultError)({
1217
+ output,
1218
+ parsedBody,
1219
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1220
+ errorCode,
1401
1221
  });
1402
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1403
1222
  }
1404
1223
  };
1405
1224
  const deserializeAws_restJson1ListAlarmModelsCommand = async (output, context) => {
1406
1225
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1407
1226
  return deserializeAws_restJson1ListAlarmModelsCommandError(output, context);
1408
1227
  }
1409
- const contents = {
1228
+ const contents = map({
1410
1229
  $metadata: deserializeMetadata(output),
1411
- alarmModelSummaries: undefined,
1412
- nextToken: undefined,
1413
- };
1230
+ });
1414
1231
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1415
- if (data.alarmModelSummaries !== undefined && data.alarmModelSummaries !== null) {
1232
+ if (data.alarmModelSummaries != null) {
1416
1233
  contents.alarmModelSummaries = deserializeAws_restJson1AlarmModelSummaries(data.alarmModelSummaries, context);
1417
1234
  }
1418
- if (data.nextToken !== undefined && data.nextToken !== null) {
1235
+ if (data.nextToken != null) {
1419
1236
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1420
1237
  }
1421
- return Promise.resolve(contents);
1238
+ return contents;
1422
1239
  };
1423
1240
  exports.deserializeAws_restJson1ListAlarmModelsCommand = deserializeAws_restJson1ListAlarmModelsCommand;
1424
1241
  const deserializeAws_restJson1ListAlarmModelsCommandError = async (output, context) => {
@@ -1426,7 +1243,6 @@ const deserializeAws_restJson1ListAlarmModelsCommandError = async (output, conte
1426
1243
  ...output,
1427
1244
  body: await parseBody(output.body, context),
1428
1245
  };
1429
- let response;
1430
1246
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1431
1247
  switch (errorCode) {
1432
1248
  case "InternalFailureException":
@@ -1443,33 +1259,29 @@ const deserializeAws_restJson1ListAlarmModelsCommandError = async (output, conte
1443
1259
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1444
1260
  default:
1445
1261
  const parsedBody = parsedOutput.body;
1446
- const $metadata = deserializeMetadata(output);
1447
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1448
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1449
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1450
- $fault: "client",
1451
- $metadata,
1262
+ (0, smithy_client_1.throwDefaultError)({
1263
+ output,
1264
+ parsedBody,
1265
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1266
+ errorCode,
1452
1267
  });
1453
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1454
1268
  }
1455
1269
  };
1456
1270
  const deserializeAws_restJson1ListAlarmModelVersionsCommand = async (output, context) => {
1457
1271
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1458
1272
  return deserializeAws_restJson1ListAlarmModelVersionsCommandError(output, context);
1459
1273
  }
1460
- const contents = {
1274
+ const contents = map({
1461
1275
  $metadata: deserializeMetadata(output),
1462
- alarmModelVersionSummaries: undefined,
1463
- nextToken: undefined,
1464
- };
1276
+ });
1465
1277
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1466
- if (data.alarmModelVersionSummaries !== undefined && data.alarmModelVersionSummaries !== null) {
1278
+ if (data.alarmModelVersionSummaries != null) {
1467
1279
  contents.alarmModelVersionSummaries = deserializeAws_restJson1AlarmModelVersionSummaries(data.alarmModelVersionSummaries, context);
1468
1280
  }
1469
- if (data.nextToken !== undefined && data.nextToken !== null) {
1281
+ if (data.nextToken != null) {
1470
1282
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1471
1283
  }
1472
- return Promise.resolve(contents);
1284
+ return contents;
1473
1285
  };
1474
1286
  exports.deserializeAws_restJson1ListAlarmModelVersionsCommand = deserializeAws_restJson1ListAlarmModelVersionsCommand;
1475
1287
  const deserializeAws_restJson1ListAlarmModelVersionsCommandError = async (output, context) => {
@@ -1477,7 +1289,6 @@ const deserializeAws_restJson1ListAlarmModelVersionsCommandError = async (output
1477
1289
  ...output,
1478
1290
  body: await parseBody(output.body, context),
1479
1291
  };
1480
- let response;
1481
1292
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1482
1293
  switch (errorCode) {
1483
1294
  case "InternalFailureException":
@@ -1497,33 +1308,29 @@ const deserializeAws_restJson1ListAlarmModelVersionsCommandError = async (output
1497
1308
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1498
1309
  default:
1499
1310
  const parsedBody = parsedOutput.body;
1500
- const $metadata = deserializeMetadata(output);
1501
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1502
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1503
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1504
- $fault: "client",
1505
- $metadata,
1311
+ (0, smithy_client_1.throwDefaultError)({
1312
+ output,
1313
+ parsedBody,
1314
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1315
+ errorCode,
1506
1316
  });
1507
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1508
1317
  }
1509
1318
  };
1510
1319
  const deserializeAws_restJson1ListDetectorModelsCommand = async (output, context) => {
1511
1320
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1512
1321
  return deserializeAws_restJson1ListDetectorModelsCommandError(output, context);
1513
1322
  }
1514
- const contents = {
1323
+ const contents = map({
1515
1324
  $metadata: deserializeMetadata(output),
1516
- detectorModelSummaries: undefined,
1517
- nextToken: undefined,
1518
- };
1325
+ });
1519
1326
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1520
- if (data.detectorModelSummaries !== undefined && data.detectorModelSummaries !== null) {
1327
+ if (data.detectorModelSummaries != null) {
1521
1328
  contents.detectorModelSummaries = deserializeAws_restJson1DetectorModelSummaries(data.detectorModelSummaries, context);
1522
1329
  }
1523
- if (data.nextToken !== undefined && data.nextToken !== null) {
1330
+ if (data.nextToken != null) {
1524
1331
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1525
1332
  }
1526
- return Promise.resolve(contents);
1333
+ return contents;
1527
1334
  };
1528
1335
  exports.deserializeAws_restJson1ListDetectorModelsCommand = deserializeAws_restJson1ListDetectorModelsCommand;
1529
1336
  const deserializeAws_restJson1ListDetectorModelsCommandError = async (output, context) => {
@@ -1531,7 +1338,6 @@ const deserializeAws_restJson1ListDetectorModelsCommandError = async (output, co
1531
1338
  ...output,
1532
1339
  body: await parseBody(output.body, context),
1533
1340
  };
1534
- let response;
1535
1341
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1536
1342
  switch (errorCode) {
1537
1343
  case "InternalFailureException":
@@ -1548,33 +1354,29 @@ const deserializeAws_restJson1ListDetectorModelsCommandError = async (output, co
1548
1354
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1549
1355
  default:
1550
1356
  const parsedBody = parsedOutput.body;
1551
- const $metadata = deserializeMetadata(output);
1552
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1553
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1554
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1555
- $fault: "client",
1556
- $metadata,
1357
+ (0, smithy_client_1.throwDefaultError)({
1358
+ output,
1359
+ parsedBody,
1360
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1361
+ errorCode,
1557
1362
  });
1558
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1559
1363
  }
1560
1364
  };
1561
1365
  const deserializeAws_restJson1ListDetectorModelVersionsCommand = async (output, context) => {
1562
1366
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1563
1367
  return deserializeAws_restJson1ListDetectorModelVersionsCommandError(output, context);
1564
1368
  }
1565
- const contents = {
1369
+ const contents = map({
1566
1370
  $metadata: deserializeMetadata(output),
1567
- detectorModelVersionSummaries: undefined,
1568
- nextToken: undefined,
1569
- };
1371
+ });
1570
1372
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1571
- if (data.detectorModelVersionSummaries !== undefined && data.detectorModelVersionSummaries !== null) {
1373
+ if (data.detectorModelVersionSummaries != null) {
1572
1374
  contents.detectorModelVersionSummaries = deserializeAws_restJson1DetectorModelVersionSummaries(data.detectorModelVersionSummaries, context);
1573
1375
  }
1574
- if (data.nextToken !== undefined && data.nextToken !== null) {
1376
+ if (data.nextToken != null) {
1575
1377
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1576
1378
  }
1577
- return Promise.resolve(contents);
1379
+ return contents;
1578
1380
  };
1579
1381
  exports.deserializeAws_restJson1ListDetectorModelVersionsCommand = deserializeAws_restJson1ListDetectorModelVersionsCommand;
1580
1382
  const deserializeAws_restJson1ListDetectorModelVersionsCommandError = async (output, context) => {
@@ -1582,7 +1384,6 @@ const deserializeAws_restJson1ListDetectorModelVersionsCommandError = async (out
1582
1384
  ...output,
1583
1385
  body: await parseBody(output.body, context),
1584
1386
  };
1585
- let response;
1586
1387
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1587
1388
  switch (errorCode) {
1588
1389
  case "InternalFailureException":
@@ -1602,33 +1403,29 @@ const deserializeAws_restJson1ListDetectorModelVersionsCommandError = async (out
1602
1403
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1603
1404
  default:
1604
1405
  const parsedBody = parsedOutput.body;
1605
- const $metadata = deserializeMetadata(output);
1606
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1607
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1608
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1609
- $fault: "client",
1610
- $metadata,
1406
+ (0, smithy_client_1.throwDefaultError)({
1407
+ output,
1408
+ parsedBody,
1409
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1410
+ errorCode,
1611
1411
  });
1612
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1613
1412
  }
1614
1413
  };
1615
1414
  const deserializeAws_restJson1ListInputRoutingsCommand = async (output, context) => {
1616
1415
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1617
1416
  return deserializeAws_restJson1ListInputRoutingsCommandError(output, context);
1618
1417
  }
1619
- const contents = {
1418
+ const contents = map({
1620
1419
  $metadata: deserializeMetadata(output),
1621
- nextToken: undefined,
1622
- routedResources: undefined,
1623
- };
1420
+ });
1624
1421
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1625
- if (data.nextToken !== undefined && data.nextToken !== null) {
1422
+ if (data.nextToken != null) {
1626
1423
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1627
1424
  }
1628
- if (data.routedResources !== undefined && data.routedResources !== null) {
1425
+ if (data.routedResources != null) {
1629
1426
  contents.routedResources = deserializeAws_restJson1RoutedResources(data.routedResources, context);
1630
1427
  }
1631
- return Promise.resolve(contents);
1428
+ return contents;
1632
1429
  };
1633
1430
  exports.deserializeAws_restJson1ListInputRoutingsCommand = deserializeAws_restJson1ListInputRoutingsCommand;
1634
1431
  const deserializeAws_restJson1ListInputRoutingsCommandError = async (output, context) => {
@@ -1636,7 +1433,6 @@ const deserializeAws_restJson1ListInputRoutingsCommandError = async (output, con
1636
1433
  ...output,
1637
1434
  body: await parseBody(output.body, context),
1638
1435
  };
1639
- let response;
1640
1436
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1641
1437
  switch (errorCode) {
1642
1438
  case "InternalFailureException":
@@ -1656,33 +1452,29 @@ const deserializeAws_restJson1ListInputRoutingsCommandError = async (output, con
1656
1452
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1657
1453
  default:
1658
1454
  const parsedBody = parsedOutput.body;
1659
- const $metadata = deserializeMetadata(output);
1660
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1661
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1662
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1663
- $fault: "client",
1664
- $metadata,
1455
+ (0, smithy_client_1.throwDefaultError)({
1456
+ output,
1457
+ parsedBody,
1458
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1459
+ errorCode,
1665
1460
  });
1666
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1667
1461
  }
1668
1462
  };
1669
1463
  const deserializeAws_restJson1ListInputsCommand = async (output, context) => {
1670
1464
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1671
1465
  return deserializeAws_restJson1ListInputsCommandError(output, context);
1672
1466
  }
1673
- const contents = {
1467
+ const contents = map({
1674
1468
  $metadata: deserializeMetadata(output),
1675
- inputSummaries: undefined,
1676
- nextToken: undefined,
1677
- };
1469
+ });
1678
1470
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1679
- if (data.inputSummaries !== undefined && data.inputSummaries !== null) {
1471
+ if (data.inputSummaries != null) {
1680
1472
  contents.inputSummaries = deserializeAws_restJson1InputSummaries(data.inputSummaries, context);
1681
1473
  }
1682
- if (data.nextToken !== undefined && data.nextToken !== null) {
1474
+ if (data.nextToken != null) {
1683
1475
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1684
1476
  }
1685
- return Promise.resolve(contents);
1477
+ return contents;
1686
1478
  };
1687
1479
  exports.deserializeAws_restJson1ListInputsCommand = deserializeAws_restJson1ListInputsCommand;
1688
1480
  const deserializeAws_restJson1ListInputsCommandError = async (output, context) => {
@@ -1690,7 +1482,6 @@ const deserializeAws_restJson1ListInputsCommandError = async (output, context) =
1690
1482
  ...output,
1691
1483
  body: await parseBody(output.body, context),
1692
1484
  };
1693
- let response;
1694
1485
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1695
1486
  switch (errorCode) {
1696
1487
  case "InternalFailureException":
@@ -1707,29 +1498,26 @@ const deserializeAws_restJson1ListInputsCommandError = async (output, context) =
1707
1498
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1708
1499
  default:
1709
1500
  const parsedBody = parsedOutput.body;
1710
- const $metadata = deserializeMetadata(output);
1711
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1712
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1713
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1714
- $fault: "client",
1715
- $metadata,
1501
+ (0, smithy_client_1.throwDefaultError)({
1502
+ output,
1503
+ parsedBody,
1504
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1505
+ errorCode,
1716
1506
  });
1717
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1718
1507
  }
1719
1508
  };
1720
1509
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1721
1510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1722
1511
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1723
1512
  }
1724
- const contents = {
1513
+ const contents = map({
1725
1514
  $metadata: deserializeMetadata(output),
1726
- tags: undefined,
1727
- };
1515
+ });
1728
1516
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1729
- if (data.tags !== undefined && data.tags !== null) {
1517
+ if (data.tags != null) {
1730
1518
  contents.tags = deserializeAws_restJson1Tags(data.tags, context);
1731
1519
  }
1732
- return Promise.resolve(contents);
1520
+ return contents;
1733
1521
  };
1734
1522
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1735
1523
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1737,7 +1525,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1737
1525
  ...output,
1738
1526
  body: await parseBody(output.body, context),
1739
1527
  };
1740
- let response;
1741
1528
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1742
1529
  switch (errorCode) {
1743
1530
  case "InternalFailureException":
@@ -1757,25 +1544,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1757
1544
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1758
1545
  default:
1759
1546
  const parsedBody = parsedOutput.body;
1760
- const $metadata = deserializeMetadata(output);
1761
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1762
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1763
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1764
- $fault: "client",
1765
- $metadata,
1547
+ (0, smithy_client_1.throwDefaultError)({
1548
+ output,
1549
+ parsedBody,
1550
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1551
+ errorCode,
1766
1552
  });
1767
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1768
1553
  }
1769
1554
  };
1770
1555
  const deserializeAws_restJson1PutLoggingOptionsCommand = async (output, context) => {
1771
1556
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1772
1557
  return deserializeAws_restJson1PutLoggingOptionsCommandError(output, context);
1773
1558
  }
1774
- const contents = {
1559
+ const contents = map({
1775
1560
  $metadata: deserializeMetadata(output),
1776
- };
1561
+ });
1777
1562
  await collectBody(output.body, context);
1778
- return Promise.resolve(contents);
1563
+ return contents;
1779
1564
  };
1780
1565
  exports.deserializeAws_restJson1PutLoggingOptionsCommand = deserializeAws_restJson1PutLoggingOptionsCommand;
1781
1566
  const deserializeAws_restJson1PutLoggingOptionsCommandError = async (output, context) => {
@@ -1783,7 +1568,6 @@ const deserializeAws_restJson1PutLoggingOptionsCommandError = async (output, con
1783
1568
  ...output,
1784
1569
  body: await parseBody(output.body, context),
1785
1570
  };
1786
- let response;
1787
1571
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1788
1572
  switch (errorCode) {
1789
1573
  case "InternalFailureException":
@@ -1806,29 +1590,26 @@ const deserializeAws_restJson1PutLoggingOptionsCommandError = async (output, con
1806
1590
  throw await deserializeAws_restJson1UnsupportedOperationExceptionResponse(parsedOutput, context);
1807
1591
  default:
1808
1592
  const parsedBody = parsedOutput.body;
1809
- const $metadata = deserializeMetadata(output);
1810
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1811
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1812
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1813
- $fault: "client",
1814
- $metadata,
1593
+ (0, smithy_client_1.throwDefaultError)({
1594
+ output,
1595
+ parsedBody,
1596
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1597
+ errorCode,
1815
1598
  });
1816
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1817
1599
  }
1818
1600
  };
1819
1601
  const deserializeAws_restJson1StartDetectorModelAnalysisCommand = async (output, context) => {
1820
1602
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1821
1603
  return deserializeAws_restJson1StartDetectorModelAnalysisCommandError(output, context);
1822
1604
  }
1823
- const contents = {
1605
+ const contents = map({
1824
1606
  $metadata: deserializeMetadata(output),
1825
- analysisId: undefined,
1826
- };
1607
+ });
1827
1608
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1828
- if (data.analysisId !== undefined && data.analysisId !== null) {
1609
+ if (data.analysisId != null) {
1829
1610
  contents.analysisId = (0, smithy_client_1.expectString)(data.analysisId);
1830
1611
  }
1831
- return Promise.resolve(contents);
1612
+ return contents;
1832
1613
  };
1833
1614
  exports.deserializeAws_restJson1StartDetectorModelAnalysisCommand = deserializeAws_restJson1StartDetectorModelAnalysisCommand;
1834
1615
  const deserializeAws_restJson1StartDetectorModelAnalysisCommandError = async (output, context) => {
@@ -1836,7 +1617,6 @@ const deserializeAws_restJson1StartDetectorModelAnalysisCommandError = async (ou
1836
1617
  ...output,
1837
1618
  body: await parseBody(output.body, context),
1838
1619
  };
1839
- let response;
1840
1620
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1841
1621
  switch (errorCode) {
1842
1622
  case "InternalFailureException":
@@ -1856,25 +1636,23 @@ const deserializeAws_restJson1StartDetectorModelAnalysisCommandError = async (ou
1856
1636
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1857
1637
  default:
1858
1638
  const parsedBody = parsedOutput.body;
1859
- const $metadata = deserializeMetadata(output);
1860
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1861
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1862
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1863
- $fault: "client",
1864
- $metadata,
1639
+ (0, smithy_client_1.throwDefaultError)({
1640
+ output,
1641
+ parsedBody,
1642
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1643
+ errorCode,
1865
1644
  });
1866
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1867
1645
  }
1868
1646
  };
1869
1647
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1870
1648
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1871
1649
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1872
1650
  }
1873
- const contents = {
1651
+ const contents = map({
1874
1652
  $metadata: deserializeMetadata(output),
1875
- };
1653
+ });
1876
1654
  await collectBody(output.body, context);
1877
- return Promise.resolve(contents);
1655
+ return contents;
1878
1656
  };
1879
1657
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1880
1658
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1882,7 +1660,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1882
1660
  ...output,
1883
1661
  body: await parseBody(output.body, context),
1884
1662
  };
1885
- let response;
1886
1663
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1887
1664
  switch (errorCode) {
1888
1665
  case "InternalFailureException":
@@ -1905,25 +1682,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1905
1682
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1906
1683
  default:
1907
1684
  const parsedBody = parsedOutput.body;
1908
- const $metadata = deserializeMetadata(output);
1909
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1910
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1911
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1912
- $fault: "client",
1913
- $metadata,
1685
+ (0, smithy_client_1.throwDefaultError)({
1686
+ output,
1687
+ parsedBody,
1688
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1689
+ errorCode,
1914
1690
  });
1915
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1916
1691
  }
1917
1692
  };
1918
1693
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1919
1694
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1920
1695
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1921
1696
  }
1922
- const contents = {
1697
+ const contents = map({
1923
1698
  $metadata: deserializeMetadata(output),
1924
- };
1699
+ });
1925
1700
  await collectBody(output.body, context);
1926
- return Promise.resolve(contents);
1701
+ return contents;
1927
1702
  };
1928
1703
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1929
1704
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1931,7 +1706,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1931
1706
  ...output,
1932
1707
  body: await parseBody(output.body, context),
1933
1708
  };
1934
- let response;
1935
1709
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1936
1710
  switch (errorCode) {
1937
1711
  case "InternalFailureException":
@@ -1951,45 +1725,38 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1951
1725
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1952
1726
  default:
1953
1727
  const parsedBody = parsedOutput.body;
1954
- const $metadata = deserializeMetadata(output);
1955
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1956
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
1957
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1958
- $fault: "client",
1959
- $metadata,
1728
+ (0, smithy_client_1.throwDefaultError)({
1729
+ output,
1730
+ parsedBody,
1731
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1732
+ errorCode,
1960
1733
  });
1961
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1962
1734
  }
1963
1735
  };
1964
1736
  const deserializeAws_restJson1UpdateAlarmModelCommand = async (output, context) => {
1965
1737
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1966
1738
  return deserializeAws_restJson1UpdateAlarmModelCommandError(output, context);
1967
1739
  }
1968
- const contents = {
1740
+ const contents = map({
1969
1741
  $metadata: deserializeMetadata(output),
1970
- alarmModelArn: undefined,
1971
- alarmModelVersion: undefined,
1972
- creationTime: undefined,
1973
- lastUpdateTime: undefined,
1974
- status: undefined,
1975
- };
1742
+ });
1976
1743
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1977
- if (data.alarmModelArn !== undefined && data.alarmModelArn !== null) {
1744
+ if (data.alarmModelArn != null) {
1978
1745
  contents.alarmModelArn = (0, smithy_client_1.expectString)(data.alarmModelArn);
1979
1746
  }
1980
- if (data.alarmModelVersion !== undefined && data.alarmModelVersion !== null) {
1747
+ if (data.alarmModelVersion != null) {
1981
1748
  contents.alarmModelVersion = (0, smithy_client_1.expectString)(data.alarmModelVersion);
1982
1749
  }
1983
- if (data.creationTime !== undefined && data.creationTime !== null) {
1750
+ if (data.creationTime != null) {
1984
1751
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1985
1752
  }
1986
- if (data.lastUpdateTime !== undefined && data.lastUpdateTime !== null) {
1753
+ if (data.lastUpdateTime != null) {
1987
1754
  contents.lastUpdateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastUpdateTime)));
1988
1755
  }
1989
- if (data.status !== undefined && data.status !== null) {
1756
+ if (data.status != null) {
1990
1757
  contents.status = (0, smithy_client_1.expectString)(data.status);
1991
1758
  }
1992
- return Promise.resolve(contents);
1759
+ return contents;
1993
1760
  };
1994
1761
  exports.deserializeAws_restJson1UpdateAlarmModelCommand = deserializeAws_restJson1UpdateAlarmModelCommand;
1995
1762
  const deserializeAws_restJson1UpdateAlarmModelCommandError = async (output, context) => {
@@ -1997,7 +1764,6 @@ const deserializeAws_restJson1UpdateAlarmModelCommandError = async (output, cont
1997
1764
  ...output,
1998
1765
  body: await parseBody(output.body, context),
1999
1766
  };
2000
- let response;
2001
1767
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2002
1768
  switch (errorCode) {
2003
1769
  case "InternalFailureException":
@@ -2020,29 +1786,26 @@ const deserializeAws_restJson1UpdateAlarmModelCommandError = async (output, cont
2020
1786
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2021
1787
  default:
2022
1788
  const parsedBody = parsedOutput.body;
2023
- const $metadata = deserializeMetadata(output);
2024
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2025
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
2026
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2027
- $fault: "client",
2028
- $metadata,
1789
+ (0, smithy_client_1.throwDefaultError)({
1790
+ output,
1791
+ parsedBody,
1792
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1793
+ errorCode,
2029
1794
  });
2030
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2031
1795
  }
2032
1796
  };
2033
1797
  const deserializeAws_restJson1UpdateDetectorModelCommand = async (output, context) => {
2034
1798
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2035
1799
  return deserializeAws_restJson1UpdateDetectorModelCommandError(output, context);
2036
1800
  }
2037
- const contents = {
1801
+ const contents = map({
2038
1802
  $metadata: deserializeMetadata(output),
2039
- detectorModelConfiguration: undefined,
2040
- };
1803
+ });
2041
1804
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2042
- if (data.detectorModelConfiguration !== undefined && data.detectorModelConfiguration !== null) {
1805
+ if (data.detectorModelConfiguration != null) {
2043
1806
  contents.detectorModelConfiguration = deserializeAws_restJson1DetectorModelConfiguration(data.detectorModelConfiguration, context);
2044
1807
  }
2045
- return Promise.resolve(contents);
1808
+ return contents;
2046
1809
  };
2047
1810
  exports.deserializeAws_restJson1UpdateDetectorModelCommand = deserializeAws_restJson1UpdateDetectorModelCommand;
2048
1811
  const deserializeAws_restJson1UpdateDetectorModelCommandError = async (output, context) => {
@@ -2050,7 +1813,6 @@ const deserializeAws_restJson1UpdateDetectorModelCommandError = async (output, c
2050
1813
  ...output,
2051
1814
  body: await parseBody(output.body, context),
2052
1815
  };
2053
- let response;
2054
1816
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2055
1817
  switch (errorCode) {
2056
1818
  case "InternalFailureException":
@@ -2073,29 +1835,26 @@ const deserializeAws_restJson1UpdateDetectorModelCommandError = async (output, c
2073
1835
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2074
1836
  default:
2075
1837
  const parsedBody = parsedOutput.body;
2076
- const $metadata = deserializeMetadata(output);
2077
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2078
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
2079
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2080
- $fault: "client",
2081
- $metadata,
1838
+ (0, smithy_client_1.throwDefaultError)({
1839
+ output,
1840
+ parsedBody,
1841
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1842
+ errorCode,
2082
1843
  });
2083
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2084
1844
  }
2085
1845
  };
2086
1846
  const deserializeAws_restJson1UpdateInputCommand = async (output, context) => {
2087
1847
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2088
1848
  return deserializeAws_restJson1UpdateInputCommandError(output, context);
2089
1849
  }
2090
- const contents = {
1850
+ const contents = map({
2091
1851
  $metadata: deserializeMetadata(output),
2092
- inputConfiguration: undefined,
2093
- };
1852
+ });
2094
1853
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2095
- if (data.inputConfiguration !== undefined && data.inputConfiguration !== null) {
1854
+ if (data.inputConfiguration != null) {
2096
1855
  contents.inputConfiguration = deserializeAws_restJson1InputConfiguration(data.inputConfiguration, context);
2097
1856
  }
2098
- return Promise.resolve(contents);
1857
+ return contents;
2099
1858
  };
2100
1859
  exports.deserializeAws_restJson1UpdateInputCommand = deserializeAws_restJson1UpdateInputCommand;
2101
1860
  const deserializeAws_restJson1UpdateInputCommandError = async (output, context) => {
@@ -2103,7 +1862,6 @@ const deserializeAws_restJson1UpdateInputCommandError = async (output, context)
2103
1862
  ...output,
2104
1863
  body: await parseBody(output.body, context),
2105
1864
  };
2106
- let response;
2107
1865
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2108
1866
  switch (errorCode) {
2109
1867
  case "InternalFailureException":
@@ -2126,20 +1884,19 @@ const deserializeAws_restJson1UpdateInputCommandError = async (output, context)
2126
1884
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2127
1885
  default:
2128
1886
  const parsedBody = parsedOutput.body;
2129
- const $metadata = deserializeMetadata(output);
2130
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2131
- response = new IoTEventsServiceException_1.IoTEventsServiceException({
2132
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2133
- $fault: "client",
2134
- $metadata,
1887
+ (0, smithy_client_1.throwDefaultError)({
1888
+ output,
1889
+ parsedBody,
1890
+ exceptionCtor: IoTEventsServiceException_1.IoTEventsServiceException,
1891
+ errorCode,
2135
1892
  });
2136
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2137
1893
  }
2138
1894
  };
1895
+ const map = smithy_client_1.map;
2139
1896
  const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
2140
- const contents = {};
1897
+ const contents = map({});
2141
1898
  const data = parsedOutput.body;
2142
- if (data.message !== undefined && data.message !== null) {
1899
+ if (data.message != null) {
2143
1900
  contents.message = (0, smithy_client_1.expectString)(data.message);
2144
1901
  }
2145
1902
  const exception = new models_0_1.InternalFailureException({
@@ -2149,9 +1906,9 @@ const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOu
2149
1906
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2150
1907
  };
2151
1908
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
2152
- const contents = {};
1909
+ const contents = map({});
2153
1910
  const data = parsedOutput.body;
2154
- if (data.message !== undefined && data.message !== null) {
1911
+ if (data.message != null) {
2155
1912
  contents.message = (0, smithy_client_1.expectString)(data.message);
2156
1913
  }
2157
1914
  const exception = new models_0_1.InvalidRequestException({
@@ -2161,9 +1918,9 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
2161
1918
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2162
1919
  };
2163
1920
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
2164
- const contents = {};
1921
+ const contents = map({});
2165
1922
  const data = parsedOutput.body;
2166
- if (data.message !== undefined && data.message !== null) {
1923
+ if (data.message != null) {
2167
1924
  contents.message = (0, smithy_client_1.expectString)(data.message);
2168
1925
  }
2169
1926
  const exception = new models_0_1.LimitExceededException({
@@ -2173,15 +1930,15 @@ const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutp
2173
1930
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2174
1931
  };
2175
1932
  const deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = async (parsedOutput, context) => {
2176
- const contents = {};
1933
+ const contents = map({});
2177
1934
  const data = parsedOutput.body;
2178
- if (data.message !== undefined && data.message !== null) {
1935
+ if (data.message != null) {
2179
1936
  contents.message = (0, smithy_client_1.expectString)(data.message);
2180
1937
  }
2181
- if (data.resourceArn !== undefined && data.resourceArn !== null) {
1938
+ if (data.resourceArn != null) {
2182
1939
  contents.resourceArn = (0, smithy_client_1.expectString)(data.resourceArn);
2183
1940
  }
2184
- if (data.resourceId !== undefined && data.resourceId !== null) {
1941
+ if (data.resourceId != null) {
2185
1942
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2186
1943
  }
2187
1944
  const exception = new models_0_1.ResourceAlreadyExistsException({
@@ -2191,9 +1948,9 @@ const deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = async (pa
2191
1948
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2192
1949
  };
2193
1950
  const deserializeAws_restJson1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
2194
- const contents = {};
1951
+ const contents = map({});
2195
1952
  const data = parsedOutput.body;
2196
- if (data.message !== undefined && data.message !== null) {
1953
+ if (data.message != null) {
2197
1954
  contents.message = (0, smithy_client_1.expectString)(data.message);
2198
1955
  }
2199
1956
  const exception = new models_0_1.ResourceInUseException({
@@ -2203,9 +1960,9 @@ const deserializeAws_restJson1ResourceInUseExceptionResponse = async (parsedOutp
2203
1960
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2204
1961
  };
2205
1962
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2206
- const contents = {};
1963
+ const contents = map({});
2207
1964
  const data = parsedOutput.body;
2208
- if (data.message !== undefined && data.message !== null) {
1965
+ if (data.message != null) {
2209
1966
  contents.message = (0, smithy_client_1.expectString)(data.message);
2210
1967
  }
2211
1968
  const exception = new models_0_1.ResourceNotFoundException({
@@ -2215,9 +1972,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2215
1972
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2216
1973
  };
2217
1974
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
2218
- const contents = {};
1975
+ const contents = map({});
2219
1976
  const data = parsedOutput.body;
2220
- if (data.message !== undefined && data.message !== null) {
1977
+ if (data.message != null) {
2221
1978
  contents.message = (0, smithy_client_1.expectString)(data.message);
2222
1979
  }
2223
1980
  const exception = new models_0_1.ServiceUnavailableException({
@@ -2227,9 +1984,9 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
2227
1984
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2228
1985
  };
2229
1986
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2230
- const contents = {};
1987
+ const contents = map({});
2231
1988
  const data = parsedOutput.body;
2232
- if (data.message !== undefined && data.message !== null) {
1989
+ if (data.message != null) {
2233
1990
  contents.message = (0, smithy_client_1.expectString)(data.message);
2234
1991
  }
2235
1992
  const exception = new models_0_1.ThrottlingException({
@@ -2239,9 +1996,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2239
1996
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2240
1997
  };
2241
1998
  const deserializeAws_restJson1UnsupportedOperationExceptionResponse = async (parsedOutput, context) => {
2242
- const contents = {};
1999
+ const contents = map({});
2243
2000
  const data = parsedOutput.body;
2244
- if (data.message !== undefined && data.message !== null) {
2001
+ if (data.message != null) {
2245
2002
  contents.message = (0, smithy_client_1.expectString)(data.message);
2246
2003
  }
2247
2004
  const exception = new models_0_1.UnsupportedOperationException({
@@ -2282,9 +2039,6 @@ const serializeAws_restJson1Actions = (input, context) => {
2282
2039
  return input
2283
2040
  .filter((e) => e != null)
2284
2041
  .map((entry) => {
2285
- if (entry === null) {
2286
- return null;
2287
- }
2288
2042
  return serializeAws_restJson1Action(entry, context);
2289
2043
  });
2290
2044
  };
@@ -2309,9 +2063,6 @@ const serializeAws_restJson1AlarmActions = (input, context) => {
2309
2063
  return input
2310
2064
  .filter((e) => e != null)
2311
2065
  .map((entry) => {
2312
- if (entry === null) {
2313
- return null;
2314
- }
2315
2066
  return serializeAws_restJson1AlarmAction(entry, context);
2316
2067
  });
2317
2068
  };
@@ -2376,9 +2127,6 @@ const serializeAws_restJson1Attributes = (input, context) => {
2376
2127
  return input
2377
2128
  .filter((e) => e != null)
2378
2129
  .map((entry) => {
2379
- if (entry === null) {
2380
- return null;
2381
- }
2382
2130
  return serializeAws_restJson1Attribute(entry, context);
2383
2131
  });
2384
2132
  };
@@ -2397,9 +2145,6 @@ const serializeAws_restJson1DetectorDebugOptions = (input, context) => {
2397
2145
  return input
2398
2146
  .filter((e) => e != null)
2399
2147
  .map((entry) => {
2400
- if (entry === null) {
2401
- return null;
2402
- }
2403
2148
  return serializeAws_restJson1DetectorDebugOption(entry, context);
2404
2149
  });
2405
2150
  };
@@ -2440,9 +2185,6 @@ const serializeAws_restJson1EmailConfigurations = (input, context) => {
2440
2185
  return input
2441
2186
  .filter((e) => e != null)
2442
2187
  .map((entry) => {
2443
- if (entry === null) {
2444
- return null;
2445
- }
2446
2188
  return serializeAws_restJson1EmailConfiguration(entry, context);
2447
2189
  });
2448
2190
  };
@@ -2468,9 +2210,6 @@ const serializeAws_restJson1Events = (input, context) => {
2468
2210
  return input
2469
2211
  .filter((e) => e != null)
2470
2212
  .map((entry) => {
2471
- if (entry === null) {
2472
- return null;
2473
- }
2474
2213
  return serializeAws_restJson1Event(entry, context);
2475
2214
  });
2476
2215
  };
@@ -2573,9 +2312,6 @@ const serializeAws_restJson1NotificationActions = (input, context) => {
2573
2312
  return input
2574
2313
  .filter((e) => e != null)
2575
2314
  .map((entry) => {
2576
- if (entry === null) {
2577
- return null;
2578
- }
2579
2315
  return serializeAws_restJson1NotificationAction(entry, context);
2580
2316
  });
2581
2317
  };
@@ -2619,9 +2355,6 @@ const serializeAws_restJson1RecipientDetails = (input, context) => {
2619
2355
  return input
2620
2356
  .filter((e) => e != null)
2621
2357
  .map((entry) => {
2622
- if (entry === null) {
2623
- return null;
2624
- }
2625
2358
  return serializeAws_restJson1RecipientDetail(entry, context);
2626
2359
  });
2627
2360
  };
@@ -2661,9 +2394,6 @@ const serializeAws_restJson1SMSConfigurations = (input, context) => {
2661
2394
  return input
2662
2395
  .filter((e) => e != null)
2663
2396
  .map((entry) => {
2664
- if (entry === null) {
2665
- return null;
2666
- }
2667
2397
  return serializeAws_restJson1SMSConfiguration(entry, context);
2668
2398
  });
2669
2399
  };
@@ -2698,9 +2428,6 @@ const serializeAws_restJson1States = (input, context) => {
2698
2428
  return input
2699
2429
  .filter((e) => e != null)
2700
2430
  .map((entry) => {
2701
- if (entry === null) {
2702
- return null;
2703
- }
2704
2431
  return serializeAws_restJson1State(entry, context);
2705
2432
  });
2706
2433
  };
@@ -2714,9 +2441,6 @@ const serializeAws_restJson1Tags = (input, context) => {
2714
2441
  return input
2715
2442
  .filter((e) => e != null)
2716
2443
  .map((entry) => {
2717
- if (entry === null) {
2718
- return null;
2719
- }
2720
2444
  return serializeAws_restJson1Tag(entry, context);
2721
2445
  });
2722
2446
  };
@@ -2732,9 +2456,6 @@ const serializeAws_restJson1TransitionEvents = (input, context) => {
2732
2456
  return input
2733
2457
  .filter((e) => e != null)
2734
2458
  .map((entry) => {
2735
- if (entry === null) {
2736
- return null;
2737
- }
2738
2459
  return serializeAws_restJson1TransitionEvent(entry, context);
2739
2460
  });
2740
2461
  };