@aws-sdk/client-iot-events-data 3.180.0 → 3.183.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,1332 +1,1011 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  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";
4
3
  import { IoTEventsDataServiceException as __BaseException } from "../models/IoTEventsDataServiceException";
5
4
  import { InternalFailureException, InvalidRequestException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
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
- }
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
+ }),
30
16
  });
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
- }
17
+ return new __HttpRequest({
18
+ protocol,
19
+ hostname,
20
+ port,
21
+ method: "POST",
22
+ headers,
23
+ path: resolvedPath,
24
+ body,
56
25
  });
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
- }
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
+ }),
82
38
  });
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
- }
39
+ return new __HttpRequest({
40
+ protocol,
41
+ hostname,
42
+ port,
43
+ method: "POST",
44
+ headers,
45
+ path: resolvedPath,
46
+ body,
108
47
  });
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
- }
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
+ }),
132
60
  });
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
- }
61
+ return new __HttpRequest({
62
+ protocol,
63
+ hostname,
64
+ port,
65
+ method: "POST",
66
+ headers,
67
+ path: resolvedPath,
68
+ body,
158
69
  });
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
- }
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
+ }),
184
82
  });
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
- }
83
+ return new __HttpRequest({
84
+ protocol,
85
+ hostname,
86
+ port,
87
+ method: "POST",
88
+ headers,
89
+ path: resolvedPath,
90
+ body,
210
91
  });
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
- }
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) }),
236
102
  });
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
- }
103
+ return new __HttpRequest({
104
+ protocol,
105
+ hostname,
106
+ port,
107
+ method: "POST",
108
+ headers,
109
+ path: resolvedPath,
110
+ body,
262
111
  });
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
- }
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
+ }),
289
124
  });
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
- }
125
+ return new __HttpRequest({
126
+ protocol,
127
+ hostname,
128
+ port,
129
+ method: "POST",
130
+ headers,
131
+ path: resolvedPath,
132
+ body,
317
133
  });
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
- }
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
+ }),
340
146
  });
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, parseBody(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
- }
147
+ return new __HttpRequest({
148
+ protocol,
149
+ hostname,
150
+ port,
151
+ method: "POST",
152
+ headers,
153
+ path: resolvedPath,
154
+ body,
385
155
  });
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
- }
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
+ }),
408
168
  });
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, parseBody(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
- }
169
+ return new __HttpRequest({
170
+ protocol,
171
+ hostname,
172
+ port,
173
+ method: "POST",
174
+ headers,
175
+ path: resolvedPath,
176
+ body,
453
177
  });
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
- }
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],
476
186
  });
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, parseBody(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
- }
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,
521
197
  });
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
- }
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],
544
206
  });
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, parseBody(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
- }
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,
589
217
  });
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
- }
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()],
612
227
  });
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, parseBody(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
- }
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,
657
238
  });
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
- }
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()],
680
249
  });
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, parseBody(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
- }
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,
725
260
  });
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
- }
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),
748
268
  });
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, parseBody(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
- }
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),
793
310
  });
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
- }
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),
816
352
  });
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, parseBody(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
- }
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),
861
394
  });
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
- }
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),
884
436
  });
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, parseBody(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
- }
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),
933
478
  });
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
- }
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),
956
520
  });
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, parseBody(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
- }
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),
1005
562
  });
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
- }
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),
1031
604
  });
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, parseBody(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
- }
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),
1080
649
  });
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
- }
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),
1106
694
  });
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, parseBody(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
- }
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),
1155
742
  });
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)];
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,
1168
794
  });
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)];
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,
1180
806
  });
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)];
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,
1192
818
  });
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)];
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,
1204
830
  });
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)];
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,
1216
842
  });
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 }));
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
+ };
1220
852
  };
1221
- var serializeAws_restJson1AcknowledgeAlarmActionRequests = function (input, context) {
853
+ const serializeAws_restJson1AcknowledgeAlarmActionRequests = (input, context) => {
1222
854
  return input
1223
- .filter(function (e) { return e != null; })
1224
- .map(function (entry) {
855
+ .filter((e) => e != null)
856
+ .map((entry) => {
1225
857
  return serializeAws_restJson1AcknowledgeAlarmActionRequest(entry, context);
1226
858
  });
1227
859
  };
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 }));
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
+ };
1230
866
  };
1231
- var serializeAws_restJson1DeleteDetectorRequests = function (input, context) {
867
+ const serializeAws_restJson1DeleteDetectorRequests = (input, context) => {
1232
868
  return input
1233
- .filter(function (e) { return e != null; })
1234
- .map(function (entry) {
869
+ .filter((e) => e != null)
870
+ .map((entry) => {
1235
871
  return serializeAws_restJson1DeleteDetectorRequest(entry, context);
1236
872
  });
1237
873
  };
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) }));
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
+ };
1240
880
  };
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 }));
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
+ };
1243
888
  };
1244
- var serializeAws_restJson1DisableAlarmActionRequests = function (input, context) {
889
+ const serializeAws_restJson1DisableAlarmActionRequests = (input, context) => {
1245
890
  return input
1246
- .filter(function (e) { return e != null; })
1247
- .map(function (entry) {
891
+ .filter((e) => e != null)
892
+ .map((entry) => {
1248
893
  return serializeAws_restJson1DisableAlarmActionRequest(entry, context);
1249
894
  });
1250
895
  };
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 }));
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
+ };
1253
903
  };
1254
- var serializeAws_restJson1EnableAlarmActionRequests = function (input, context) {
904
+ const serializeAws_restJson1EnableAlarmActionRequests = (input, context) => {
1255
905
  return input
1256
- .filter(function (e) { return e != null; })
1257
- .map(function (entry) {
906
+ .filter((e) => e != null)
907
+ .map((entry) => {
1258
908
  return serializeAws_restJson1EnableAlarmActionRequest(entry, context);
1259
909
  });
1260
910
  };
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) }));
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
+ };
1263
918
  };
1264
- var serializeAws_restJson1Messages = function (input, context) {
919
+ const serializeAws_restJson1Messages = (input, context) => {
1265
920
  return input
1266
- .filter(function (e) { return e != null; })
1267
- .map(function (entry) {
921
+ .filter((e) => e != null)
922
+ .map((entry) => {
1268
923
  return serializeAws_restJson1Message(entry, context);
1269
924
  });
1270
925
  };
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 }));
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
+ };
1273
933
  };
1274
- var serializeAws_restJson1ResetAlarmActionRequests = function (input, context) {
934
+ const serializeAws_restJson1ResetAlarmActionRequests = (input, context) => {
1275
935
  return input
1276
- .filter(function (e) { return e != null; })
1277
- .map(function (entry) {
936
+ .filter((e) => e != null)
937
+ .map((entry) => {
1278
938
  return serializeAws_restJson1ResetAlarmActionRequest(entry, context);
1279
939
  });
1280
940
  };
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 }));
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
+ };
1283
949
  };
1284
- var serializeAws_restJson1SnoozeAlarmActionRequests = function (input, context) {
950
+ const serializeAws_restJson1SnoozeAlarmActionRequests = (input, context) => {
1285
951
  return input
1286
- .filter(function (e) { return e != null; })
1287
- .map(function (entry) {
952
+ .filter((e) => e != null)
953
+ .map((entry) => {
1288
954
  return serializeAws_restJson1SnoozeAlarmActionRequest(entry, context);
1289
955
  });
1290
956
  };
1291
- var serializeAws_restJson1TimerDefinition = function (input, context) {
1292
- return __assign(__assign({}, (input.name != null && { name: input.name })), (input.seconds != null && { seconds: input.seconds }));
957
+ const serializeAws_restJson1TimerDefinition = (input, context) => {
958
+ return {
959
+ ...(input.name != null && { name: input.name }),
960
+ ...(input.seconds != null && { seconds: input.seconds }),
961
+ };
1293
962
  };
1294
- var serializeAws_restJson1TimerDefinitions = function (input, context) {
963
+ const serializeAws_restJson1TimerDefinitions = (input, context) => {
1295
964
  return input
1296
- .filter(function (e) { return e != null; })
1297
- .map(function (entry) {
965
+ .filter((e) => e != null)
966
+ .map((entry) => {
1298
967
  return serializeAws_restJson1TimerDefinition(entry, context);
1299
968
  });
1300
969
  };
1301
- var serializeAws_restJson1TimestampValue = function (input, context) {
1302
- return __assign({}, (input.timeInMillis != null && { timeInMillis: input.timeInMillis }));
970
+ const serializeAws_restJson1TimestampValue = (input, context) => {
971
+ return {
972
+ ...(input.timeInMillis != null && { timeInMillis: input.timeInMillis }),
973
+ };
1303
974
  };
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) }));
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
+ };
1306
982
  };
1307
- var serializeAws_restJson1UpdateDetectorRequests = function (input, context) {
983
+ const serializeAws_restJson1UpdateDetectorRequests = (input, context) => {
1308
984
  return input
1309
- .filter(function (e) { return e != null; })
1310
- .map(function (entry) {
985
+ .filter((e) => e != null)
986
+ .map((entry) => {
1311
987
  return serializeAws_restJson1UpdateDetectorRequest(entry, context);
1312
988
  });
1313
989
  };
1314
- var serializeAws_restJson1VariableDefinition = function (input, context) {
1315
- return __assign(__assign({}, (input.name != null && { name: input.name })), (input.value != null && { value: input.value }));
990
+ const serializeAws_restJson1VariableDefinition = (input, context) => {
991
+ return {
992
+ ...(input.name != null && { name: input.name }),
993
+ ...(input.value != null && { value: input.value }),
994
+ };
1316
995
  };
1317
- var serializeAws_restJson1VariableDefinitions = function (input, context) {
996
+ const serializeAws_restJson1VariableDefinitions = (input, context) => {
1318
997
  return input
1319
- .filter(function (e) { return e != null; })
1320
- .map(function (entry) {
998
+ .filter((e) => e != null)
999
+ .map((entry) => {
1321
1000
  return serializeAws_restJson1VariableDefinition(entry, context);
1322
1001
  });
1323
1002
  };
1324
- var deserializeAws_restJson1AcknowledgeActionConfiguration = function (output, context) {
1003
+ const deserializeAws_restJson1AcknowledgeActionConfiguration = (output, context) => {
1325
1004
  return {
1326
1005
  note: __expectString(output.note),
1327
1006
  };
1328
1007
  };
1329
- var deserializeAws_restJson1Alarm = function (output, context) {
1008
+ const deserializeAws_restJson1Alarm = (output, context) => {
1330
1009
  return {
1331
1010
  alarmModelName: __expectString(output.alarmModelName),
1332
1011
  alarmModelVersion: __expectString(output.alarmModelVersion),
@@ -1341,7 +1020,7 @@ var deserializeAws_restJson1Alarm = function (output, context) {
1341
1020
  severity: __expectInt32(output.severity),
1342
1021
  };
1343
1022
  };
1344
- var deserializeAws_restJson1AlarmState = function (output, context) {
1023
+ const deserializeAws_restJson1AlarmState = (output, context) => {
1345
1024
  return {
1346
1025
  customerAction: output.customerAction != null
1347
1026
  ? deserializeAws_restJson1CustomerAction(output.customerAction, context)
@@ -1353,10 +1032,10 @@ var deserializeAws_restJson1AlarmState = function (output, context) {
1353
1032
  systemEvent: output.systemEvent != null ? deserializeAws_restJson1SystemEvent(output.systemEvent, context) : undefined,
1354
1033
  };
1355
1034
  };
1356
- var deserializeAws_restJson1AlarmSummaries = function (output, context) {
1357
- var retVal = (output || [])
1358
- .filter(function (e) { return e != null; })
1359
- .map(function (entry) {
1035
+ const deserializeAws_restJson1AlarmSummaries = (output, context) => {
1036
+ const retVal = (output || [])
1037
+ .filter((e) => e != null)
1038
+ .map((entry) => {
1360
1039
  if (entry === null) {
1361
1040
  return null;
1362
1041
  }
@@ -1364,7 +1043,7 @@ var deserializeAws_restJson1AlarmSummaries = function (output, context) {
1364
1043
  });
1365
1044
  return retVal;
1366
1045
  };
1367
- var deserializeAws_restJson1AlarmSummary = function (output, context) {
1046
+ const deserializeAws_restJson1AlarmSummary = (output, context) => {
1368
1047
  return {
1369
1048
  alarmModelName: __expectString(output.alarmModelName),
1370
1049
  alarmModelVersion: __expectString(output.alarmModelVersion),
@@ -1378,10 +1057,10 @@ var deserializeAws_restJson1AlarmSummary = function (output, context) {
1378
1057
  stateName: __expectString(output.stateName),
1379
1058
  };
1380
1059
  };
1381
- var deserializeAws_restJson1BatchAlarmActionErrorEntries = function (output, context) {
1382
- var retVal = (output || [])
1383
- .filter(function (e) { return e != null; })
1384
- .map(function (entry) {
1060
+ const deserializeAws_restJson1BatchAlarmActionErrorEntries = (output, context) => {
1061
+ const retVal = (output || [])
1062
+ .filter((e) => e != null)
1063
+ .map((entry) => {
1385
1064
  if (entry === null) {
1386
1065
  return null;
1387
1066
  }
@@ -1389,17 +1068,17 @@ var deserializeAws_restJson1BatchAlarmActionErrorEntries = function (output, con
1389
1068
  });
1390
1069
  return retVal;
1391
1070
  };
1392
- var deserializeAws_restJson1BatchAlarmActionErrorEntry = function (output, context) {
1071
+ const deserializeAws_restJson1BatchAlarmActionErrorEntry = (output, context) => {
1393
1072
  return {
1394
1073
  errorCode: __expectString(output.errorCode),
1395
1074
  errorMessage: __expectString(output.errorMessage),
1396
1075
  requestId: __expectString(output.requestId),
1397
1076
  };
1398
1077
  };
1399
- var deserializeAws_restJson1BatchDeleteDetectorErrorEntries = function (output, context) {
1400
- var retVal = (output || [])
1401
- .filter(function (e) { return e != null; })
1402
- .map(function (entry) {
1078
+ const deserializeAws_restJson1BatchDeleteDetectorErrorEntries = (output, context) => {
1079
+ const retVal = (output || [])
1080
+ .filter((e) => e != null)
1081
+ .map((entry) => {
1403
1082
  if (entry === null) {
1404
1083
  return null;
1405
1084
  }
@@ -1407,17 +1086,17 @@ var deserializeAws_restJson1BatchDeleteDetectorErrorEntries = function (output,
1407
1086
  });
1408
1087
  return retVal;
1409
1088
  };
1410
- var deserializeAws_restJson1BatchDeleteDetectorErrorEntry = function (output, context) {
1089
+ const deserializeAws_restJson1BatchDeleteDetectorErrorEntry = (output, context) => {
1411
1090
  return {
1412
1091
  errorCode: __expectString(output.errorCode),
1413
1092
  errorMessage: __expectString(output.errorMessage),
1414
1093
  messageId: __expectString(output.messageId),
1415
1094
  };
1416
1095
  };
1417
- var deserializeAws_restJson1BatchPutMessageErrorEntries = function (output, context) {
1418
- var retVal = (output || [])
1419
- .filter(function (e) { return e != null; })
1420
- .map(function (entry) {
1096
+ const deserializeAws_restJson1BatchPutMessageErrorEntries = (output, context) => {
1097
+ const retVal = (output || [])
1098
+ .filter((e) => e != null)
1099
+ .map((entry) => {
1421
1100
  if (entry === null) {
1422
1101
  return null;
1423
1102
  }
@@ -1425,17 +1104,17 @@ var deserializeAws_restJson1BatchPutMessageErrorEntries = function (output, cont
1425
1104
  });
1426
1105
  return retVal;
1427
1106
  };
1428
- var deserializeAws_restJson1BatchPutMessageErrorEntry = function (output, context) {
1107
+ const deserializeAws_restJson1BatchPutMessageErrorEntry = (output, context) => {
1429
1108
  return {
1430
1109
  errorCode: __expectString(output.errorCode),
1431
1110
  errorMessage: __expectString(output.errorMessage),
1432
1111
  messageId: __expectString(output.messageId),
1433
1112
  };
1434
1113
  };
1435
- var deserializeAws_restJson1BatchUpdateDetectorErrorEntries = function (output, context) {
1436
- var retVal = (output || [])
1437
- .filter(function (e) { return e != null; })
1438
- .map(function (entry) {
1114
+ const deserializeAws_restJson1BatchUpdateDetectorErrorEntries = (output, context) => {
1115
+ const retVal = (output || [])
1116
+ .filter((e) => e != null)
1117
+ .map((entry) => {
1439
1118
  if (entry === null) {
1440
1119
  return null;
1441
1120
  }
@@ -1443,14 +1122,14 @@ var deserializeAws_restJson1BatchUpdateDetectorErrorEntries = function (output,
1443
1122
  });
1444
1123
  return retVal;
1445
1124
  };
1446
- var deserializeAws_restJson1BatchUpdateDetectorErrorEntry = function (output, context) {
1125
+ const deserializeAws_restJson1BatchUpdateDetectorErrorEntry = (output, context) => {
1447
1126
  return {
1448
1127
  errorCode: __expectString(output.errorCode),
1449
1128
  errorMessage: __expectString(output.errorMessage),
1450
1129
  messageId: __expectString(output.messageId),
1451
1130
  };
1452
1131
  };
1453
- var deserializeAws_restJson1CustomerAction = function (output, context) {
1132
+ const deserializeAws_restJson1CustomerAction = (output, context) => {
1454
1133
  return {
1455
1134
  acknowledgeActionConfiguration: output.acknowledgeActionConfiguration != null
1456
1135
  ? deserializeAws_restJson1AcknowledgeActionConfiguration(output.acknowledgeActionConfiguration, context)
@@ -1470,7 +1149,7 @@ var deserializeAws_restJson1CustomerAction = function (output, context) {
1470
1149
  : undefined,
1471
1150
  };
1472
1151
  };
1473
- var deserializeAws_restJson1Detector = function (output, context) {
1152
+ const deserializeAws_restJson1Detector = (output, context) => {
1474
1153
  return {
1475
1154
  creationTime: output.creationTime != null
1476
1155
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1484,22 +1163,22 @@ var deserializeAws_restJson1Detector = function (output, context) {
1484
1163
  state: output.state != null ? deserializeAws_restJson1DetectorState(output.state, context) : undefined,
1485
1164
  };
1486
1165
  };
1487
- var deserializeAws_restJson1DetectorState = function (output, context) {
1166
+ const deserializeAws_restJson1DetectorState = (output, context) => {
1488
1167
  return {
1489
1168
  stateName: __expectString(output.stateName),
1490
1169
  timers: output.timers != null ? deserializeAws_restJson1Timers(output.timers, context) : undefined,
1491
1170
  variables: output.variables != null ? deserializeAws_restJson1Variables(output.variables, context) : undefined,
1492
1171
  };
1493
1172
  };
1494
- var deserializeAws_restJson1DetectorStateSummary = function (output, context) {
1173
+ const deserializeAws_restJson1DetectorStateSummary = (output, context) => {
1495
1174
  return {
1496
1175
  stateName: __expectString(output.stateName),
1497
1176
  };
1498
1177
  };
1499
- var deserializeAws_restJson1DetectorSummaries = function (output, context) {
1500
- var retVal = (output || [])
1501
- .filter(function (e) { return e != null; })
1502
- .map(function (entry) {
1178
+ const deserializeAws_restJson1DetectorSummaries = (output, context) => {
1179
+ const retVal = (output || [])
1180
+ .filter((e) => e != null)
1181
+ .map((entry) => {
1503
1182
  if (entry === null) {
1504
1183
  return null;
1505
1184
  }
@@ -1507,7 +1186,7 @@ var deserializeAws_restJson1DetectorSummaries = function (output, context) {
1507
1186
  });
1508
1187
  return retVal;
1509
1188
  };
1510
- var deserializeAws_restJson1DetectorSummary = function (output, context) {
1189
+ const deserializeAws_restJson1DetectorSummary = (output, context) => {
1511
1190
  return {
1512
1191
  creationTime: output.creationTime != null
1513
1192
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1521,47 +1200,47 @@ var deserializeAws_restJson1DetectorSummary = function (output, context) {
1521
1200
  state: output.state != null ? deserializeAws_restJson1DetectorStateSummary(output.state, context) : undefined,
1522
1201
  };
1523
1202
  };
1524
- var deserializeAws_restJson1DisableActionConfiguration = function (output, context) {
1203
+ const deserializeAws_restJson1DisableActionConfiguration = (output, context) => {
1525
1204
  return {
1526
1205
  note: __expectString(output.note),
1527
1206
  };
1528
1207
  };
1529
- var deserializeAws_restJson1EnableActionConfiguration = function (output, context) {
1208
+ const deserializeAws_restJson1EnableActionConfiguration = (output, context) => {
1530
1209
  return {
1531
1210
  note: __expectString(output.note),
1532
1211
  };
1533
1212
  };
1534
- var deserializeAws_restJson1ResetActionConfiguration = function (output, context) {
1213
+ const deserializeAws_restJson1ResetActionConfiguration = (output, context) => {
1535
1214
  return {
1536
1215
  note: __expectString(output.note),
1537
1216
  };
1538
1217
  };
1539
- var deserializeAws_restJson1RuleEvaluation = function (output, context) {
1218
+ const deserializeAws_restJson1RuleEvaluation = (output, context) => {
1540
1219
  return {
1541
1220
  simpleRuleEvaluation: output.simpleRuleEvaluation != null
1542
1221
  ? deserializeAws_restJson1SimpleRuleEvaluation(output.simpleRuleEvaluation, context)
1543
1222
  : undefined,
1544
1223
  };
1545
1224
  };
1546
- var deserializeAws_restJson1SimpleRuleEvaluation = function (output, context) {
1225
+ const deserializeAws_restJson1SimpleRuleEvaluation = (output, context) => {
1547
1226
  return {
1548
1227
  inputPropertyValue: __expectString(output.inputPropertyValue),
1549
1228
  operator: __expectString(output.operator),
1550
1229
  thresholdValue: __expectString(output.thresholdValue),
1551
1230
  };
1552
1231
  };
1553
- var deserializeAws_restJson1SnoozeActionConfiguration = function (output, context) {
1232
+ const deserializeAws_restJson1SnoozeActionConfiguration = (output, context) => {
1554
1233
  return {
1555
1234
  note: __expectString(output.note),
1556
1235
  snoozeDuration: __expectInt32(output.snoozeDuration),
1557
1236
  };
1558
1237
  };
1559
- var deserializeAws_restJson1StateChangeConfiguration = function (output, context) {
1238
+ const deserializeAws_restJson1StateChangeConfiguration = (output, context) => {
1560
1239
  return {
1561
1240
  triggerType: __expectString(output.triggerType),
1562
1241
  };
1563
1242
  };
1564
- var deserializeAws_restJson1SystemEvent = function (output, context) {
1243
+ const deserializeAws_restJson1SystemEvent = (output, context) => {
1565
1244
  return {
1566
1245
  eventType: __expectString(output.eventType),
1567
1246
  stateChangeConfiguration: output.stateChangeConfiguration != null
@@ -1569,16 +1248,16 @@ var deserializeAws_restJson1SystemEvent = function (output, context) {
1569
1248
  : undefined,
1570
1249
  };
1571
1250
  };
1572
- var deserializeAws_restJson1Timer = function (output, context) {
1251
+ const deserializeAws_restJson1Timer = (output, context) => {
1573
1252
  return {
1574
1253
  name: __expectString(output.name),
1575
1254
  timestamp: output.timestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.timestamp))) : undefined,
1576
1255
  };
1577
1256
  };
1578
- var deserializeAws_restJson1Timers = function (output, context) {
1579
- var retVal = (output || [])
1580
- .filter(function (e) { return e != null; })
1581
- .map(function (entry) {
1257
+ const deserializeAws_restJson1Timers = (output, context) => {
1258
+ const retVal = (output || [])
1259
+ .filter((e) => e != null)
1260
+ .map((entry) => {
1582
1261
  if (entry === null) {
1583
1262
  return null;
1584
1263
  }
@@ -1586,16 +1265,16 @@ var deserializeAws_restJson1Timers = function (output, context) {
1586
1265
  });
1587
1266
  return retVal;
1588
1267
  };
1589
- var deserializeAws_restJson1Variable = function (output, context) {
1268
+ const deserializeAws_restJson1Variable = (output, context) => {
1590
1269
  return {
1591
1270
  name: __expectString(output.name),
1592
1271
  value: __expectString(output.value),
1593
1272
  };
1594
1273
  };
1595
- var deserializeAws_restJson1Variables = function (output, context) {
1596
- var retVal = (output || [])
1597
- .filter(function (e) { return e != null; })
1598
- .map(function (entry) {
1274
+ const deserializeAws_restJson1Variables = (output, context) => {
1275
+ const retVal = (output || [])
1276
+ .filter((e) => e != null)
1277
+ .map((entry) => {
1599
1278
  if (entry === null) {
1600
1279
  return null;
1601
1280
  }
@@ -1603,44 +1282,39 @@ var deserializeAws_restJson1Variables = function (output, context) {
1603
1282
  });
1604
1283
  return retVal;
1605
1284
  };
1606
- var deserializeMetadata = function (output) {
1607
- var _a;
1608
- return ({
1609
- httpStatusCode: output.statusCode,
1610
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-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(); }
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) => {
1617
1292
  if (streamBody instanceof Uint8Array) {
1618
1293
  return Promise.resolve(streamBody);
1619
1294
  }
1620
1295
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1621
1296
  };
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);
1631
- };
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
- });
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;
1639
1313
  };
1640
- var loadRestJsonErrorCode = function (output, data) {
1641
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1642
- var sanitizeErrorCode = function (rawValue) {
1643
- var cleanValue = rawValue;
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;
1644
1318
  if (typeof cleanValue === "number") {
1645
1319
  cleanValue = cleanValue.toString();
1646
1320
  }
@@ -1655,7 +1329,7 @@ var loadRestJsonErrorCode = function (output, data) {
1655
1329
  }
1656
1330
  return cleanValue;
1657
1331
  };
1658
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1332
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1659
1333
  if (headerKey !== undefined) {
1660
1334
  return sanitizeErrorCode(output.headers[headerKey]);
1661
1335
  }