@aws-sdk/client-iot-events-data 3.183.0 → 3.185.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1011 +1,1332 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { IoTEventsDataServiceException as __BaseException } from "../models/IoTEventsDataServiceException";
4
5
  import { InternalFailureException, InvalidRequestException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
5
- export const serializeAws_restJson1BatchAcknowledgeAlarmCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
- const headers = {
8
- "content-type": "application/json",
9
- };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/acknowledge";
11
- let body;
12
- body = JSON.stringify({
13
- ...(input.acknowledgeActionRequests != null && {
14
- acknowledgeActionRequests: serializeAws_restJson1AcknowledgeAlarmActionRequests(input.acknowledgeActionRequests, context),
15
- }),
6
+ export var serializeAws_restJson1BatchAcknowledgeAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/acknowledge";
17
+ body = JSON.stringify(__assign({}, (input.acknowledgeActionRequests != null && {
18
+ acknowledgeActionRequests: serializeAws_restJson1AcknowledgeAlarmActionRequests(input.acknowledgeActionRequests, context),
19
+ })));
20
+ return [2, new __HttpRequest({
21
+ protocol: protocol,
22
+ hostname: hostname,
23
+ port: port,
24
+ method: "POST",
25
+ headers: headers,
26
+ path: resolvedPath,
27
+ body: body,
28
+ })];
29
+ }
16
30
  });
17
- return new __HttpRequest({
18
- protocol,
19
- hostname,
20
- port,
21
- method: "POST",
22
- headers,
23
- path: resolvedPath,
24
- body,
31
+ }); };
32
+ export var serializeAws_restJson1BatchDeleteDetectorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
34
+ return __generator(this, function (_c) {
35
+ switch (_c.label) {
36
+ case 0: return [4, context.endpoint()];
37
+ case 1:
38
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
+ headers = {
40
+ "content-type": "application/json",
41
+ };
42
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detectors/delete";
43
+ body = JSON.stringify(__assign({}, (input.detectors != null && {
44
+ detectors: serializeAws_restJson1DeleteDetectorRequests(input.detectors, context),
45
+ })));
46
+ return [2, new __HttpRequest({
47
+ protocol: protocol,
48
+ hostname: hostname,
49
+ port: port,
50
+ method: "POST",
51
+ headers: headers,
52
+ path: resolvedPath,
53
+ body: body,
54
+ })];
55
+ }
25
56
  });
26
- };
27
- export const serializeAws_restJson1BatchDeleteDetectorCommand = async (input, context) => {
28
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
29
- const headers = {
30
- "content-type": "application/json",
31
- };
32
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/detectors/delete";
33
- let body;
34
- body = JSON.stringify({
35
- ...(input.detectors != null && {
36
- detectors: serializeAws_restJson1DeleteDetectorRequests(input.detectors, context),
37
- }),
57
+ }); };
58
+ export var serializeAws_restJson1BatchDisableAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
59
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
60
+ return __generator(this, function (_c) {
61
+ switch (_c.label) {
62
+ case 0: return [4, context.endpoint()];
63
+ case 1:
64
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
65
+ headers = {
66
+ "content-type": "application/json",
67
+ };
68
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/disable";
69
+ body = JSON.stringify(__assign({}, (input.disableActionRequests != null && {
70
+ disableActionRequests: serializeAws_restJson1DisableAlarmActionRequests(input.disableActionRequests, context),
71
+ })));
72
+ return [2, new __HttpRequest({
73
+ protocol: protocol,
74
+ hostname: hostname,
75
+ port: port,
76
+ method: "POST",
77
+ headers: headers,
78
+ path: resolvedPath,
79
+ body: body,
80
+ })];
81
+ }
38
82
  });
39
- return new __HttpRequest({
40
- protocol,
41
- hostname,
42
- port,
43
- method: "POST",
44
- headers,
45
- path: resolvedPath,
46
- body,
83
+ }); };
84
+ export var serializeAws_restJson1BatchEnableAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
85
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
86
+ return __generator(this, function (_c) {
87
+ switch (_c.label) {
88
+ case 0: return [4, context.endpoint()];
89
+ case 1:
90
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
91
+ headers = {
92
+ "content-type": "application/json",
93
+ };
94
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/enable";
95
+ body = JSON.stringify(__assign({}, (input.enableActionRequests != null && {
96
+ enableActionRequests: serializeAws_restJson1EnableAlarmActionRequests(input.enableActionRequests, context),
97
+ })));
98
+ return [2, new __HttpRequest({
99
+ protocol: protocol,
100
+ hostname: hostname,
101
+ port: port,
102
+ method: "POST",
103
+ headers: headers,
104
+ path: resolvedPath,
105
+ body: body,
106
+ })];
107
+ }
47
108
  });
48
- };
49
- export const serializeAws_restJson1BatchDisableAlarmCommand = async (input, context) => {
50
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
51
- const headers = {
52
- "content-type": "application/json",
53
- };
54
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/disable";
55
- let body;
56
- body = JSON.stringify({
57
- ...(input.disableActionRequests != null && {
58
- disableActionRequests: serializeAws_restJson1DisableAlarmActionRequests(input.disableActionRequests, context),
59
- }),
109
+ }); };
110
+ export var serializeAws_restJson1BatchPutMessageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
111
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
112
+ return __generator(this, function (_c) {
113
+ switch (_c.label) {
114
+ case 0: return [4, context.endpoint()];
115
+ case 1:
116
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
117
+ headers = {
118
+ "content-type": "application/json",
119
+ };
120
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/inputs/messages";
121
+ body = JSON.stringify(__assign({}, (input.messages != null && { messages: serializeAws_restJson1Messages(input.messages, context) })));
122
+ return [2, new __HttpRequest({
123
+ protocol: protocol,
124
+ hostname: hostname,
125
+ port: port,
126
+ method: "POST",
127
+ headers: headers,
128
+ path: resolvedPath,
129
+ body: body,
130
+ })];
131
+ }
60
132
  });
61
- return new __HttpRequest({
62
- protocol,
63
- hostname,
64
- port,
65
- method: "POST",
66
- headers,
67
- path: resolvedPath,
68
- body,
133
+ }); };
134
+ export var serializeAws_restJson1BatchResetAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
135
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
136
+ return __generator(this, function (_c) {
137
+ switch (_c.label) {
138
+ case 0: return [4, context.endpoint()];
139
+ case 1:
140
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
141
+ headers = {
142
+ "content-type": "application/json",
143
+ };
144
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/reset";
145
+ body = JSON.stringify(__assign({}, (input.resetActionRequests != null && {
146
+ resetActionRequests: serializeAws_restJson1ResetAlarmActionRequests(input.resetActionRequests, context),
147
+ })));
148
+ return [2, new __HttpRequest({
149
+ protocol: protocol,
150
+ hostname: hostname,
151
+ port: port,
152
+ method: "POST",
153
+ headers: headers,
154
+ path: resolvedPath,
155
+ body: body,
156
+ })];
157
+ }
69
158
  });
70
- };
71
- export const serializeAws_restJson1BatchEnableAlarmCommand = async (input, context) => {
72
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
73
- const headers = {
74
- "content-type": "application/json",
75
- };
76
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/enable";
77
- let body;
78
- body = JSON.stringify({
79
- ...(input.enableActionRequests != null && {
80
- enableActionRequests: serializeAws_restJson1EnableAlarmActionRequests(input.enableActionRequests, context),
81
- }),
159
+ }); };
160
+ export var serializeAws_restJson1BatchSnoozeAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
161
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
162
+ return __generator(this, function (_c) {
163
+ switch (_c.label) {
164
+ case 0: return [4, context.endpoint()];
165
+ case 1:
166
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
167
+ headers = {
168
+ "content-type": "application/json",
169
+ };
170
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/snooze";
171
+ body = JSON.stringify(__assign({}, (input.snoozeActionRequests != null && {
172
+ snoozeActionRequests: serializeAws_restJson1SnoozeAlarmActionRequests(input.snoozeActionRequests, context),
173
+ })));
174
+ return [2, new __HttpRequest({
175
+ protocol: protocol,
176
+ hostname: hostname,
177
+ port: port,
178
+ method: "POST",
179
+ headers: headers,
180
+ path: resolvedPath,
181
+ body: body,
182
+ })];
183
+ }
82
184
  });
83
- return new __HttpRequest({
84
- protocol,
85
- hostname,
86
- port,
87
- method: "POST",
88
- headers,
89
- path: resolvedPath,
90
- body,
185
+ }); };
186
+ export var serializeAws_restJson1BatchUpdateDetectorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
187
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
188
+ return __generator(this, function (_c) {
189
+ switch (_c.label) {
190
+ case 0: return [4, context.endpoint()];
191
+ case 1:
192
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
193
+ headers = {
194
+ "content-type": "application/json",
195
+ };
196
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detectors";
197
+ body = JSON.stringify(__assign({}, (input.detectors != null && {
198
+ detectors: serializeAws_restJson1UpdateDetectorRequests(input.detectors, context),
199
+ })));
200
+ return [2, new __HttpRequest({
201
+ protocol: protocol,
202
+ hostname: hostname,
203
+ port: port,
204
+ method: "POST",
205
+ headers: headers,
206
+ path: resolvedPath,
207
+ body: body,
208
+ })];
209
+ }
91
210
  });
92
- };
93
- export const serializeAws_restJson1BatchPutMessageCommand = async (input, context) => {
94
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
- const headers = {
96
- "content-type": "application/json",
97
- };
98
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/inputs/messages";
99
- let body;
100
- body = JSON.stringify({
101
- ...(input.messages != null && { messages: serializeAws_restJson1Messages(input.messages, context) }),
211
+ }); };
212
+ export var serializeAws_restJson1DescribeAlarmCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
213
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
214
+ return __generator(this, function (_c) {
215
+ switch (_c.label) {
216
+ case 0: return [4, context.endpoint()];
217
+ case 1:
218
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
219
+ headers = {};
220
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/{alarmModelName}/keyValues";
221
+ resolvedPath = __resolvedPath(resolvedPath, input, "alarmModelName", function () { return input.alarmModelName; }, "{alarmModelName}", false);
222
+ query = map({
223
+ keyValue: [, input.keyValue],
224
+ });
225
+ return [2, new __HttpRequest({
226
+ protocol: protocol,
227
+ hostname: hostname,
228
+ port: port,
229
+ method: "GET",
230
+ headers: headers,
231
+ path: resolvedPath,
232
+ query: query,
233
+ body: body,
234
+ })];
235
+ }
102
236
  });
103
- return new __HttpRequest({
104
- protocol,
105
- hostname,
106
- port,
107
- method: "POST",
108
- headers,
109
- path: resolvedPath,
110
- body,
237
+ }); };
238
+ export var serializeAws_restJson1DescribeDetectorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
239
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
240
+ return __generator(this, function (_c) {
241
+ switch (_c.label) {
242
+ case 0: return [4, context.endpoint()];
243
+ case 1:
244
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
245
+ headers = {};
246
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detectors/{detectorModelName}/keyValues";
247
+ resolvedPath = __resolvedPath(resolvedPath, input, "detectorModelName", function () { return input.detectorModelName; }, "{detectorModelName}", false);
248
+ query = map({
249
+ keyValue: [, input.keyValue],
250
+ });
251
+ return [2, new __HttpRequest({
252
+ protocol: protocol,
253
+ hostname: hostname,
254
+ port: port,
255
+ method: "GET",
256
+ headers: headers,
257
+ path: resolvedPath,
258
+ query: query,
259
+ body: body,
260
+ })];
261
+ }
111
262
  });
112
- };
113
- export const serializeAws_restJson1BatchResetAlarmCommand = async (input, context) => {
114
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
- const headers = {
116
- "content-type": "application/json",
117
- };
118
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/reset";
119
- let body;
120
- body = JSON.stringify({
121
- ...(input.resetActionRequests != null && {
122
- resetActionRequests: serializeAws_restJson1ResetAlarmActionRequests(input.resetActionRequests, context),
123
- }),
263
+ }); };
264
+ export var serializeAws_restJson1ListAlarmsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
265
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
266
+ return __generator(this, function (_c) {
267
+ switch (_c.label) {
268
+ case 0: return [4, context.endpoint()];
269
+ case 1:
270
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
271
+ headers = {};
272
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alarms/{alarmModelName}";
273
+ resolvedPath = __resolvedPath(resolvedPath, input, "alarmModelName", function () { return input.alarmModelName; }, "{alarmModelName}", false);
274
+ query = map({
275
+ nextToken: [, input.nextToken],
276
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
277
+ });
278
+ return [2, new __HttpRequest({
279
+ protocol: protocol,
280
+ hostname: hostname,
281
+ port: port,
282
+ method: "GET",
283
+ headers: headers,
284
+ path: resolvedPath,
285
+ query: query,
286
+ body: body,
287
+ })];
288
+ }
124
289
  });
125
- return new __HttpRequest({
126
- protocol,
127
- hostname,
128
- port,
129
- method: "POST",
130
- headers,
131
- path: resolvedPath,
132
- body,
290
+ }); };
291
+ export var serializeAws_restJson1ListDetectorsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
292
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
293
+ return __generator(this, function (_c) {
294
+ switch (_c.label) {
295
+ case 0: return [4, context.endpoint()];
296
+ case 1:
297
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
298
+ headers = {};
299
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detectors/{detectorModelName}";
300
+ resolvedPath = __resolvedPath(resolvedPath, input, "detectorModelName", function () { return input.detectorModelName; }, "{detectorModelName}", false);
301
+ query = map({
302
+ stateName: [, input.stateName],
303
+ nextToken: [, input.nextToken],
304
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
305
+ });
306
+ return [2, new __HttpRequest({
307
+ protocol: protocol,
308
+ hostname: hostname,
309
+ port: port,
310
+ method: "GET",
311
+ headers: headers,
312
+ path: resolvedPath,
313
+ query: query,
314
+ body: body,
315
+ })];
316
+ }
133
317
  });
134
- };
135
- export const serializeAws_restJson1BatchSnoozeAlarmCommand = async (input, context) => {
136
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
- const headers = {
138
- "content-type": "application/json",
139
- };
140
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/snooze";
141
- let body;
142
- body = JSON.stringify({
143
- ...(input.snoozeActionRequests != null && {
144
- snoozeActionRequests: serializeAws_restJson1SnoozeAlarmActionRequests(input.snoozeActionRequests, context),
145
- }),
318
+ }); };
319
+ export var deserializeAws_restJson1BatchAcknowledgeAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
320
+ var contents, data, _a, _b;
321
+ return __generator(this, function (_c) {
322
+ switch (_c.label) {
323
+ case 0:
324
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
325
+ return [2, deserializeAws_restJson1BatchAcknowledgeAlarmCommandError(output, context)];
326
+ }
327
+ contents = map({
328
+ $metadata: deserializeMetadata(output),
329
+ });
330
+ _a = __expectNonNull;
331
+ _b = __expectObject;
332
+ return [4, parseBody(output.body, context)];
333
+ case 1:
334
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
335
+ if (data.errorEntries != null) {
336
+ contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
337
+ }
338
+ return [2, contents];
339
+ }
146
340
  });
147
- return new __HttpRequest({
148
- protocol,
149
- hostname,
150
- port,
151
- method: "POST",
152
- headers,
153
- path: resolvedPath,
154
- body,
341
+ }); };
342
+ var deserializeAws_restJson1BatchAcknowledgeAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
343
+ var parsedOutput, _a, errorCode, _b, parsedBody;
344
+ var _c;
345
+ return __generator(this, function (_d) {
346
+ switch (_d.label) {
347
+ case 0:
348
+ _a = [__assign({}, output)];
349
+ _c = {};
350
+ return [4, parseErrorBody(output.body, context)];
351
+ case 1:
352
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
353
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
354
+ _b = errorCode;
355
+ switch (_b) {
356
+ case "InternalFailureException": return [3, 2];
357
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
358
+ case "InvalidRequestException": return [3, 4];
359
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
360
+ case "ServiceUnavailableException": return [3, 6];
361
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
362
+ case "ThrottlingException": return [3, 8];
363
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
364
+ }
365
+ return [3, 10];
366
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
367
+ case 3: throw _d.sent();
368
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
369
+ case 5: throw _d.sent();
370
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
371
+ case 7: throw _d.sent();
372
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
373
+ case 9: throw _d.sent();
374
+ case 10:
375
+ parsedBody = parsedOutput.body;
376
+ throwDefaultError({
377
+ output: output,
378
+ parsedBody: parsedBody,
379
+ exceptionCtor: __BaseException,
380
+ errorCode: errorCode,
381
+ });
382
+ _d.label = 11;
383
+ case 11: return [2];
384
+ }
155
385
  });
156
- };
157
- export const serializeAws_restJson1BatchUpdateDetectorCommand = async (input, context) => {
158
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
159
- const headers = {
160
- "content-type": "application/json",
161
- };
162
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/detectors";
163
- let body;
164
- body = JSON.stringify({
165
- ...(input.detectors != null && {
166
- detectors: serializeAws_restJson1UpdateDetectorRequests(input.detectors, context),
167
- }),
386
+ }); };
387
+ export var deserializeAws_restJson1BatchDeleteDetectorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
388
+ var contents, data, _a, _b;
389
+ return __generator(this, function (_c) {
390
+ switch (_c.label) {
391
+ case 0:
392
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
393
+ return [2, deserializeAws_restJson1BatchDeleteDetectorCommandError(output, context)];
394
+ }
395
+ contents = map({
396
+ $metadata: deserializeMetadata(output),
397
+ });
398
+ _a = __expectNonNull;
399
+ _b = __expectObject;
400
+ return [4, parseBody(output.body, context)];
401
+ case 1:
402
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
403
+ if (data.batchDeleteDetectorErrorEntries != null) {
404
+ contents.batchDeleteDetectorErrorEntries = deserializeAws_restJson1BatchDeleteDetectorErrorEntries(data.batchDeleteDetectorErrorEntries, context);
405
+ }
406
+ return [2, contents];
407
+ }
168
408
  });
169
- return new __HttpRequest({
170
- protocol,
171
- hostname,
172
- port,
173
- method: "POST",
174
- headers,
175
- path: resolvedPath,
176
- body,
409
+ }); };
410
+ var deserializeAws_restJson1BatchDeleteDetectorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
411
+ var parsedOutput, _a, errorCode, _b, parsedBody;
412
+ var _c;
413
+ return __generator(this, function (_d) {
414
+ switch (_d.label) {
415
+ case 0:
416
+ _a = [__assign({}, output)];
417
+ _c = {};
418
+ return [4, parseErrorBody(output.body, context)];
419
+ case 1:
420
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
421
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ _b = errorCode;
423
+ switch (_b) {
424
+ case "InternalFailureException": return [3, 2];
425
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
426
+ case "InvalidRequestException": return [3, 4];
427
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
428
+ case "ServiceUnavailableException": return [3, 6];
429
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
430
+ case "ThrottlingException": return [3, 8];
431
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
432
+ }
433
+ return [3, 10];
434
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
435
+ case 3: throw _d.sent();
436
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
437
+ case 5: throw _d.sent();
438
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
439
+ case 7: throw _d.sent();
440
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
441
+ case 9: throw _d.sent();
442
+ case 10:
443
+ parsedBody = parsedOutput.body;
444
+ throwDefaultError({
445
+ output: output,
446
+ parsedBody: parsedBody,
447
+ exceptionCtor: __BaseException,
448
+ errorCode: errorCode,
449
+ });
450
+ _d.label = 11;
451
+ case 11: return [2];
452
+ }
177
453
  });
178
- };
179
- export const serializeAws_restJson1DescribeAlarmCommand = async (input, context) => {
180
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
- const headers = {};
182
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/{alarmModelName}/keyValues";
183
- resolvedPath = __resolvedPath(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
184
- const query = map({
185
- keyValue: [, input.keyValue],
454
+ }); };
455
+ export var deserializeAws_restJson1BatchDisableAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
456
+ var contents, data, _a, _b;
457
+ return __generator(this, function (_c) {
458
+ switch (_c.label) {
459
+ case 0:
460
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
461
+ return [2, deserializeAws_restJson1BatchDisableAlarmCommandError(output, context)];
462
+ }
463
+ contents = map({
464
+ $metadata: deserializeMetadata(output),
465
+ });
466
+ _a = __expectNonNull;
467
+ _b = __expectObject;
468
+ return [4, parseBody(output.body, context)];
469
+ case 1:
470
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
471
+ if (data.errorEntries != null) {
472
+ contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
473
+ }
474
+ return [2, contents];
475
+ }
186
476
  });
187
- let body;
188
- return new __HttpRequest({
189
- protocol,
190
- hostname,
191
- port,
192
- method: "GET",
193
- headers,
194
- path: resolvedPath,
195
- query,
196
- body,
477
+ }); };
478
+ var deserializeAws_restJson1BatchDisableAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
479
+ var parsedOutput, _a, errorCode, _b, parsedBody;
480
+ var _c;
481
+ return __generator(this, function (_d) {
482
+ switch (_d.label) {
483
+ case 0:
484
+ _a = [__assign({}, output)];
485
+ _c = {};
486
+ return [4, parseErrorBody(output.body, context)];
487
+ case 1:
488
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
489
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
490
+ _b = errorCode;
491
+ switch (_b) {
492
+ case "InternalFailureException": return [3, 2];
493
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
494
+ case "InvalidRequestException": return [3, 4];
495
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
496
+ case "ServiceUnavailableException": return [3, 6];
497
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
498
+ case "ThrottlingException": return [3, 8];
499
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
500
+ }
501
+ return [3, 10];
502
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
503
+ case 3: throw _d.sent();
504
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
505
+ case 5: throw _d.sent();
506
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
507
+ case 7: throw _d.sent();
508
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
509
+ case 9: throw _d.sent();
510
+ case 10:
511
+ parsedBody = parsedOutput.body;
512
+ throwDefaultError({
513
+ output: output,
514
+ parsedBody: parsedBody,
515
+ exceptionCtor: __BaseException,
516
+ errorCode: errorCode,
517
+ });
518
+ _d.label = 11;
519
+ case 11: return [2];
520
+ }
197
521
  });
198
- };
199
- export const serializeAws_restJson1DescribeDetectorCommand = async (input, context) => {
200
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
201
- const headers = {};
202
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/detectors/{detectorModelName}/keyValues";
203
- resolvedPath = __resolvedPath(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
204
- const query = map({
205
- keyValue: [, input.keyValue],
522
+ }); };
523
+ export var deserializeAws_restJson1BatchEnableAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
524
+ var contents, data, _a, _b;
525
+ return __generator(this, function (_c) {
526
+ switch (_c.label) {
527
+ case 0:
528
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
529
+ return [2, deserializeAws_restJson1BatchEnableAlarmCommandError(output, context)];
530
+ }
531
+ contents = map({
532
+ $metadata: deserializeMetadata(output),
533
+ });
534
+ _a = __expectNonNull;
535
+ _b = __expectObject;
536
+ return [4, parseBody(output.body, context)];
537
+ case 1:
538
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
539
+ if (data.errorEntries != null) {
540
+ contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
541
+ }
542
+ return [2, contents];
543
+ }
206
544
  });
207
- let body;
208
- return new __HttpRequest({
209
- protocol,
210
- hostname,
211
- port,
212
- method: "GET",
213
- headers,
214
- path: resolvedPath,
215
- query,
216
- body,
545
+ }); };
546
+ var deserializeAws_restJson1BatchEnableAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
547
+ var parsedOutput, _a, errorCode, _b, parsedBody;
548
+ var _c;
549
+ return __generator(this, function (_d) {
550
+ switch (_d.label) {
551
+ case 0:
552
+ _a = [__assign({}, output)];
553
+ _c = {};
554
+ return [4, parseErrorBody(output.body, context)];
555
+ case 1:
556
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
557
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
558
+ _b = errorCode;
559
+ switch (_b) {
560
+ case "InternalFailureException": return [3, 2];
561
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
562
+ case "InvalidRequestException": return [3, 4];
563
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
564
+ case "ServiceUnavailableException": return [3, 6];
565
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
566
+ case "ThrottlingException": return [3, 8];
567
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
568
+ }
569
+ return [3, 10];
570
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
571
+ case 3: throw _d.sent();
572
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
573
+ case 5: throw _d.sent();
574
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
575
+ case 7: throw _d.sent();
576
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
577
+ case 9: throw _d.sent();
578
+ case 10:
579
+ parsedBody = parsedOutput.body;
580
+ throwDefaultError({
581
+ output: output,
582
+ parsedBody: parsedBody,
583
+ exceptionCtor: __BaseException,
584
+ errorCode: errorCode,
585
+ });
586
+ _d.label = 11;
587
+ case 11: return [2];
588
+ }
217
589
  });
218
- };
219
- export const serializeAws_restJson1ListAlarmsCommand = async (input, context) => {
220
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
221
- const headers = {};
222
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/alarms/{alarmModelName}";
223
- resolvedPath = __resolvedPath(resolvedPath, input, "alarmModelName", () => input.alarmModelName, "{alarmModelName}", false);
224
- const query = map({
225
- nextToken: [, input.nextToken],
226
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
590
+ }); };
591
+ export var deserializeAws_restJson1BatchPutMessageCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
592
+ var contents, data, _a, _b;
593
+ return __generator(this, function (_c) {
594
+ switch (_c.label) {
595
+ case 0:
596
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
597
+ return [2, deserializeAws_restJson1BatchPutMessageCommandError(output, context)];
598
+ }
599
+ contents = map({
600
+ $metadata: deserializeMetadata(output),
601
+ });
602
+ _a = __expectNonNull;
603
+ _b = __expectObject;
604
+ return [4, parseBody(output.body, context)];
605
+ case 1:
606
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
607
+ if (data.BatchPutMessageErrorEntries != null) {
608
+ contents.BatchPutMessageErrorEntries = deserializeAws_restJson1BatchPutMessageErrorEntries(data.BatchPutMessageErrorEntries, context);
609
+ }
610
+ return [2, contents];
611
+ }
227
612
  });
228
- let body;
229
- return new __HttpRequest({
230
- protocol,
231
- hostname,
232
- port,
233
- method: "GET",
234
- headers,
235
- path: resolvedPath,
236
- query,
237
- body,
613
+ }); };
614
+ var deserializeAws_restJson1BatchPutMessageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
615
+ var parsedOutput, _a, errorCode, _b, parsedBody;
616
+ var _c;
617
+ return __generator(this, function (_d) {
618
+ switch (_d.label) {
619
+ case 0:
620
+ _a = [__assign({}, output)];
621
+ _c = {};
622
+ return [4, parseErrorBody(output.body, context)];
623
+ case 1:
624
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
625
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
626
+ _b = errorCode;
627
+ switch (_b) {
628
+ case "InternalFailureException": return [3, 2];
629
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
630
+ case "InvalidRequestException": return [3, 4];
631
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
632
+ case "ServiceUnavailableException": return [3, 6];
633
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
634
+ case "ThrottlingException": return [3, 8];
635
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
636
+ }
637
+ return [3, 10];
638
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
639
+ case 3: throw _d.sent();
640
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
641
+ case 5: throw _d.sent();
642
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
643
+ case 7: throw _d.sent();
644
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
645
+ case 9: throw _d.sent();
646
+ case 10:
647
+ parsedBody = parsedOutput.body;
648
+ throwDefaultError({
649
+ output: output,
650
+ parsedBody: parsedBody,
651
+ exceptionCtor: __BaseException,
652
+ errorCode: errorCode,
653
+ });
654
+ _d.label = 11;
655
+ case 11: return [2];
656
+ }
238
657
  });
239
- };
240
- export const serializeAws_restJson1ListDetectorsCommand = async (input, context) => {
241
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
242
- const headers = {};
243
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/detectors/{detectorModelName}";
244
- resolvedPath = __resolvedPath(resolvedPath, input, "detectorModelName", () => input.detectorModelName, "{detectorModelName}", false);
245
- const query = map({
246
- stateName: [, input.stateName],
247
- nextToken: [, input.nextToken],
248
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
658
+ }); };
659
+ export var deserializeAws_restJson1BatchResetAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
660
+ var contents, data, _a, _b;
661
+ return __generator(this, function (_c) {
662
+ switch (_c.label) {
663
+ case 0:
664
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
665
+ return [2, deserializeAws_restJson1BatchResetAlarmCommandError(output, context)];
666
+ }
667
+ contents = map({
668
+ $metadata: deserializeMetadata(output),
669
+ });
670
+ _a = __expectNonNull;
671
+ _b = __expectObject;
672
+ return [4, parseBody(output.body, context)];
673
+ case 1:
674
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
675
+ if (data.errorEntries != null) {
676
+ contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
677
+ }
678
+ return [2, contents];
679
+ }
249
680
  });
250
- let body;
251
- return new __HttpRequest({
252
- protocol,
253
- hostname,
254
- port,
255
- method: "GET",
256
- headers,
257
- path: resolvedPath,
258
- query,
259
- body,
681
+ }); };
682
+ var deserializeAws_restJson1BatchResetAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
683
+ var parsedOutput, _a, errorCode, _b, parsedBody;
684
+ var _c;
685
+ return __generator(this, function (_d) {
686
+ switch (_d.label) {
687
+ case 0:
688
+ _a = [__assign({}, output)];
689
+ _c = {};
690
+ return [4, parseErrorBody(output.body, context)];
691
+ case 1:
692
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
693
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
+ _b = errorCode;
695
+ switch (_b) {
696
+ case "InternalFailureException": return [3, 2];
697
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
698
+ case "InvalidRequestException": return [3, 4];
699
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
700
+ case "ServiceUnavailableException": return [3, 6];
701
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
702
+ case "ThrottlingException": return [3, 8];
703
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
704
+ }
705
+ return [3, 10];
706
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
707
+ case 3: throw _d.sent();
708
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
709
+ case 5: throw _d.sent();
710
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
711
+ case 7: throw _d.sent();
712
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
713
+ case 9: throw _d.sent();
714
+ case 10:
715
+ parsedBody = parsedOutput.body;
716
+ throwDefaultError({
717
+ output: output,
718
+ parsedBody: parsedBody,
719
+ exceptionCtor: __BaseException,
720
+ errorCode: errorCode,
721
+ });
722
+ _d.label = 11;
723
+ case 11: return [2];
724
+ }
260
725
  });
261
- };
262
- export const deserializeAws_restJson1BatchAcknowledgeAlarmCommand = async (output, context) => {
263
- if (output.statusCode !== 202 && output.statusCode >= 300) {
264
- return deserializeAws_restJson1BatchAcknowledgeAlarmCommandError(output, context);
265
- }
266
- const contents = map({
267
- $metadata: deserializeMetadata(output),
726
+ }); };
727
+ export var deserializeAws_restJson1BatchSnoozeAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
728
+ var contents, data, _a, _b;
729
+ return __generator(this, function (_c) {
730
+ switch (_c.label) {
731
+ case 0:
732
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
733
+ return [2, deserializeAws_restJson1BatchSnoozeAlarmCommandError(output, context)];
734
+ }
735
+ contents = map({
736
+ $metadata: deserializeMetadata(output),
737
+ });
738
+ _a = __expectNonNull;
739
+ _b = __expectObject;
740
+ return [4, parseBody(output.body, context)];
741
+ case 1:
742
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
743
+ if (data.errorEntries != null) {
744
+ contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
745
+ }
746
+ return [2, contents];
747
+ }
268
748
  });
269
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
270
- if (data.errorEntries != null) {
271
- contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
272
- }
273
- return contents;
274
- };
275
- const deserializeAws_restJson1BatchAcknowledgeAlarmCommandError = async (output, context) => {
276
- const parsedOutput = {
277
- ...output,
278
- body: await parseErrorBody(output.body, context),
279
- };
280
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
281
- switch (errorCode) {
282
- case "InternalFailureException":
283
- case "com.amazonaws.ioteventsdata#InternalFailureException":
284
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
285
- case "InvalidRequestException":
286
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
287
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
288
- case "ServiceUnavailableException":
289
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
290
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
291
- case "ThrottlingException":
292
- case "com.amazonaws.ioteventsdata#ThrottlingException":
293
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
294
- default:
295
- const parsedBody = parsedOutput.body;
296
- throwDefaultError({
297
- output,
298
- parsedBody,
299
- exceptionCtor: __BaseException,
300
- errorCode,
301
- });
302
- }
303
- };
304
- export const deserializeAws_restJson1BatchDeleteDetectorCommand = async (output, context) => {
305
- if (output.statusCode !== 200 && output.statusCode >= 300) {
306
- return deserializeAws_restJson1BatchDeleteDetectorCommandError(output, context);
307
- }
308
- const contents = map({
309
- $metadata: deserializeMetadata(output),
749
+ }); };
750
+ var deserializeAws_restJson1BatchSnoozeAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
751
+ var parsedOutput, _a, errorCode, _b, parsedBody;
752
+ var _c;
753
+ return __generator(this, function (_d) {
754
+ switch (_d.label) {
755
+ case 0:
756
+ _a = [__assign({}, output)];
757
+ _c = {};
758
+ return [4, parseErrorBody(output.body, context)];
759
+ case 1:
760
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
761
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
762
+ _b = errorCode;
763
+ switch (_b) {
764
+ case "InternalFailureException": return [3, 2];
765
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
766
+ case "InvalidRequestException": return [3, 4];
767
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
768
+ case "ServiceUnavailableException": return [3, 6];
769
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
770
+ case "ThrottlingException": return [3, 8];
771
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
772
+ }
773
+ return [3, 10];
774
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
775
+ case 3: throw _d.sent();
776
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
777
+ case 5: throw _d.sent();
778
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
779
+ case 7: throw _d.sent();
780
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
781
+ case 9: throw _d.sent();
782
+ case 10:
783
+ parsedBody = parsedOutput.body;
784
+ throwDefaultError({
785
+ output: output,
786
+ parsedBody: parsedBody,
787
+ exceptionCtor: __BaseException,
788
+ errorCode: errorCode,
789
+ });
790
+ _d.label = 11;
791
+ case 11: return [2];
792
+ }
310
793
  });
311
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
312
- if (data.batchDeleteDetectorErrorEntries != null) {
313
- contents.batchDeleteDetectorErrorEntries = deserializeAws_restJson1BatchDeleteDetectorErrorEntries(data.batchDeleteDetectorErrorEntries, context);
314
- }
315
- return contents;
316
- };
317
- const deserializeAws_restJson1BatchDeleteDetectorCommandError = async (output, context) => {
318
- const parsedOutput = {
319
- ...output,
320
- body: await parseErrorBody(output.body, context),
321
- };
322
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
323
- switch (errorCode) {
324
- case "InternalFailureException":
325
- case "com.amazonaws.ioteventsdata#InternalFailureException":
326
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
327
- case "InvalidRequestException":
328
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
329
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
330
- case "ServiceUnavailableException":
331
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
332
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
333
- case "ThrottlingException":
334
- case "com.amazonaws.ioteventsdata#ThrottlingException":
335
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
336
- default:
337
- const parsedBody = parsedOutput.body;
338
- throwDefaultError({
339
- output,
340
- parsedBody,
341
- exceptionCtor: __BaseException,
342
- errorCode,
343
- });
344
- }
345
- };
346
- export const deserializeAws_restJson1BatchDisableAlarmCommand = async (output, context) => {
347
- if (output.statusCode !== 202 && output.statusCode >= 300) {
348
- return deserializeAws_restJson1BatchDisableAlarmCommandError(output, context);
349
- }
350
- const contents = map({
351
- $metadata: deserializeMetadata(output),
794
+ }); };
795
+ export var deserializeAws_restJson1BatchUpdateDetectorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
796
+ var contents, data, _a, _b;
797
+ return __generator(this, function (_c) {
798
+ switch (_c.label) {
799
+ case 0:
800
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
801
+ return [2, deserializeAws_restJson1BatchUpdateDetectorCommandError(output, context)];
802
+ }
803
+ contents = map({
804
+ $metadata: deserializeMetadata(output),
805
+ });
806
+ _a = __expectNonNull;
807
+ _b = __expectObject;
808
+ return [4, parseBody(output.body, context)];
809
+ case 1:
810
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
811
+ if (data.batchUpdateDetectorErrorEntries != null) {
812
+ contents.batchUpdateDetectorErrorEntries = deserializeAws_restJson1BatchUpdateDetectorErrorEntries(data.batchUpdateDetectorErrorEntries, context);
813
+ }
814
+ return [2, contents];
815
+ }
352
816
  });
353
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
354
- if (data.errorEntries != null) {
355
- contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
356
- }
357
- return contents;
358
- };
359
- const deserializeAws_restJson1BatchDisableAlarmCommandError = async (output, context) => {
360
- const parsedOutput = {
361
- ...output,
362
- body: await parseErrorBody(output.body, context),
363
- };
364
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
365
- switch (errorCode) {
366
- case "InternalFailureException":
367
- case "com.amazonaws.ioteventsdata#InternalFailureException":
368
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
369
- case "InvalidRequestException":
370
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
371
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
372
- case "ServiceUnavailableException":
373
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
374
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
375
- case "ThrottlingException":
376
- case "com.amazonaws.ioteventsdata#ThrottlingException":
377
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
378
- default:
379
- const parsedBody = parsedOutput.body;
380
- throwDefaultError({
381
- output,
382
- parsedBody,
383
- exceptionCtor: __BaseException,
384
- errorCode,
385
- });
386
- }
387
- };
388
- export const deserializeAws_restJson1BatchEnableAlarmCommand = async (output, context) => {
389
- if (output.statusCode !== 202 && output.statusCode >= 300) {
390
- return deserializeAws_restJson1BatchEnableAlarmCommandError(output, context);
391
- }
392
- const contents = map({
393
- $metadata: deserializeMetadata(output),
817
+ }); };
818
+ var deserializeAws_restJson1BatchUpdateDetectorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
819
+ var parsedOutput, _a, errorCode, _b, parsedBody;
820
+ var _c;
821
+ return __generator(this, function (_d) {
822
+ switch (_d.label) {
823
+ case 0:
824
+ _a = [__assign({}, output)];
825
+ _c = {};
826
+ return [4, parseErrorBody(output.body, context)];
827
+ case 1:
828
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
829
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
830
+ _b = errorCode;
831
+ switch (_b) {
832
+ case "InternalFailureException": return [3, 2];
833
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
834
+ case "InvalidRequestException": return [3, 4];
835
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
836
+ case "ServiceUnavailableException": return [3, 6];
837
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 6];
838
+ case "ThrottlingException": return [3, 8];
839
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 8];
840
+ }
841
+ return [3, 10];
842
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
843
+ case 3: throw _d.sent();
844
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
845
+ case 5: throw _d.sent();
846
+ case 6: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
847
+ case 7: throw _d.sent();
848
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
849
+ case 9: throw _d.sent();
850
+ case 10:
851
+ parsedBody = parsedOutput.body;
852
+ throwDefaultError({
853
+ output: output,
854
+ parsedBody: parsedBody,
855
+ exceptionCtor: __BaseException,
856
+ errorCode: errorCode,
857
+ });
858
+ _d.label = 11;
859
+ case 11: return [2];
860
+ }
394
861
  });
395
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
396
- if (data.errorEntries != null) {
397
- contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
398
- }
399
- return contents;
400
- };
401
- const deserializeAws_restJson1BatchEnableAlarmCommandError = async (output, context) => {
402
- const parsedOutput = {
403
- ...output,
404
- body: await parseErrorBody(output.body, context),
405
- };
406
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
407
- switch (errorCode) {
408
- case "InternalFailureException":
409
- case "com.amazonaws.ioteventsdata#InternalFailureException":
410
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
411
- case "InvalidRequestException":
412
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
413
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
414
- case "ServiceUnavailableException":
415
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
416
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
417
- case "ThrottlingException":
418
- case "com.amazonaws.ioteventsdata#ThrottlingException":
419
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
420
- default:
421
- const parsedBody = parsedOutput.body;
422
- throwDefaultError({
423
- output,
424
- parsedBody,
425
- exceptionCtor: __BaseException,
426
- errorCode,
427
- });
428
- }
429
- };
430
- export const deserializeAws_restJson1BatchPutMessageCommand = async (output, context) => {
431
- if (output.statusCode !== 200 && output.statusCode >= 300) {
432
- return deserializeAws_restJson1BatchPutMessageCommandError(output, context);
433
- }
434
- const contents = map({
435
- $metadata: deserializeMetadata(output),
862
+ }); };
863
+ export var deserializeAws_restJson1DescribeAlarmCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
864
+ var contents, data, _a, _b;
865
+ return __generator(this, function (_c) {
866
+ switch (_c.label) {
867
+ case 0:
868
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
869
+ return [2, deserializeAws_restJson1DescribeAlarmCommandError(output, context)];
870
+ }
871
+ contents = map({
872
+ $metadata: deserializeMetadata(output),
873
+ });
874
+ _a = __expectNonNull;
875
+ _b = __expectObject;
876
+ return [4, parseBody(output.body, context)];
877
+ case 1:
878
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
879
+ if (data.alarm != null) {
880
+ contents.alarm = deserializeAws_restJson1Alarm(data.alarm, context);
881
+ }
882
+ return [2, contents];
883
+ }
436
884
  });
437
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
438
- if (data.BatchPutMessageErrorEntries != null) {
439
- contents.BatchPutMessageErrorEntries = deserializeAws_restJson1BatchPutMessageErrorEntries(data.BatchPutMessageErrorEntries, context);
440
- }
441
- return contents;
442
- };
443
- const deserializeAws_restJson1BatchPutMessageCommandError = async (output, context) => {
444
- const parsedOutput = {
445
- ...output,
446
- body: await parseErrorBody(output.body, context),
447
- };
448
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
449
- switch (errorCode) {
450
- case "InternalFailureException":
451
- case "com.amazonaws.ioteventsdata#InternalFailureException":
452
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
453
- case "InvalidRequestException":
454
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
455
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
456
- case "ServiceUnavailableException":
457
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
458
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
459
- case "ThrottlingException":
460
- case "com.amazonaws.ioteventsdata#ThrottlingException":
461
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
462
- default:
463
- const parsedBody = parsedOutput.body;
464
- throwDefaultError({
465
- output,
466
- parsedBody,
467
- exceptionCtor: __BaseException,
468
- errorCode,
469
- });
470
- }
471
- };
472
- export const deserializeAws_restJson1BatchResetAlarmCommand = async (output, context) => {
473
- if (output.statusCode !== 202 && output.statusCode >= 300) {
474
- return deserializeAws_restJson1BatchResetAlarmCommandError(output, context);
475
- }
476
- const contents = map({
477
- $metadata: deserializeMetadata(output),
885
+ }); };
886
+ var deserializeAws_restJson1DescribeAlarmCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
887
+ var parsedOutput, _a, errorCode, _b, parsedBody;
888
+ var _c;
889
+ return __generator(this, function (_d) {
890
+ switch (_d.label) {
891
+ case 0:
892
+ _a = [__assign({}, output)];
893
+ _c = {};
894
+ return [4, parseErrorBody(output.body, context)];
895
+ case 1:
896
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
897
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
898
+ _b = errorCode;
899
+ switch (_b) {
900
+ case "InternalFailureException": return [3, 2];
901
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
902
+ case "InvalidRequestException": return [3, 4];
903
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
904
+ case "ResourceNotFoundException": return [3, 6];
905
+ case "com.amazonaws.ioteventsdata#ResourceNotFoundException": return [3, 6];
906
+ case "ServiceUnavailableException": return [3, 8];
907
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 8];
908
+ case "ThrottlingException": return [3, 10];
909
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 10];
910
+ }
911
+ return [3, 12];
912
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
913
+ case 3: throw _d.sent();
914
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
915
+ case 5: throw _d.sent();
916
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
917
+ case 7: throw _d.sent();
918
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
919
+ case 9: throw _d.sent();
920
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
921
+ case 11: throw _d.sent();
922
+ case 12:
923
+ parsedBody = parsedOutput.body;
924
+ throwDefaultError({
925
+ output: output,
926
+ parsedBody: parsedBody,
927
+ exceptionCtor: __BaseException,
928
+ errorCode: errorCode,
929
+ });
930
+ _d.label = 13;
931
+ case 13: return [2];
932
+ }
478
933
  });
479
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
480
- if (data.errorEntries != null) {
481
- contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
482
- }
483
- return contents;
484
- };
485
- const deserializeAws_restJson1BatchResetAlarmCommandError = async (output, context) => {
486
- const parsedOutput = {
487
- ...output,
488
- body: await parseErrorBody(output.body, context),
489
- };
490
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
491
- switch (errorCode) {
492
- case "InternalFailureException":
493
- case "com.amazonaws.ioteventsdata#InternalFailureException":
494
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
495
- case "InvalidRequestException":
496
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
497
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
498
- case "ServiceUnavailableException":
499
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
500
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
501
- case "ThrottlingException":
502
- case "com.amazonaws.ioteventsdata#ThrottlingException":
503
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
504
- default:
505
- const parsedBody = parsedOutput.body;
506
- throwDefaultError({
507
- output,
508
- parsedBody,
509
- exceptionCtor: __BaseException,
510
- errorCode,
511
- });
512
- }
513
- };
514
- export const deserializeAws_restJson1BatchSnoozeAlarmCommand = async (output, context) => {
515
- if (output.statusCode !== 202 && output.statusCode >= 300) {
516
- return deserializeAws_restJson1BatchSnoozeAlarmCommandError(output, context);
517
- }
518
- const contents = map({
519
- $metadata: deserializeMetadata(output),
934
+ }); };
935
+ export var deserializeAws_restJson1DescribeDetectorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
936
+ var contents, data, _a, _b;
937
+ return __generator(this, function (_c) {
938
+ switch (_c.label) {
939
+ case 0:
940
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
941
+ return [2, deserializeAws_restJson1DescribeDetectorCommandError(output, context)];
942
+ }
943
+ contents = map({
944
+ $metadata: deserializeMetadata(output),
945
+ });
946
+ _a = __expectNonNull;
947
+ _b = __expectObject;
948
+ return [4, parseBody(output.body, context)];
949
+ case 1:
950
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
951
+ if (data.detector != null) {
952
+ contents.detector = deserializeAws_restJson1Detector(data.detector, context);
953
+ }
954
+ return [2, contents];
955
+ }
520
956
  });
521
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
522
- if (data.errorEntries != null) {
523
- contents.errorEntries = deserializeAws_restJson1BatchAlarmActionErrorEntries(data.errorEntries, context);
524
- }
525
- return contents;
526
- };
527
- const deserializeAws_restJson1BatchSnoozeAlarmCommandError = async (output, context) => {
528
- const parsedOutput = {
529
- ...output,
530
- body: await parseErrorBody(output.body, context),
531
- };
532
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
533
- switch (errorCode) {
534
- case "InternalFailureException":
535
- case "com.amazonaws.ioteventsdata#InternalFailureException":
536
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
537
- case "InvalidRequestException":
538
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
539
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
540
- case "ServiceUnavailableException":
541
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
542
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
543
- case "ThrottlingException":
544
- case "com.amazonaws.ioteventsdata#ThrottlingException":
545
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
546
- default:
547
- const parsedBody = parsedOutput.body;
548
- throwDefaultError({
549
- output,
550
- parsedBody,
551
- exceptionCtor: __BaseException,
552
- errorCode,
553
- });
554
- }
555
- };
556
- export const deserializeAws_restJson1BatchUpdateDetectorCommand = async (output, context) => {
557
- if (output.statusCode !== 200 && output.statusCode >= 300) {
558
- return deserializeAws_restJson1BatchUpdateDetectorCommandError(output, context);
559
- }
560
- const contents = map({
561
- $metadata: deserializeMetadata(output),
957
+ }); };
958
+ var deserializeAws_restJson1DescribeDetectorCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
959
+ var parsedOutput, _a, errorCode, _b, parsedBody;
960
+ var _c;
961
+ return __generator(this, function (_d) {
962
+ switch (_d.label) {
963
+ case 0:
964
+ _a = [__assign({}, output)];
965
+ _c = {};
966
+ return [4, parseErrorBody(output.body, context)];
967
+ case 1:
968
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
969
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
970
+ _b = errorCode;
971
+ switch (_b) {
972
+ case "InternalFailureException": return [3, 2];
973
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
974
+ case "InvalidRequestException": return [3, 4];
975
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
976
+ case "ResourceNotFoundException": return [3, 6];
977
+ case "com.amazonaws.ioteventsdata#ResourceNotFoundException": return [3, 6];
978
+ case "ServiceUnavailableException": return [3, 8];
979
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 8];
980
+ case "ThrottlingException": return [3, 10];
981
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 10];
982
+ }
983
+ return [3, 12];
984
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
985
+ case 3: throw _d.sent();
986
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
987
+ case 5: throw _d.sent();
988
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
989
+ case 7: throw _d.sent();
990
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
991
+ case 9: throw _d.sent();
992
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
993
+ case 11: throw _d.sent();
994
+ case 12:
995
+ parsedBody = parsedOutput.body;
996
+ throwDefaultError({
997
+ output: output,
998
+ parsedBody: parsedBody,
999
+ exceptionCtor: __BaseException,
1000
+ errorCode: errorCode,
1001
+ });
1002
+ _d.label = 13;
1003
+ case 13: return [2];
1004
+ }
562
1005
  });
563
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
564
- if (data.batchUpdateDetectorErrorEntries != null) {
565
- contents.batchUpdateDetectorErrorEntries = deserializeAws_restJson1BatchUpdateDetectorErrorEntries(data.batchUpdateDetectorErrorEntries, context);
566
- }
567
- return contents;
568
- };
569
- const deserializeAws_restJson1BatchUpdateDetectorCommandError = async (output, context) => {
570
- const parsedOutput = {
571
- ...output,
572
- body: await parseErrorBody(output.body, context),
573
- };
574
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
575
- switch (errorCode) {
576
- case "InternalFailureException":
577
- case "com.amazonaws.ioteventsdata#InternalFailureException":
578
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
579
- case "InvalidRequestException":
580
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
581
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
582
- case "ServiceUnavailableException":
583
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
584
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
585
- case "ThrottlingException":
586
- case "com.amazonaws.ioteventsdata#ThrottlingException":
587
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
588
- default:
589
- const parsedBody = parsedOutput.body;
590
- throwDefaultError({
591
- output,
592
- parsedBody,
593
- exceptionCtor: __BaseException,
594
- errorCode,
595
- });
596
- }
597
- };
598
- export const deserializeAws_restJson1DescribeAlarmCommand = async (output, context) => {
599
- if (output.statusCode !== 200 && output.statusCode >= 300) {
600
- return deserializeAws_restJson1DescribeAlarmCommandError(output, context);
601
- }
602
- const contents = map({
603
- $metadata: deserializeMetadata(output),
1006
+ }); };
1007
+ export var deserializeAws_restJson1ListAlarmsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1008
+ var contents, data, _a, _b;
1009
+ return __generator(this, function (_c) {
1010
+ switch (_c.label) {
1011
+ case 0:
1012
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1013
+ return [2, deserializeAws_restJson1ListAlarmsCommandError(output, context)];
1014
+ }
1015
+ contents = map({
1016
+ $metadata: deserializeMetadata(output),
1017
+ });
1018
+ _a = __expectNonNull;
1019
+ _b = __expectObject;
1020
+ return [4, parseBody(output.body, context)];
1021
+ case 1:
1022
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1023
+ if (data.alarmSummaries != null) {
1024
+ contents.alarmSummaries = deserializeAws_restJson1AlarmSummaries(data.alarmSummaries, context);
1025
+ }
1026
+ if (data.nextToken != null) {
1027
+ contents.nextToken = __expectString(data.nextToken);
1028
+ }
1029
+ return [2, contents];
1030
+ }
604
1031
  });
605
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
606
- if (data.alarm != null) {
607
- contents.alarm = deserializeAws_restJson1Alarm(data.alarm, context);
608
- }
609
- return contents;
610
- };
611
- const deserializeAws_restJson1DescribeAlarmCommandError = async (output, context) => {
612
- const parsedOutput = {
613
- ...output,
614
- body: await parseErrorBody(output.body, context),
615
- };
616
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
617
- switch (errorCode) {
618
- case "InternalFailureException":
619
- case "com.amazonaws.ioteventsdata#InternalFailureException":
620
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
621
- case "InvalidRequestException":
622
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
623
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
624
- case "ResourceNotFoundException":
625
- case "com.amazonaws.ioteventsdata#ResourceNotFoundException":
626
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
627
- case "ServiceUnavailableException":
628
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
629
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
630
- case "ThrottlingException":
631
- case "com.amazonaws.ioteventsdata#ThrottlingException":
632
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
633
- default:
634
- const parsedBody = parsedOutput.body;
635
- throwDefaultError({
636
- output,
637
- parsedBody,
638
- exceptionCtor: __BaseException,
639
- errorCode,
640
- });
641
- }
642
- };
643
- export const deserializeAws_restJson1DescribeDetectorCommand = async (output, context) => {
644
- if (output.statusCode !== 200 && output.statusCode >= 300) {
645
- return deserializeAws_restJson1DescribeDetectorCommandError(output, context);
646
- }
647
- const contents = map({
648
- $metadata: deserializeMetadata(output),
1032
+ }); };
1033
+ var deserializeAws_restJson1ListAlarmsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1034
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1035
+ var _c;
1036
+ return __generator(this, function (_d) {
1037
+ switch (_d.label) {
1038
+ case 0:
1039
+ _a = [__assign({}, output)];
1040
+ _c = {};
1041
+ return [4, parseErrorBody(output.body, context)];
1042
+ case 1:
1043
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1044
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1045
+ _b = errorCode;
1046
+ switch (_b) {
1047
+ case "InternalFailureException": return [3, 2];
1048
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
1049
+ case "InvalidRequestException": return [3, 4];
1050
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
1051
+ case "ResourceNotFoundException": return [3, 6];
1052
+ case "com.amazonaws.ioteventsdata#ResourceNotFoundException": return [3, 6];
1053
+ case "ServiceUnavailableException": return [3, 8];
1054
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 8];
1055
+ case "ThrottlingException": return [3, 10];
1056
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 10];
1057
+ }
1058
+ return [3, 12];
1059
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
1060
+ case 3: throw _d.sent();
1061
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1062
+ case 5: throw _d.sent();
1063
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1064
+ case 7: throw _d.sent();
1065
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1066
+ case 9: throw _d.sent();
1067
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1068
+ case 11: throw _d.sent();
1069
+ case 12:
1070
+ parsedBody = parsedOutput.body;
1071
+ throwDefaultError({
1072
+ output: output,
1073
+ parsedBody: parsedBody,
1074
+ exceptionCtor: __BaseException,
1075
+ errorCode: errorCode,
1076
+ });
1077
+ _d.label = 13;
1078
+ case 13: return [2];
1079
+ }
649
1080
  });
650
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
651
- if (data.detector != null) {
652
- contents.detector = deserializeAws_restJson1Detector(data.detector, context);
653
- }
654
- return contents;
655
- };
656
- const deserializeAws_restJson1DescribeDetectorCommandError = async (output, context) => {
657
- const parsedOutput = {
658
- ...output,
659
- body: await parseErrorBody(output.body, context),
660
- };
661
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
- switch (errorCode) {
663
- case "InternalFailureException":
664
- case "com.amazonaws.ioteventsdata#InternalFailureException":
665
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
666
- case "InvalidRequestException":
667
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
668
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
669
- case "ResourceNotFoundException":
670
- case "com.amazonaws.ioteventsdata#ResourceNotFoundException":
671
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
672
- case "ServiceUnavailableException":
673
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
674
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
675
- case "ThrottlingException":
676
- case "com.amazonaws.ioteventsdata#ThrottlingException":
677
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
678
- default:
679
- const parsedBody = parsedOutput.body;
680
- throwDefaultError({
681
- output,
682
- parsedBody,
683
- exceptionCtor: __BaseException,
684
- errorCode,
685
- });
686
- }
687
- };
688
- export const deserializeAws_restJson1ListAlarmsCommand = async (output, context) => {
689
- if (output.statusCode !== 200 && output.statusCode >= 300) {
690
- return deserializeAws_restJson1ListAlarmsCommandError(output, context);
691
- }
692
- const contents = map({
693
- $metadata: deserializeMetadata(output),
1081
+ }); };
1082
+ export var deserializeAws_restJson1ListDetectorsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1083
+ var contents, data, _a, _b;
1084
+ return __generator(this, function (_c) {
1085
+ switch (_c.label) {
1086
+ case 0:
1087
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1088
+ return [2, deserializeAws_restJson1ListDetectorsCommandError(output, context)];
1089
+ }
1090
+ contents = map({
1091
+ $metadata: deserializeMetadata(output),
1092
+ });
1093
+ _a = __expectNonNull;
1094
+ _b = __expectObject;
1095
+ return [4, parseBody(output.body, context)];
1096
+ case 1:
1097
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1098
+ if (data.detectorSummaries != null) {
1099
+ contents.detectorSummaries = deserializeAws_restJson1DetectorSummaries(data.detectorSummaries, context);
1100
+ }
1101
+ if (data.nextToken != null) {
1102
+ contents.nextToken = __expectString(data.nextToken);
1103
+ }
1104
+ return [2, contents];
1105
+ }
694
1106
  });
695
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
696
- if (data.alarmSummaries != null) {
697
- contents.alarmSummaries = deserializeAws_restJson1AlarmSummaries(data.alarmSummaries, context);
698
- }
699
- if (data.nextToken != null) {
700
- contents.nextToken = __expectString(data.nextToken);
701
- }
702
- return contents;
703
- };
704
- const deserializeAws_restJson1ListAlarmsCommandError = async (output, context) => {
705
- const parsedOutput = {
706
- ...output,
707
- body: await parseErrorBody(output.body, context),
708
- };
709
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
710
- switch (errorCode) {
711
- case "InternalFailureException":
712
- case "com.amazonaws.ioteventsdata#InternalFailureException":
713
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
714
- case "InvalidRequestException":
715
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
716
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
717
- case "ResourceNotFoundException":
718
- case "com.amazonaws.ioteventsdata#ResourceNotFoundException":
719
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
720
- case "ServiceUnavailableException":
721
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
722
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
723
- case "ThrottlingException":
724
- case "com.amazonaws.ioteventsdata#ThrottlingException":
725
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
726
- default:
727
- const parsedBody = parsedOutput.body;
728
- throwDefaultError({
729
- output,
730
- parsedBody,
731
- exceptionCtor: __BaseException,
732
- errorCode,
733
- });
734
- }
735
- };
736
- export const deserializeAws_restJson1ListDetectorsCommand = async (output, context) => {
737
- if (output.statusCode !== 200 && output.statusCode >= 300) {
738
- return deserializeAws_restJson1ListDetectorsCommandError(output, context);
739
- }
740
- const contents = map({
741
- $metadata: deserializeMetadata(output),
1107
+ }); };
1108
+ var deserializeAws_restJson1ListDetectorsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1109
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1110
+ var _c;
1111
+ return __generator(this, function (_d) {
1112
+ switch (_d.label) {
1113
+ case 0:
1114
+ _a = [__assign({}, output)];
1115
+ _c = {};
1116
+ return [4, parseErrorBody(output.body, context)];
1117
+ case 1:
1118
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1119
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1120
+ _b = errorCode;
1121
+ switch (_b) {
1122
+ case "InternalFailureException": return [3, 2];
1123
+ case "com.amazonaws.ioteventsdata#InternalFailureException": return [3, 2];
1124
+ case "InvalidRequestException": return [3, 4];
1125
+ case "com.amazonaws.ioteventsdata#InvalidRequestException": return [3, 4];
1126
+ case "ResourceNotFoundException": return [3, 6];
1127
+ case "com.amazonaws.ioteventsdata#ResourceNotFoundException": return [3, 6];
1128
+ case "ServiceUnavailableException": return [3, 8];
1129
+ case "com.amazonaws.ioteventsdata#ServiceUnavailableException": return [3, 8];
1130
+ case "ThrottlingException": return [3, 10];
1131
+ case "com.amazonaws.ioteventsdata#ThrottlingException": return [3, 10];
1132
+ }
1133
+ return [3, 12];
1134
+ case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
1135
+ case 3: throw _d.sent();
1136
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
1137
+ case 5: throw _d.sent();
1138
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1139
+ case 7: throw _d.sent();
1140
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1141
+ case 9: throw _d.sent();
1142
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1143
+ case 11: throw _d.sent();
1144
+ case 12:
1145
+ parsedBody = parsedOutput.body;
1146
+ throwDefaultError({
1147
+ output: output,
1148
+ parsedBody: parsedBody,
1149
+ exceptionCtor: __BaseException,
1150
+ errorCode: errorCode,
1151
+ });
1152
+ _d.label = 13;
1153
+ case 13: return [2];
1154
+ }
742
1155
  });
743
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
744
- if (data.detectorSummaries != null) {
745
- contents.detectorSummaries = deserializeAws_restJson1DetectorSummaries(data.detectorSummaries, context);
746
- }
747
- if (data.nextToken != null) {
748
- contents.nextToken = __expectString(data.nextToken);
749
- }
750
- return contents;
751
- };
752
- const deserializeAws_restJson1ListDetectorsCommandError = async (output, context) => {
753
- const parsedOutput = {
754
- ...output,
755
- body: await parseErrorBody(output.body, context),
756
- };
757
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
758
- switch (errorCode) {
759
- case "InternalFailureException":
760
- case "com.amazonaws.ioteventsdata#InternalFailureException":
761
- throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
762
- case "InvalidRequestException":
763
- case "com.amazonaws.ioteventsdata#InvalidRequestException":
764
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
765
- case "ResourceNotFoundException":
766
- case "com.amazonaws.ioteventsdata#ResourceNotFoundException":
767
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
768
- case "ServiceUnavailableException":
769
- case "com.amazonaws.ioteventsdata#ServiceUnavailableException":
770
- throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
771
- case "ThrottlingException":
772
- case "com.amazonaws.ioteventsdata#ThrottlingException":
773
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
774
- default:
775
- const parsedBody = parsedOutput.body;
776
- throwDefaultError({
777
- output,
778
- parsedBody,
779
- exceptionCtor: __BaseException,
780
- errorCode,
781
- });
782
- }
783
- };
784
- const map = __map;
785
- const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
786
- const contents = map({});
787
- const data = parsedOutput.body;
788
- if (data.message != null) {
789
- contents.message = __expectString(data.message);
790
- }
791
- const exception = new InternalFailureException({
792
- $metadata: deserializeMetadata(parsedOutput),
793
- ...contents,
1156
+ }); };
1157
+ var map = __map;
1158
+ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1159
+ var contents, data, exception;
1160
+ return __generator(this, function (_a) {
1161
+ contents = map({});
1162
+ data = parsedOutput.body;
1163
+ if (data.message != null) {
1164
+ contents.message = __expectString(data.message);
1165
+ }
1166
+ exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1167
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
794
1168
  });
795
- return __decorateServiceException(exception, parsedOutput.body);
796
- };
797
- const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
798
- const contents = map({});
799
- const data = parsedOutput.body;
800
- if (data.message != null) {
801
- contents.message = __expectString(data.message);
802
- }
803
- const exception = new InvalidRequestException({
804
- $metadata: deserializeMetadata(parsedOutput),
805
- ...contents,
1169
+ }); };
1170
+ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1171
+ var contents, data, exception;
1172
+ return __generator(this, function (_a) {
1173
+ contents = map({});
1174
+ data = parsedOutput.body;
1175
+ if (data.message != null) {
1176
+ contents.message = __expectString(data.message);
1177
+ }
1178
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1179
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
806
1180
  });
807
- return __decorateServiceException(exception, parsedOutput.body);
808
- };
809
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
810
- const contents = map({});
811
- const data = parsedOutput.body;
812
- if (data.message != null) {
813
- contents.message = __expectString(data.message);
814
- }
815
- const exception = new ResourceNotFoundException({
816
- $metadata: deserializeMetadata(parsedOutput),
817
- ...contents,
1181
+ }); };
1182
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1183
+ var contents, data, exception;
1184
+ return __generator(this, function (_a) {
1185
+ contents = map({});
1186
+ data = parsedOutput.body;
1187
+ if (data.message != null) {
1188
+ contents.message = __expectString(data.message);
1189
+ }
1190
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1191
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
818
1192
  });
819
- return __decorateServiceException(exception, parsedOutput.body);
820
- };
821
- const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
822
- const contents = map({});
823
- const data = parsedOutput.body;
824
- if (data.message != null) {
825
- contents.message = __expectString(data.message);
826
- }
827
- const exception = new ServiceUnavailableException({
828
- $metadata: deserializeMetadata(parsedOutput),
829
- ...contents,
1193
+ }); };
1194
+ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1195
+ var contents, data, exception;
1196
+ return __generator(this, function (_a) {
1197
+ contents = map({});
1198
+ data = parsedOutput.body;
1199
+ if (data.message != null) {
1200
+ contents.message = __expectString(data.message);
1201
+ }
1202
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1203
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
830
1204
  });
831
- return __decorateServiceException(exception, parsedOutput.body);
832
- };
833
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
834
- const contents = map({});
835
- const data = parsedOutput.body;
836
- if (data.message != null) {
837
- contents.message = __expectString(data.message);
838
- }
839
- const exception = new ThrottlingException({
840
- $metadata: deserializeMetadata(parsedOutput),
841
- ...contents,
1205
+ }); };
1206
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1207
+ var contents, data, exception;
1208
+ return __generator(this, function (_a) {
1209
+ contents = map({});
1210
+ data = parsedOutput.body;
1211
+ if (data.message != null) {
1212
+ contents.message = __expectString(data.message);
1213
+ }
1214
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1215
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
842
1216
  });
843
- return __decorateServiceException(exception, parsedOutput.body);
844
- };
845
- const serializeAws_restJson1AcknowledgeAlarmActionRequest = (input, context) => {
846
- return {
847
- ...(input.alarmModelName != null && { alarmModelName: input.alarmModelName }),
848
- ...(input.keyValue != null && { keyValue: input.keyValue }),
849
- ...(input.note != null && { note: input.note }),
850
- ...(input.requestId != null && { requestId: input.requestId }),
851
- };
1217
+ }); };
1218
+ var serializeAws_restJson1AcknowledgeAlarmActionRequest = function (input, context) {
1219
+ return __assign(__assign(__assign(__assign({}, (input.alarmModelName != null && { alarmModelName: input.alarmModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.note != null && { note: input.note })), (input.requestId != null && { requestId: input.requestId }));
852
1220
  };
853
- const serializeAws_restJson1AcknowledgeAlarmActionRequests = (input, context) => {
1221
+ var serializeAws_restJson1AcknowledgeAlarmActionRequests = function (input, context) {
854
1222
  return input
855
- .filter((e) => e != null)
856
- .map((entry) => {
1223
+ .filter(function (e) { return e != null; })
1224
+ .map(function (entry) {
857
1225
  return serializeAws_restJson1AcknowledgeAlarmActionRequest(entry, context);
858
1226
  });
859
1227
  };
860
- const serializeAws_restJson1DeleteDetectorRequest = (input, context) => {
861
- return {
862
- ...(input.detectorModelName != null && { detectorModelName: input.detectorModelName }),
863
- ...(input.keyValue != null && { keyValue: input.keyValue }),
864
- ...(input.messageId != null && { messageId: input.messageId }),
865
- };
1228
+ var serializeAws_restJson1DeleteDetectorRequest = function (input, context) {
1229
+ return __assign(__assign(__assign({}, (input.detectorModelName != null && { detectorModelName: input.detectorModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.messageId != null && { messageId: input.messageId }));
866
1230
  };
867
- const serializeAws_restJson1DeleteDetectorRequests = (input, context) => {
1231
+ var serializeAws_restJson1DeleteDetectorRequests = function (input, context) {
868
1232
  return input
869
- .filter((e) => e != null)
870
- .map((entry) => {
1233
+ .filter(function (e) { return e != null; })
1234
+ .map(function (entry) {
871
1235
  return serializeAws_restJson1DeleteDetectorRequest(entry, context);
872
1236
  });
873
1237
  };
874
- const serializeAws_restJson1DetectorStateDefinition = (input, context) => {
875
- return {
876
- ...(input.stateName != null && { stateName: input.stateName }),
877
- ...(input.timers != null && { timers: serializeAws_restJson1TimerDefinitions(input.timers, context) }),
878
- ...(input.variables != null && { variables: serializeAws_restJson1VariableDefinitions(input.variables, context) }),
879
- };
1238
+ var serializeAws_restJson1DetectorStateDefinition = function (input, context) {
1239
+ return __assign(__assign(__assign({}, (input.stateName != null && { stateName: input.stateName })), (input.timers != null && { timers: serializeAws_restJson1TimerDefinitions(input.timers, context) })), (input.variables != null && { variables: serializeAws_restJson1VariableDefinitions(input.variables, context) }));
880
1240
  };
881
- const serializeAws_restJson1DisableAlarmActionRequest = (input, context) => {
882
- return {
883
- ...(input.alarmModelName != null && { alarmModelName: input.alarmModelName }),
884
- ...(input.keyValue != null && { keyValue: input.keyValue }),
885
- ...(input.note != null && { note: input.note }),
886
- ...(input.requestId != null && { requestId: input.requestId }),
887
- };
1241
+ var serializeAws_restJson1DisableAlarmActionRequest = function (input, context) {
1242
+ return __assign(__assign(__assign(__assign({}, (input.alarmModelName != null && { alarmModelName: input.alarmModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.note != null && { note: input.note })), (input.requestId != null && { requestId: input.requestId }));
888
1243
  };
889
- const serializeAws_restJson1DisableAlarmActionRequests = (input, context) => {
1244
+ var serializeAws_restJson1DisableAlarmActionRequests = function (input, context) {
890
1245
  return input
891
- .filter((e) => e != null)
892
- .map((entry) => {
1246
+ .filter(function (e) { return e != null; })
1247
+ .map(function (entry) {
893
1248
  return serializeAws_restJson1DisableAlarmActionRequest(entry, context);
894
1249
  });
895
1250
  };
896
- const serializeAws_restJson1EnableAlarmActionRequest = (input, context) => {
897
- return {
898
- ...(input.alarmModelName != null && { alarmModelName: input.alarmModelName }),
899
- ...(input.keyValue != null && { keyValue: input.keyValue }),
900
- ...(input.note != null && { note: input.note }),
901
- ...(input.requestId != null && { requestId: input.requestId }),
902
- };
1251
+ var serializeAws_restJson1EnableAlarmActionRequest = function (input, context) {
1252
+ return __assign(__assign(__assign(__assign({}, (input.alarmModelName != null && { alarmModelName: input.alarmModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.note != null && { note: input.note })), (input.requestId != null && { requestId: input.requestId }));
903
1253
  };
904
- const serializeAws_restJson1EnableAlarmActionRequests = (input, context) => {
1254
+ var serializeAws_restJson1EnableAlarmActionRequests = function (input, context) {
905
1255
  return input
906
- .filter((e) => e != null)
907
- .map((entry) => {
1256
+ .filter(function (e) { return e != null; })
1257
+ .map(function (entry) {
908
1258
  return serializeAws_restJson1EnableAlarmActionRequest(entry, context);
909
1259
  });
910
1260
  };
911
- const serializeAws_restJson1Message = (input, context) => {
912
- return {
913
- ...(input.inputName != null && { inputName: input.inputName }),
914
- ...(input.messageId != null && { messageId: input.messageId }),
915
- ...(input.payload != null && { payload: context.base64Encoder(input.payload) }),
916
- ...(input.timestamp != null && { timestamp: serializeAws_restJson1TimestampValue(input.timestamp, context) }),
917
- };
1261
+ var serializeAws_restJson1Message = function (input, context) {
1262
+ return __assign(__assign(__assign(__assign({}, (input.inputName != null && { inputName: input.inputName })), (input.messageId != null && { messageId: input.messageId })), (input.payload != null && { payload: context.base64Encoder(input.payload) })), (input.timestamp != null && { timestamp: serializeAws_restJson1TimestampValue(input.timestamp, context) }));
918
1263
  };
919
- const serializeAws_restJson1Messages = (input, context) => {
1264
+ var serializeAws_restJson1Messages = function (input, context) {
920
1265
  return input
921
- .filter((e) => e != null)
922
- .map((entry) => {
1266
+ .filter(function (e) { return e != null; })
1267
+ .map(function (entry) {
923
1268
  return serializeAws_restJson1Message(entry, context);
924
1269
  });
925
1270
  };
926
- const serializeAws_restJson1ResetAlarmActionRequest = (input, context) => {
927
- return {
928
- ...(input.alarmModelName != null && { alarmModelName: input.alarmModelName }),
929
- ...(input.keyValue != null && { keyValue: input.keyValue }),
930
- ...(input.note != null && { note: input.note }),
931
- ...(input.requestId != null && { requestId: input.requestId }),
932
- };
1271
+ var serializeAws_restJson1ResetAlarmActionRequest = function (input, context) {
1272
+ return __assign(__assign(__assign(__assign({}, (input.alarmModelName != null && { alarmModelName: input.alarmModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.note != null && { note: input.note })), (input.requestId != null && { requestId: input.requestId }));
933
1273
  };
934
- const serializeAws_restJson1ResetAlarmActionRequests = (input, context) => {
1274
+ var serializeAws_restJson1ResetAlarmActionRequests = function (input, context) {
935
1275
  return input
936
- .filter((e) => e != null)
937
- .map((entry) => {
1276
+ .filter(function (e) { return e != null; })
1277
+ .map(function (entry) {
938
1278
  return serializeAws_restJson1ResetAlarmActionRequest(entry, context);
939
1279
  });
940
1280
  };
941
- const serializeAws_restJson1SnoozeAlarmActionRequest = (input, context) => {
942
- return {
943
- ...(input.alarmModelName != null && { alarmModelName: input.alarmModelName }),
944
- ...(input.keyValue != null && { keyValue: input.keyValue }),
945
- ...(input.note != null && { note: input.note }),
946
- ...(input.requestId != null && { requestId: input.requestId }),
947
- ...(input.snoozeDuration != null && { snoozeDuration: input.snoozeDuration }),
948
- };
1281
+ var serializeAws_restJson1SnoozeAlarmActionRequest = function (input, context) {
1282
+ return __assign(__assign(__assign(__assign(__assign({}, (input.alarmModelName != null && { alarmModelName: input.alarmModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.note != null && { note: input.note })), (input.requestId != null && { requestId: input.requestId })), (input.snoozeDuration != null && { snoozeDuration: input.snoozeDuration }));
949
1283
  };
950
- const serializeAws_restJson1SnoozeAlarmActionRequests = (input, context) => {
1284
+ var serializeAws_restJson1SnoozeAlarmActionRequests = function (input, context) {
951
1285
  return input
952
- .filter((e) => e != null)
953
- .map((entry) => {
1286
+ .filter(function (e) { return e != null; })
1287
+ .map(function (entry) {
954
1288
  return serializeAws_restJson1SnoozeAlarmActionRequest(entry, context);
955
1289
  });
956
1290
  };
957
- const serializeAws_restJson1TimerDefinition = (input, context) => {
958
- return {
959
- ...(input.name != null && { name: input.name }),
960
- ...(input.seconds != null && { seconds: input.seconds }),
961
- };
1291
+ var serializeAws_restJson1TimerDefinition = function (input, context) {
1292
+ return __assign(__assign({}, (input.name != null && { name: input.name })), (input.seconds != null && { seconds: input.seconds }));
962
1293
  };
963
- const serializeAws_restJson1TimerDefinitions = (input, context) => {
1294
+ var serializeAws_restJson1TimerDefinitions = function (input, context) {
964
1295
  return input
965
- .filter((e) => e != null)
966
- .map((entry) => {
1296
+ .filter(function (e) { return e != null; })
1297
+ .map(function (entry) {
967
1298
  return serializeAws_restJson1TimerDefinition(entry, context);
968
1299
  });
969
1300
  };
970
- const serializeAws_restJson1TimestampValue = (input, context) => {
971
- return {
972
- ...(input.timeInMillis != null && { timeInMillis: input.timeInMillis }),
973
- };
1301
+ var serializeAws_restJson1TimestampValue = function (input, context) {
1302
+ return __assign({}, (input.timeInMillis != null && { timeInMillis: input.timeInMillis }));
974
1303
  };
975
- const serializeAws_restJson1UpdateDetectorRequest = (input, context) => {
976
- return {
977
- ...(input.detectorModelName != null && { detectorModelName: input.detectorModelName }),
978
- ...(input.keyValue != null && { keyValue: input.keyValue }),
979
- ...(input.messageId != null && { messageId: input.messageId }),
980
- ...(input.state != null && { state: serializeAws_restJson1DetectorStateDefinition(input.state, context) }),
981
- };
1304
+ var serializeAws_restJson1UpdateDetectorRequest = function (input, context) {
1305
+ return __assign(__assign(__assign(__assign({}, (input.detectorModelName != null && { detectorModelName: input.detectorModelName })), (input.keyValue != null && { keyValue: input.keyValue })), (input.messageId != null && { messageId: input.messageId })), (input.state != null && { state: serializeAws_restJson1DetectorStateDefinition(input.state, context) }));
982
1306
  };
983
- const serializeAws_restJson1UpdateDetectorRequests = (input, context) => {
1307
+ var serializeAws_restJson1UpdateDetectorRequests = function (input, context) {
984
1308
  return input
985
- .filter((e) => e != null)
986
- .map((entry) => {
1309
+ .filter(function (e) { return e != null; })
1310
+ .map(function (entry) {
987
1311
  return serializeAws_restJson1UpdateDetectorRequest(entry, context);
988
1312
  });
989
1313
  };
990
- const serializeAws_restJson1VariableDefinition = (input, context) => {
991
- return {
992
- ...(input.name != null && { name: input.name }),
993
- ...(input.value != null && { value: input.value }),
994
- };
1314
+ var serializeAws_restJson1VariableDefinition = function (input, context) {
1315
+ return __assign(__assign({}, (input.name != null && { name: input.name })), (input.value != null && { value: input.value }));
995
1316
  };
996
- const serializeAws_restJson1VariableDefinitions = (input, context) => {
1317
+ var serializeAws_restJson1VariableDefinitions = function (input, context) {
997
1318
  return input
998
- .filter((e) => e != null)
999
- .map((entry) => {
1319
+ .filter(function (e) { return e != null; })
1320
+ .map(function (entry) {
1000
1321
  return serializeAws_restJson1VariableDefinition(entry, context);
1001
1322
  });
1002
1323
  };
1003
- const deserializeAws_restJson1AcknowledgeActionConfiguration = (output, context) => {
1324
+ var deserializeAws_restJson1AcknowledgeActionConfiguration = function (output, context) {
1004
1325
  return {
1005
1326
  note: __expectString(output.note),
1006
1327
  };
1007
1328
  };
1008
- const deserializeAws_restJson1Alarm = (output, context) => {
1329
+ var deserializeAws_restJson1Alarm = function (output, context) {
1009
1330
  return {
1010
1331
  alarmModelName: __expectString(output.alarmModelName),
1011
1332
  alarmModelVersion: __expectString(output.alarmModelVersion),
@@ -1020,7 +1341,7 @@ const deserializeAws_restJson1Alarm = (output, context) => {
1020
1341
  severity: __expectInt32(output.severity),
1021
1342
  };
1022
1343
  };
1023
- const deserializeAws_restJson1AlarmState = (output, context) => {
1344
+ var deserializeAws_restJson1AlarmState = function (output, context) {
1024
1345
  return {
1025
1346
  customerAction: output.customerAction != null
1026
1347
  ? deserializeAws_restJson1CustomerAction(output.customerAction, context)
@@ -1032,10 +1353,10 @@ const deserializeAws_restJson1AlarmState = (output, context) => {
1032
1353
  systemEvent: output.systemEvent != null ? deserializeAws_restJson1SystemEvent(output.systemEvent, context) : undefined,
1033
1354
  };
1034
1355
  };
1035
- const deserializeAws_restJson1AlarmSummaries = (output, context) => {
1036
- const retVal = (output || [])
1037
- .filter((e) => e != null)
1038
- .map((entry) => {
1356
+ var deserializeAws_restJson1AlarmSummaries = function (output, context) {
1357
+ var retVal = (output || [])
1358
+ .filter(function (e) { return e != null; })
1359
+ .map(function (entry) {
1039
1360
  if (entry === null) {
1040
1361
  return null;
1041
1362
  }
@@ -1043,7 +1364,7 @@ const deserializeAws_restJson1AlarmSummaries = (output, context) => {
1043
1364
  });
1044
1365
  return retVal;
1045
1366
  };
1046
- const deserializeAws_restJson1AlarmSummary = (output, context) => {
1367
+ var deserializeAws_restJson1AlarmSummary = function (output, context) {
1047
1368
  return {
1048
1369
  alarmModelName: __expectString(output.alarmModelName),
1049
1370
  alarmModelVersion: __expectString(output.alarmModelVersion),
@@ -1057,10 +1378,10 @@ const deserializeAws_restJson1AlarmSummary = (output, context) => {
1057
1378
  stateName: __expectString(output.stateName),
1058
1379
  };
1059
1380
  };
1060
- const deserializeAws_restJson1BatchAlarmActionErrorEntries = (output, context) => {
1061
- const retVal = (output || [])
1062
- .filter((e) => e != null)
1063
- .map((entry) => {
1381
+ var deserializeAws_restJson1BatchAlarmActionErrorEntries = function (output, context) {
1382
+ var retVal = (output || [])
1383
+ .filter(function (e) { return e != null; })
1384
+ .map(function (entry) {
1064
1385
  if (entry === null) {
1065
1386
  return null;
1066
1387
  }
@@ -1068,17 +1389,17 @@ const deserializeAws_restJson1BatchAlarmActionErrorEntries = (output, context) =
1068
1389
  });
1069
1390
  return retVal;
1070
1391
  };
1071
- const deserializeAws_restJson1BatchAlarmActionErrorEntry = (output, context) => {
1392
+ var deserializeAws_restJson1BatchAlarmActionErrorEntry = function (output, context) {
1072
1393
  return {
1073
1394
  errorCode: __expectString(output.errorCode),
1074
1395
  errorMessage: __expectString(output.errorMessage),
1075
1396
  requestId: __expectString(output.requestId),
1076
1397
  };
1077
1398
  };
1078
- const deserializeAws_restJson1BatchDeleteDetectorErrorEntries = (output, context) => {
1079
- const retVal = (output || [])
1080
- .filter((e) => e != null)
1081
- .map((entry) => {
1399
+ var deserializeAws_restJson1BatchDeleteDetectorErrorEntries = function (output, context) {
1400
+ var retVal = (output || [])
1401
+ .filter(function (e) { return e != null; })
1402
+ .map(function (entry) {
1082
1403
  if (entry === null) {
1083
1404
  return null;
1084
1405
  }
@@ -1086,17 +1407,17 @@ const deserializeAws_restJson1BatchDeleteDetectorErrorEntries = (output, context
1086
1407
  });
1087
1408
  return retVal;
1088
1409
  };
1089
- const deserializeAws_restJson1BatchDeleteDetectorErrorEntry = (output, context) => {
1410
+ var deserializeAws_restJson1BatchDeleteDetectorErrorEntry = function (output, context) {
1090
1411
  return {
1091
1412
  errorCode: __expectString(output.errorCode),
1092
1413
  errorMessage: __expectString(output.errorMessage),
1093
1414
  messageId: __expectString(output.messageId),
1094
1415
  };
1095
1416
  };
1096
- const deserializeAws_restJson1BatchPutMessageErrorEntries = (output, context) => {
1097
- const retVal = (output || [])
1098
- .filter((e) => e != null)
1099
- .map((entry) => {
1417
+ var deserializeAws_restJson1BatchPutMessageErrorEntries = function (output, context) {
1418
+ var retVal = (output || [])
1419
+ .filter(function (e) { return e != null; })
1420
+ .map(function (entry) {
1100
1421
  if (entry === null) {
1101
1422
  return null;
1102
1423
  }
@@ -1104,17 +1425,17 @@ const deserializeAws_restJson1BatchPutMessageErrorEntries = (output, context) =>
1104
1425
  });
1105
1426
  return retVal;
1106
1427
  };
1107
- const deserializeAws_restJson1BatchPutMessageErrorEntry = (output, context) => {
1428
+ var deserializeAws_restJson1BatchPutMessageErrorEntry = function (output, context) {
1108
1429
  return {
1109
1430
  errorCode: __expectString(output.errorCode),
1110
1431
  errorMessage: __expectString(output.errorMessage),
1111
1432
  messageId: __expectString(output.messageId),
1112
1433
  };
1113
1434
  };
1114
- const deserializeAws_restJson1BatchUpdateDetectorErrorEntries = (output, context) => {
1115
- const retVal = (output || [])
1116
- .filter((e) => e != null)
1117
- .map((entry) => {
1435
+ var deserializeAws_restJson1BatchUpdateDetectorErrorEntries = function (output, context) {
1436
+ var retVal = (output || [])
1437
+ .filter(function (e) { return e != null; })
1438
+ .map(function (entry) {
1118
1439
  if (entry === null) {
1119
1440
  return null;
1120
1441
  }
@@ -1122,14 +1443,14 @@ const deserializeAws_restJson1BatchUpdateDetectorErrorEntries = (output, context
1122
1443
  });
1123
1444
  return retVal;
1124
1445
  };
1125
- const deserializeAws_restJson1BatchUpdateDetectorErrorEntry = (output, context) => {
1446
+ var deserializeAws_restJson1BatchUpdateDetectorErrorEntry = function (output, context) {
1126
1447
  return {
1127
1448
  errorCode: __expectString(output.errorCode),
1128
1449
  errorMessage: __expectString(output.errorMessage),
1129
1450
  messageId: __expectString(output.messageId),
1130
1451
  };
1131
1452
  };
1132
- const deserializeAws_restJson1CustomerAction = (output, context) => {
1453
+ var deserializeAws_restJson1CustomerAction = function (output, context) {
1133
1454
  return {
1134
1455
  acknowledgeActionConfiguration: output.acknowledgeActionConfiguration != null
1135
1456
  ? deserializeAws_restJson1AcknowledgeActionConfiguration(output.acknowledgeActionConfiguration, context)
@@ -1149,7 +1470,7 @@ const deserializeAws_restJson1CustomerAction = (output, context) => {
1149
1470
  : undefined,
1150
1471
  };
1151
1472
  };
1152
- const deserializeAws_restJson1Detector = (output, context) => {
1473
+ var deserializeAws_restJson1Detector = function (output, context) {
1153
1474
  return {
1154
1475
  creationTime: output.creationTime != null
1155
1476
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1163,22 +1484,22 @@ const deserializeAws_restJson1Detector = (output, context) => {
1163
1484
  state: output.state != null ? deserializeAws_restJson1DetectorState(output.state, context) : undefined,
1164
1485
  };
1165
1486
  };
1166
- const deserializeAws_restJson1DetectorState = (output, context) => {
1487
+ var deserializeAws_restJson1DetectorState = function (output, context) {
1167
1488
  return {
1168
1489
  stateName: __expectString(output.stateName),
1169
1490
  timers: output.timers != null ? deserializeAws_restJson1Timers(output.timers, context) : undefined,
1170
1491
  variables: output.variables != null ? deserializeAws_restJson1Variables(output.variables, context) : undefined,
1171
1492
  };
1172
1493
  };
1173
- const deserializeAws_restJson1DetectorStateSummary = (output, context) => {
1494
+ var deserializeAws_restJson1DetectorStateSummary = function (output, context) {
1174
1495
  return {
1175
1496
  stateName: __expectString(output.stateName),
1176
1497
  };
1177
1498
  };
1178
- const deserializeAws_restJson1DetectorSummaries = (output, context) => {
1179
- const retVal = (output || [])
1180
- .filter((e) => e != null)
1181
- .map((entry) => {
1499
+ var deserializeAws_restJson1DetectorSummaries = function (output, context) {
1500
+ var retVal = (output || [])
1501
+ .filter(function (e) { return e != null; })
1502
+ .map(function (entry) {
1182
1503
  if (entry === null) {
1183
1504
  return null;
1184
1505
  }
@@ -1186,7 +1507,7 @@ const deserializeAws_restJson1DetectorSummaries = (output, context) => {
1186
1507
  });
1187
1508
  return retVal;
1188
1509
  };
1189
- const deserializeAws_restJson1DetectorSummary = (output, context) => {
1510
+ var deserializeAws_restJson1DetectorSummary = function (output, context) {
1190
1511
  return {
1191
1512
  creationTime: output.creationTime != null
1192
1513
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1200,47 +1521,47 @@ const deserializeAws_restJson1DetectorSummary = (output, context) => {
1200
1521
  state: output.state != null ? deserializeAws_restJson1DetectorStateSummary(output.state, context) : undefined,
1201
1522
  };
1202
1523
  };
1203
- const deserializeAws_restJson1DisableActionConfiguration = (output, context) => {
1524
+ var deserializeAws_restJson1DisableActionConfiguration = function (output, context) {
1204
1525
  return {
1205
1526
  note: __expectString(output.note),
1206
1527
  };
1207
1528
  };
1208
- const deserializeAws_restJson1EnableActionConfiguration = (output, context) => {
1529
+ var deserializeAws_restJson1EnableActionConfiguration = function (output, context) {
1209
1530
  return {
1210
1531
  note: __expectString(output.note),
1211
1532
  };
1212
1533
  };
1213
- const deserializeAws_restJson1ResetActionConfiguration = (output, context) => {
1534
+ var deserializeAws_restJson1ResetActionConfiguration = function (output, context) {
1214
1535
  return {
1215
1536
  note: __expectString(output.note),
1216
1537
  };
1217
1538
  };
1218
- const deserializeAws_restJson1RuleEvaluation = (output, context) => {
1539
+ var deserializeAws_restJson1RuleEvaluation = function (output, context) {
1219
1540
  return {
1220
1541
  simpleRuleEvaluation: output.simpleRuleEvaluation != null
1221
1542
  ? deserializeAws_restJson1SimpleRuleEvaluation(output.simpleRuleEvaluation, context)
1222
1543
  : undefined,
1223
1544
  };
1224
1545
  };
1225
- const deserializeAws_restJson1SimpleRuleEvaluation = (output, context) => {
1546
+ var deserializeAws_restJson1SimpleRuleEvaluation = function (output, context) {
1226
1547
  return {
1227
1548
  inputPropertyValue: __expectString(output.inputPropertyValue),
1228
1549
  operator: __expectString(output.operator),
1229
1550
  thresholdValue: __expectString(output.thresholdValue),
1230
1551
  };
1231
1552
  };
1232
- const deserializeAws_restJson1SnoozeActionConfiguration = (output, context) => {
1553
+ var deserializeAws_restJson1SnoozeActionConfiguration = function (output, context) {
1233
1554
  return {
1234
1555
  note: __expectString(output.note),
1235
1556
  snoozeDuration: __expectInt32(output.snoozeDuration),
1236
1557
  };
1237
1558
  };
1238
- const deserializeAws_restJson1StateChangeConfiguration = (output, context) => {
1559
+ var deserializeAws_restJson1StateChangeConfiguration = function (output, context) {
1239
1560
  return {
1240
1561
  triggerType: __expectString(output.triggerType),
1241
1562
  };
1242
1563
  };
1243
- const deserializeAws_restJson1SystemEvent = (output, context) => {
1564
+ var deserializeAws_restJson1SystemEvent = function (output, context) {
1244
1565
  return {
1245
1566
  eventType: __expectString(output.eventType),
1246
1567
  stateChangeConfiguration: output.stateChangeConfiguration != null
@@ -1248,16 +1569,16 @@ const deserializeAws_restJson1SystemEvent = (output, context) => {
1248
1569
  : undefined,
1249
1570
  };
1250
1571
  };
1251
- const deserializeAws_restJson1Timer = (output, context) => {
1572
+ var deserializeAws_restJson1Timer = function (output, context) {
1252
1573
  return {
1253
1574
  name: __expectString(output.name),
1254
1575
  timestamp: output.timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.timestamp))) : undefined,
1255
1576
  };
1256
1577
  };
1257
- const deserializeAws_restJson1Timers = (output, context) => {
1258
- const retVal = (output || [])
1259
- .filter((e) => e != null)
1260
- .map((entry) => {
1578
+ var deserializeAws_restJson1Timers = function (output, context) {
1579
+ var retVal = (output || [])
1580
+ .filter(function (e) { return e != null; })
1581
+ .map(function (entry) {
1261
1582
  if (entry === null) {
1262
1583
  return null;
1263
1584
  }
@@ -1265,16 +1586,16 @@ const deserializeAws_restJson1Timers = (output, context) => {
1265
1586
  });
1266
1587
  return retVal;
1267
1588
  };
1268
- const deserializeAws_restJson1Variable = (output, context) => {
1589
+ var deserializeAws_restJson1Variable = function (output, context) {
1269
1590
  return {
1270
1591
  name: __expectString(output.name),
1271
1592
  value: __expectString(output.value),
1272
1593
  };
1273
1594
  };
1274
- const deserializeAws_restJson1Variables = (output, context) => {
1275
- const retVal = (output || [])
1276
- .filter((e) => e != null)
1277
- .map((entry) => {
1595
+ var deserializeAws_restJson1Variables = function (output, context) {
1596
+ var retVal = (output || [])
1597
+ .filter(function (e) { return e != null; })
1598
+ .map(function (entry) {
1278
1599
  if (entry === null) {
1279
1600
  return null;
1280
1601
  }
@@ -1282,39 +1603,57 @@ const deserializeAws_restJson1Variables = (output, context) => {
1282
1603
  });
1283
1604
  return retVal;
1284
1605
  };
1285
- const deserializeMetadata = (output) => ({
1286
- httpStatusCode: output.statusCode,
1287
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1288
- extendedRequestId: output.headers["x-amz-id-2"],
1289
- cfId: output.headers["x-amz-cf-id"],
1290
- });
1291
- const collectBody = (streamBody = new Uint8Array(), context) => {
1606
+ var deserializeMetadata = function (output) {
1607
+ var _a, _b;
1608
+ return ({
1609
+ httpStatusCode: output.statusCode,
1610
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1611
+ extendedRequestId: output.headers["x-amz-id-2"],
1612
+ cfId: output.headers["x-amz-cf-id"],
1613
+ });
1614
+ };
1615
+ var collectBody = function (streamBody, context) {
1616
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1292
1617
  if (streamBody instanceof Uint8Array) {
1293
1618
  return Promise.resolve(streamBody);
1294
1619
  }
1295
1620
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1296
1621
  };
1297
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1298
- const isSerializableHeaderValue = (value) => value !== undefined &&
1299
- value !== null &&
1300
- value !== "" &&
1301
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1302
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1303
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1304
- if (encoded.length) {
1305
- return JSON.parse(encoded);
1306
- }
1307
- return {};
1308
- });
1309
- const parseErrorBody = async (errorBody, context) => {
1310
- const value = await parseBody(errorBody, context);
1311
- value.message = value.message ?? value.Message;
1312
- return value;
1622
+ var collectBodyString = function (streamBody, context) {
1623
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1624
+ };
1625
+ var isSerializableHeaderValue = function (value) {
1626
+ return value !== undefined &&
1627
+ value !== null &&
1628
+ value !== "" &&
1629
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1630
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1313
1631
  };
1314
- const loadRestJsonErrorCode = (output, data) => {
1315
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1316
- const sanitizeErrorCode = (rawValue) => {
1317
- let cleanValue = rawValue;
1632
+ var parseBody = function (streamBody, context) {
1633
+ return collectBodyString(streamBody, context).then(function (encoded) {
1634
+ if (encoded.length) {
1635
+ return JSON.parse(encoded);
1636
+ }
1637
+ return {};
1638
+ });
1639
+ };
1640
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1641
+ var value;
1642
+ var _a;
1643
+ return __generator(this, function (_b) {
1644
+ switch (_b.label) {
1645
+ case 0: return [4, parseBody(errorBody, context)];
1646
+ case 1:
1647
+ value = _b.sent();
1648
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1649
+ return [2, value];
1650
+ }
1651
+ });
1652
+ }); };
1653
+ var loadRestJsonErrorCode = function (output, data) {
1654
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1655
+ var sanitizeErrorCode = function (rawValue) {
1656
+ var cleanValue = rawValue;
1318
1657
  if (typeof cleanValue === "number") {
1319
1658
  cleanValue = cleanValue.toString();
1320
1659
  }
@@ -1329,7 +1668,7 @@ const loadRestJsonErrorCode = (output, data) => {
1329
1668
  }
1330
1669
  return cleanValue;
1331
1670
  };
1332
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1671
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1333
1672
  if (headerKey !== undefined) {
1334
1673
  return sanitizeErrorCode(output.headers[headerKey]);
1335
1674
  }