@aws-sdk/client-internetmonitor 3.490.0 → 3.495.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.
Files changed (31) hide show
  1. package/dist-cjs/InternetMonitor.js +1 -39
  2. package/dist-cjs/InternetMonitorClient.js +1 -43
  3. package/dist-cjs/commands/CreateMonitorCommand.js +1 -28
  4. package/dist-cjs/commands/DeleteMonitorCommand.js +1 -28
  5. package/dist-cjs/commands/GetHealthEventCommand.js +1 -28
  6. package/dist-cjs/commands/GetMonitorCommand.js +1 -28
  7. package/dist-cjs/commands/GetQueryResultsCommand.js +1 -28
  8. package/dist-cjs/commands/GetQueryStatusCommand.js +1 -28
  9. package/dist-cjs/commands/ListHealthEventsCommand.js +1 -28
  10. package/dist-cjs/commands/ListMonitorsCommand.js +1 -28
  11. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  12. package/dist-cjs/commands/StartQueryCommand.js +1 -28
  13. package/dist-cjs/commands/StopQueryCommand.js +1 -28
  14. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  15. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  16. package/dist-cjs/commands/UpdateMonitorCommand.js +1 -28
  17. package/dist-cjs/commands/index.js +1 -17
  18. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  19. package/dist-cjs/extensionConfiguration.js +1 -2
  20. package/dist-cjs/index.js +1877 -11
  21. package/dist-cjs/models/InternetMonitorServiceException.js +1 -12
  22. package/dist-cjs/models/index.js +1 -4
  23. package/dist-cjs/models/models_0.js +1 -207
  24. package/dist-cjs/pagination/GetQueryResultsPaginator.js +1 -7
  25. package/dist-cjs/pagination/Interfaces.js +1 -2
  26. package/dist-cjs/pagination/ListHealthEventsPaginator.js +1 -7
  27. package/dist-cjs/pagination/ListMonitorsPaginator.js +1 -7
  28. package/dist-cjs/pagination/index.js +1 -7
  29. package/dist-cjs/protocols/Aws_restJson1.js +1 -1167
  30. package/dist-cjs/runtimeExtensions.js +1 -22
  31. package/package.json +40 -40
@@ -1,1167 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateMonitorCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopQueryCommand = exports.de_StartQueryCommand = exports.de_ListTagsForResourceCommand = exports.de_ListMonitorsCommand = exports.de_ListHealthEventsCommand = exports.de_GetQueryStatusCommand = exports.de_GetQueryResultsCommand = exports.de_GetMonitorCommand = exports.de_GetHealthEventCommand = exports.de_DeleteMonitorCommand = exports.de_CreateMonitorCommand = exports.se_UpdateMonitorCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopQueryCommand = exports.se_StartQueryCommand = exports.se_ListTagsForResourceCommand = exports.se_ListMonitorsCommand = exports.se_ListHealthEventsCommand = exports.se_GetQueryStatusCommand = exports.se_GetQueryResultsCommand = exports.se_GetMonitorCommand = exports.se_GetHealthEventCommand = exports.se_DeleteMonitorCommand = exports.se_CreateMonitorCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const InternetMonitorServiceException_1 = require("../models/InternetMonitorServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_CreateMonitorCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/v20210603/Monitors");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
18
- HealthEventsConfig: (_) => se_HealthEventsConfig(_, context),
19
- InternetMeasurementsLogDelivery: (_) => (0, smithy_client_1._json)(_),
20
- MaxCityNetworksToMonitor: [],
21
- MonitorName: [],
22
- Resources: (_) => (0, smithy_client_1._json)(_),
23
- Tags: (_) => (0, smithy_client_1._json)(_),
24
- TrafficPercentageToMonitor: [],
25
- }));
26
- b.m("POST").h(headers).b(body);
27
- return b.build();
28
- };
29
- exports.se_CreateMonitorCommand = se_CreateMonitorCommand;
30
- const se_DeleteMonitorCommand = async (input, context) => {
31
- const b = (0, core_1.requestBuilder)(input, context);
32
- const headers = {};
33
- b.bp("/v20210603/Monitors/{MonitorName}");
34
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
35
- let body;
36
- b.m("DELETE").h(headers).b(body);
37
- return b.build();
38
- };
39
- exports.se_DeleteMonitorCommand = se_DeleteMonitorCommand;
40
- const se_GetHealthEventCommand = async (input, context) => {
41
- const b = (0, core_1.requestBuilder)(input, context);
42
- const headers = {};
43
- b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}");
44
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
45
- b.p("EventId", () => input.EventId, "{EventId}", false);
46
- let body;
47
- b.m("GET").h(headers).b(body);
48
- return b.build();
49
- };
50
- exports.se_GetHealthEventCommand = se_GetHealthEventCommand;
51
- const se_GetMonitorCommand = async (input, context) => {
52
- const b = (0, core_1.requestBuilder)(input, context);
53
- const headers = {};
54
- b.bp("/v20210603/Monitors/{MonitorName}");
55
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
56
- let body;
57
- b.m("GET").h(headers).b(body);
58
- return b.build();
59
- };
60
- exports.se_GetMonitorCommand = se_GetMonitorCommand;
61
- const se_GetQueryResultsCommand = async (input, context) => {
62
- const b = (0, core_1.requestBuilder)(input, context);
63
- const headers = {};
64
- b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results");
65
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
66
- b.p("QueryId", () => input.QueryId, "{QueryId}", false);
67
- const query = (0, smithy_client_1.map)({
68
- [_NT]: [, input[_NT]],
69
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
70
- });
71
- let body;
72
- b.m("GET").h(headers).q(query).b(body);
73
- return b.build();
74
- };
75
- exports.se_GetQueryResultsCommand = se_GetQueryResultsCommand;
76
- const se_GetQueryStatusCommand = async (input, context) => {
77
- const b = (0, core_1.requestBuilder)(input, context);
78
- const headers = {};
79
- b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status");
80
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
81
- b.p("QueryId", () => input.QueryId, "{QueryId}", false);
82
- let body;
83
- b.m("GET").h(headers).b(body);
84
- return b.build();
85
- };
86
- exports.se_GetQueryStatusCommand = se_GetQueryStatusCommand;
87
- const se_ListHealthEventsCommand = async (input, context) => {
88
- const b = (0, core_1.requestBuilder)(input, context);
89
- const headers = {};
90
- b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents");
91
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
92
- const query = (0, smithy_client_1.map)({
93
- [_ST]: [() => input.StartTime !== void 0, () => (input[_ST].toISOString().split(".")[0] + "Z").toString()],
94
- [_ET]: [() => input.EndTime !== void 0, () => (input[_ET].toISOString().split(".")[0] + "Z").toString()],
95
- [_NT]: [, input[_NT]],
96
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
97
- [_ES]: [, input[_ES]],
98
- });
99
- let body;
100
- b.m("GET").h(headers).q(query).b(body);
101
- return b.build();
102
- };
103
- exports.se_ListHealthEventsCommand = se_ListHealthEventsCommand;
104
- const se_ListMonitorsCommand = async (input, context) => {
105
- const b = (0, core_1.requestBuilder)(input, context);
106
- const headers = {};
107
- b.bp("/v20210603/Monitors");
108
- const query = (0, smithy_client_1.map)({
109
- [_NT]: [, input[_NT]],
110
- [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
111
- [_MS]: [, input[_MS]],
112
- });
113
- let body;
114
- b.m("GET").h(headers).q(query).b(body);
115
- return b.build();
116
- };
117
- exports.se_ListMonitorsCommand = se_ListMonitorsCommand;
118
- const se_ListTagsForResourceCommand = async (input, context) => {
119
- const b = (0, core_1.requestBuilder)(input, context);
120
- const headers = {};
121
- b.bp("/tags/{ResourceArn}");
122
- b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
123
- let body;
124
- b.m("GET").h(headers).b(body);
125
- return b.build();
126
- };
127
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
128
- const se_StartQueryCommand = async (input, context) => {
129
- const b = (0, core_1.requestBuilder)(input, context);
130
- const headers = {
131
- "content-type": "application/json",
132
- };
133
- b.bp("/v20210603/Monitors/{MonitorName}/Queries");
134
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
135
- let body;
136
- body = JSON.stringify((0, smithy_client_1.take)(input, {
137
- EndTime: (_) => _.toISOString().split(".")[0] + "Z",
138
- FilterParameters: (_) => (0, smithy_client_1._json)(_),
139
- QueryType: [],
140
- StartTime: (_) => _.toISOString().split(".")[0] + "Z",
141
- }));
142
- b.m("POST").h(headers).b(body);
143
- return b.build();
144
- };
145
- exports.se_StartQueryCommand = se_StartQueryCommand;
146
- const se_StopQueryCommand = async (input, context) => {
147
- const b = (0, core_1.requestBuilder)(input, context);
148
- const headers = {};
149
- b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}");
150
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
151
- b.p("QueryId", () => input.QueryId, "{QueryId}", false);
152
- let body;
153
- b.m("DELETE").h(headers).b(body);
154
- return b.build();
155
- };
156
- exports.se_StopQueryCommand = se_StopQueryCommand;
157
- const se_TagResourceCommand = async (input, context) => {
158
- const b = (0, core_1.requestBuilder)(input, context);
159
- const headers = {
160
- "content-type": "application/json",
161
- };
162
- b.bp("/tags/{ResourceArn}");
163
- b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
164
- let body;
165
- body = JSON.stringify((0, smithy_client_1.take)(input, {
166
- Tags: (_) => (0, smithy_client_1._json)(_),
167
- }));
168
- b.m("POST").h(headers).b(body);
169
- return b.build();
170
- };
171
- exports.se_TagResourceCommand = se_TagResourceCommand;
172
- const se_UntagResourceCommand = async (input, context) => {
173
- const b = (0, core_1.requestBuilder)(input, context);
174
- const headers = {};
175
- b.bp("/tags/{ResourceArn}");
176
- b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
177
- const query = (0, smithy_client_1.map)({
178
- [_tK]: [
179
- (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
180
- () => (input[_TK] || []).map((_entry) => _entry),
181
- ],
182
- });
183
- let body;
184
- b.m("DELETE").h(headers).q(query).b(body);
185
- return b.build();
186
- };
187
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
188
- const se_UpdateMonitorCommand = async (input, context) => {
189
- const b = (0, core_1.requestBuilder)(input, context);
190
- const headers = {
191
- "content-type": "application/json",
192
- };
193
- b.bp("/v20210603/Monitors/{MonitorName}");
194
- b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
195
- let body;
196
- body = JSON.stringify((0, smithy_client_1.take)(input, {
197
- ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
198
- HealthEventsConfig: (_) => se_HealthEventsConfig(_, context),
199
- InternetMeasurementsLogDelivery: (_) => (0, smithy_client_1._json)(_),
200
- MaxCityNetworksToMonitor: [],
201
- ResourcesToAdd: (_) => (0, smithy_client_1._json)(_),
202
- ResourcesToRemove: (_) => (0, smithy_client_1._json)(_),
203
- Status: [],
204
- TrafficPercentageToMonitor: [],
205
- }));
206
- b.m("PATCH").h(headers).b(body);
207
- return b.build();
208
- };
209
- exports.se_UpdateMonitorCommand = se_UpdateMonitorCommand;
210
- const de_CreateMonitorCommand = async (output, context) => {
211
- if (output.statusCode !== 200 && output.statusCode >= 300) {
212
- return de_CreateMonitorCommandError(output, context);
213
- }
214
- const contents = (0, smithy_client_1.map)({
215
- $metadata: deserializeMetadata(output),
216
- });
217
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
218
- const doc = (0, smithy_client_1.take)(data, {
219
- Arn: smithy_client_1.expectString,
220
- Status: smithy_client_1.expectString,
221
- });
222
- Object.assign(contents, doc);
223
- return contents;
224
- };
225
- exports.de_CreateMonitorCommand = de_CreateMonitorCommand;
226
- const de_CreateMonitorCommandError = async (output, context) => {
227
- const parsedOutput = {
228
- ...output,
229
- body: await parseErrorBody(output.body, context),
230
- };
231
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
232
- switch (errorCode) {
233
- case "AccessDeniedException":
234
- case "com.amazonaws.internetmonitor#AccessDeniedException":
235
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
236
- case "ConflictException":
237
- case "com.amazonaws.internetmonitor#ConflictException":
238
- throw await de_ConflictExceptionRes(parsedOutput, context);
239
- case "InternalServerException":
240
- case "com.amazonaws.internetmonitor#InternalServerException":
241
- throw await de_InternalServerExceptionRes(parsedOutput, context);
242
- case "LimitExceededException":
243
- case "com.amazonaws.internetmonitor#LimitExceededException":
244
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
245
- case "ThrottlingException":
246
- case "com.amazonaws.internetmonitor#ThrottlingException":
247
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
248
- case "ValidationException":
249
- case "com.amazonaws.internetmonitor#ValidationException":
250
- throw await de_ValidationExceptionRes(parsedOutput, context);
251
- default:
252
- const parsedBody = parsedOutput.body;
253
- return throwDefaultError({
254
- output,
255
- parsedBody,
256
- errorCode,
257
- });
258
- }
259
- };
260
- const de_DeleteMonitorCommand = async (output, context) => {
261
- if (output.statusCode !== 200 && output.statusCode >= 300) {
262
- return de_DeleteMonitorCommandError(output, context);
263
- }
264
- const contents = (0, smithy_client_1.map)({
265
- $metadata: deserializeMetadata(output),
266
- });
267
- await (0, smithy_client_1.collectBody)(output.body, context);
268
- return contents;
269
- };
270
- exports.de_DeleteMonitorCommand = de_DeleteMonitorCommand;
271
- const de_DeleteMonitorCommandError = async (output, context) => {
272
- const parsedOutput = {
273
- ...output,
274
- body: await parseErrorBody(output.body, context),
275
- };
276
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
277
- switch (errorCode) {
278
- case "AccessDeniedException":
279
- case "com.amazonaws.internetmonitor#AccessDeniedException":
280
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
281
- case "InternalServerException":
282
- case "com.amazonaws.internetmonitor#InternalServerException":
283
- throw await de_InternalServerExceptionRes(parsedOutput, context);
284
- case "ThrottlingException":
285
- case "com.amazonaws.internetmonitor#ThrottlingException":
286
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
287
- case "ValidationException":
288
- case "com.amazonaws.internetmonitor#ValidationException":
289
- throw await de_ValidationExceptionRes(parsedOutput, context);
290
- default:
291
- const parsedBody = parsedOutput.body;
292
- return throwDefaultError({
293
- output,
294
- parsedBody,
295
- errorCode,
296
- });
297
- }
298
- };
299
- const de_GetHealthEventCommand = async (output, context) => {
300
- if (output.statusCode !== 200 && output.statusCode >= 300) {
301
- return de_GetHealthEventCommandError(output, context);
302
- }
303
- const contents = (0, smithy_client_1.map)({
304
- $metadata: deserializeMetadata(output),
305
- });
306
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
307
- const doc = (0, smithy_client_1.take)(data, {
308
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
309
- EndedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
310
- EventArn: smithy_client_1.expectString,
311
- EventId: smithy_client_1.expectString,
312
- HealthScoreThreshold: smithy_client_1.limitedParseDouble,
313
- ImpactType: smithy_client_1.expectString,
314
- ImpactedLocations: (_) => de_ImpactedLocationsList(_, context),
315
- LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
316
- PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
317
- StartedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
318
- Status: smithy_client_1.expectString,
319
- });
320
- Object.assign(contents, doc);
321
- return contents;
322
- };
323
- exports.de_GetHealthEventCommand = de_GetHealthEventCommand;
324
- const de_GetHealthEventCommandError = async (output, context) => {
325
- const parsedOutput = {
326
- ...output,
327
- body: await parseErrorBody(output.body, context),
328
- };
329
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
330
- switch (errorCode) {
331
- case "AccessDeniedException":
332
- case "com.amazonaws.internetmonitor#AccessDeniedException":
333
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
334
- case "InternalServerException":
335
- case "com.amazonaws.internetmonitor#InternalServerException":
336
- throw await de_InternalServerExceptionRes(parsedOutput, context);
337
- case "ThrottlingException":
338
- case "com.amazonaws.internetmonitor#ThrottlingException":
339
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
340
- case "ValidationException":
341
- case "com.amazonaws.internetmonitor#ValidationException":
342
- throw await de_ValidationExceptionRes(parsedOutput, context);
343
- default:
344
- const parsedBody = parsedOutput.body;
345
- return throwDefaultError({
346
- output,
347
- parsedBody,
348
- errorCode,
349
- });
350
- }
351
- };
352
- const de_GetMonitorCommand = async (output, context) => {
353
- if (output.statusCode !== 200 && output.statusCode >= 300) {
354
- return de_GetMonitorCommandError(output, context);
355
- }
356
- const contents = (0, smithy_client_1.map)({
357
- $metadata: deserializeMetadata(output),
358
- });
359
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
360
- const doc = (0, smithy_client_1.take)(data, {
361
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
362
- HealthEventsConfig: (_) => de_HealthEventsConfig(_, context),
363
- InternetMeasurementsLogDelivery: smithy_client_1._json,
364
- MaxCityNetworksToMonitor: smithy_client_1.expectInt32,
365
- ModifiedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
366
- MonitorArn: smithy_client_1.expectString,
367
- MonitorName: smithy_client_1.expectString,
368
- ProcessingStatus: smithy_client_1.expectString,
369
- ProcessingStatusInfo: smithy_client_1.expectString,
370
- Resources: smithy_client_1._json,
371
- Status: smithy_client_1.expectString,
372
- Tags: smithy_client_1._json,
373
- TrafficPercentageToMonitor: smithy_client_1.expectInt32,
374
- });
375
- Object.assign(contents, doc);
376
- return contents;
377
- };
378
- exports.de_GetMonitorCommand = de_GetMonitorCommand;
379
- const de_GetMonitorCommandError = async (output, context) => {
380
- const parsedOutput = {
381
- ...output,
382
- body: await parseErrorBody(output.body, context),
383
- };
384
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
385
- switch (errorCode) {
386
- case "AccessDeniedException":
387
- case "com.amazonaws.internetmonitor#AccessDeniedException":
388
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
389
- case "InternalServerException":
390
- case "com.amazonaws.internetmonitor#InternalServerException":
391
- throw await de_InternalServerExceptionRes(parsedOutput, context);
392
- case "ThrottlingException":
393
- case "com.amazonaws.internetmonitor#ThrottlingException":
394
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
395
- case "ValidationException":
396
- case "com.amazonaws.internetmonitor#ValidationException":
397
- throw await de_ValidationExceptionRes(parsedOutput, context);
398
- default:
399
- const parsedBody = parsedOutput.body;
400
- return throwDefaultError({
401
- output,
402
- parsedBody,
403
- errorCode,
404
- });
405
- }
406
- };
407
- const de_GetQueryResultsCommand = async (output, context) => {
408
- if (output.statusCode !== 200 && output.statusCode >= 300) {
409
- return de_GetQueryResultsCommandError(output, context);
410
- }
411
- const contents = (0, smithy_client_1.map)({
412
- $metadata: deserializeMetadata(output),
413
- });
414
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
415
- const doc = (0, smithy_client_1.take)(data, {
416
- Data: smithy_client_1._json,
417
- Fields: smithy_client_1._json,
418
- NextToken: smithy_client_1.expectString,
419
- });
420
- Object.assign(contents, doc);
421
- return contents;
422
- };
423
- exports.de_GetQueryResultsCommand = de_GetQueryResultsCommand;
424
- const de_GetQueryResultsCommandError = async (output, context) => {
425
- const parsedOutput = {
426
- ...output,
427
- body: await parseErrorBody(output.body, context),
428
- };
429
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
430
- switch (errorCode) {
431
- case "AccessDeniedException":
432
- case "com.amazonaws.internetmonitor#AccessDeniedException":
433
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
434
- case "InternalServerException":
435
- case "com.amazonaws.internetmonitor#InternalServerException":
436
- throw await de_InternalServerExceptionRes(parsedOutput, context);
437
- case "LimitExceededException":
438
- case "com.amazonaws.internetmonitor#LimitExceededException":
439
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
440
- case "ThrottlingException":
441
- case "com.amazonaws.internetmonitor#ThrottlingException":
442
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
443
- case "ValidationException":
444
- case "com.amazonaws.internetmonitor#ValidationException":
445
- throw await de_ValidationExceptionRes(parsedOutput, context);
446
- default:
447
- const parsedBody = parsedOutput.body;
448
- return throwDefaultError({
449
- output,
450
- parsedBody,
451
- errorCode,
452
- });
453
- }
454
- };
455
- const de_GetQueryStatusCommand = async (output, context) => {
456
- if (output.statusCode !== 200 && output.statusCode >= 300) {
457
- return de_GetQueryStatusCommandError(output, context);
458
- }
459
- const contents = (0, smithy_client_1.map)({
460
- $metadata: deserializeMetadata(output),
461
- });
462
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
463
- const doc = (0, smithy_client_1.take)(data, {
464
- Status: smithy_client_1.expectString,
465
- });
466
- Object.assign(contents, doc);
467
- return contents;
468
- };
469
- exports.de_GetQueryStatusCommand = de_GetQueryStatusCommand;
470
- const de_GetQueryStatusCommandError = async (output, context) => {
471
- const parsedOutput = {
472
- ...output,
473
- body: await parseErrorBody(output.body, context),
474
- };
475
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
476
- switch (errorCode) {
477
- case "AccessDeniedException":
478
- case "com.amazonaws.internetmonitor#AccessDeniedException":
479
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
480
- case "InternalServerException":
481
- case "com.amazonaws.internetmonitor#InternalServerException":
482
- throw await de_InternalServerExceptionRes(parsedOutput, context);
483
- case "LimitExceededException":
484
- case "com.amazonaws.internetmonitor#LimitExceededException":
485
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
486
- case "ThrottlingException":
487
- case "com.amazonaws.internetmonitor#ThrottlingException":
488
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
489
- case "ValidationException":
490
- case "com.amazonaws.internetmonitor#ValidationException":
491
- throw await de_ValidationExceptionRes(parsedOutput, context);
492
- default:
493
- const parsedBody = parsedOutput.body;
494
- return throwDefaultError({
495
- output,
496
- parsedBody,
497
- errorCode,
498
- });
499
- }
500
- };
501
- const de_ListHealthEventsCommand = async (output, context) => {
502
- if (output.statusCode !== 200 && output.statusCode >= 300) {
503
- return de_ListHealthEventsCommandError(output, context);
504
- }
505
- const contents = (0, smithy_client_1.map)({
506
- $metadata: deserializeMetadata(output),
507
- });
508
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
509
- const doc = (0, smithy_client_1.take)(data, {
510
- HealthEvents: (_) => de_HealthEventList(_, context),
511
- NextToken: smithy_client_1.expectString,
512
- });
513
- Object.assign(contents, doc);
514
- return contents;
515
- };
516
- exports.de_ListHealthEventsCommand = de_ListHealthEventsCommand;
517
- const de_ListHealthEventsCommandError = async (output, context) => {
518
- const parsedOutput = {
519
- ...output,
520
- body: await parseErrorBody(output.body, context),
521
- };
522
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
523
- switch (errorCode) {
524
- case "AccessDeniedException":
525
- case "com.amazonaws.internetmonitor#AccessDeniedException":
526
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
527
- case "InternalServerException":
528
- case "com.amazonaws.internetmonitor#InternalServerException":
529
- throw await de_InternalServerExceptionRes(parsedOutput, context);
530
- case "ThrottlingException":
531
- case "com.amazonaws.internetmonitor#ThrottlingException":
532
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
533
- case "ValidationException":
534
- case "com.amazonaws.internetmonitor#ValidationException":
535
- throw await de_ValidationExceptionRes(parsedOutput, context);
536
- default:
537
- const parsedBody = parsedOutput.body;
538
- return throwDefaultError({
539
- output,
540
- parsedBody,
541
- errorCode,
542
- });
543
- }
544
- };
545
- const de_ListMonitorsCommand = async (output, context) => {
546
- if (output.statusCode !== 200 && output.statusCode >= 300) {
547
- return de_ListMonitorsCommandError(output, context);
548
- }
549
- const contents = (0, smithy_client_1.map)({
550
- $metadata: deserializeMetadata(output),
551
- });
552
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
553
- const doc = (0, smithy_client_1.take)(data, {
554
- Monitors: smithy_client_1._json,
555
- NextToken: smithy_client_1.expectString,
556
- });
557
- Object.assign(contents, doc);
558
- return contents;
559
- };
560
- exports.de_ListMonitorsCommand = de_ListMonitorsCommand;
561
- const de_ListMonitorsCommandError = async (output, context) => {
562
- const parsedOutput = {
563
- ...output,
564
- body: await parseErrorBody(output.body, context),
565
- };
566
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
567
- switch (errorCode) {
568
- case "AccessDeniedException":
569
- case "com.amazonaws.internetmonitor#AccessDeniedException":
570
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
571
- case "InternalServerException":
572
- case "com.amazonaws.internetmonitor#InternalServerException":
573
- throw await de_InternalServerExceptionRes(parsedOutput, context);
574
- case "ThrottlingException":
575
- case "com.amazonaws.internetmonitor#ThrottlingException":
576
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
577
- case "ValidationException":
578
- case "com.amazonaws.internetmonitor#ValidationException":
579
- throw await de_ValidationExceptionRes(parsedOutput, context);
580
- default:
581
- const parsedBody = parsedOutput.body;
582
- return throwDefaultError({
583
- output,
584
- parsedBody,
585
- errorCode,
586
- });
587
- }
588
- };
589
- const de_ListTagsForResourceCommand = async (output, context) => {
590
- if (output.statusCode !== 200 && output.statusCode >= 300) {
591
- return de_ListTagsForResourceCommandError(output, context);
592
- }
593
- const contents = (0, smithy_client_1.map)({
594
- $metadata: deserializeMetadata(output),
595
- });
596
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
597
- const doc = (0, smithy_client_1.take)(data, {
598
- Tags: smithy_client_1._json,
599
- });
600
- Object.assign(contents, doc);
601
- return contents;
602
- };
603
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
604
- const de_ListTagsForResourceCommandError = async (output, context) => {
605
- const parsedOutput = {
606
- ...output,
607
- body: await parseErrorBody(output.body, context),
608
- };
609
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
610
- switch (errorCode) {
611
- case "AccessDeniedException":
612
- case "com.amazonaws.internetmonitor#AccessDeniedException":
613
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
614
- case "BadRequestException":
615
- case "com.amazonaws.internetmonitor#BadRequestException":
616
- throw await de_BadRequestExceptionRes(parsedOutput, context);
617
- case "InternalServerErrorException":
618
- case "com.amazonaws.internetmonitor#InternalServerErrorException":
619
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
620
- case "NotFoundException":
621
- case "com.amazonaws.internetmonitor#NotFoundException":
622
- throw await de_NotFoundExceptionRes(parsedOutput, context);
623
- case "TooManyRequestsException":
624
- case "com.amazonaws.internetmonitor#TooManyRequestsException":
625
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
626
- default:
627
- const parsedBody = parsedOutput.body;
628
- return throwDefaultError({
629
- output,
630
- parsedBody,
631
- errorCode,
632
- });
633
- }
634
- };
635
- const de_StartQueryCommand = async (output, context) => {
636
- if (output.statusCode !== 200 && output.statusCode >= 300) {
637
- return de_StartQueryCommandError(output, context);
638
- }
639
- const contents = (0, smithy_client_1.map)({
640
- $metadata: deserializeMetadata(output),
641
- });
642
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
643
- const doc = (0, smithy_client_1.take)(data, {
644
- QueryId: smithy_client_1.expectString,
645
- });
646
- Object.assign(contents, doc);
647
- return contents;
648
- };
649
- exports.de_StartQueryCommand = de_StartQueryCommand;
650
- const de_StartQueryCommandError = async (output, context) => {
651
- const parsedOutput = {
652
- ...output,
653
- body: await parseErrorBody(output.body, context),
654
- };
655
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
656
- switch (errorCode) {
657
- case "AccessDeniedException":
658
- case "com.amazonaws.internetmonitor#AccessDeniedException":
659
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
660
- case "InternalServerException":
661
- case "com.amazonaws.internetmonitor#InternalServerException":
662
- throw await de_InternalServerExceptionRes(parsedOutput, context);
663
- case "LimitExceededException":
664
- case "com.amazonaws.internetmonitor#LimitExceededException":
665
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
666
- case "ThrottlingException":
667
- case "com.amazonaws.internetmonitor#ThrottlingException":
668
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
669
- case "ValidationException":
670
- case "com.amazonaws.internetmonitor#ValidationException":
671
- throw await de_ValidationExceptionRes(parsedOutput, context);
672
- default:
673
- const parsedBody = parsedOutput.body;
674
- return throwDefaultError({
675
- output,
676
- parsedBody,
677
- errorCode,
678
- });
679
- }
680
- };
681
- const de_StopQueryCommand = async (output, context) => {
682
- if (output.statusCode !== 200 && output.statusCode >= 300) {
683
- return de_StopQueryCommandError(output, context);
684
- }
685
- const contents = (0, smithy_client_1.map)({
686
- $metadata: deserializeMetadata(output),
687
- });
688
- await (0, smithy_client_1.collectBody)(output.body, context);
689
- return contents;
690
- };
691
- exports.de_StopQueryCommand = de_StopQueryCommand;
692
- const de_StopQueryCommandError = async (output, context) => {
693
- const parsedOutput = {
694
- ...output,
695
- body: await parseErrorBody(output.body, context),
696
- };
697
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
698
- switch (errorCode) {
699
- case "AccessDeniedException":
700
- case "com.amazonaws.internetmonitor#AccessDeniedException":
701
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
702
- case "InternalServerException":
703
- case "com.amazonaws.internetmonitor#InternalServerException":
704
- throw await de_InternalServerExceptionRes(parsedOutput, context);
705
- case "LimitExceededException":
706
- case "com.amazonaws.internetmonitor#LimitExceededException":
707
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
708
- case "ThrottlingException":
709
- case "com.amazonaws.internetmonitor#ThrottlingException":
710
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
711
- case "ValidationException":
712
- case "com.amazonaws.internetmonitor#ValidationException":
713
- throw await de_ValidationExceptionRes(parsedOutput, context);
714
- default:
715
- const parsedBody = parsedOutput.body;
716
- return throwDefaultError({
717
- output,
718
- parsedBody,
719
- errorCode,
720
- });
721
- }
722
- };
723
- const de_TagResourceCommand = async (output, context) => {
724
- if (output.statusCode !== 204 && output.statusCode >= 300) {
725
- return de_TagResourceCommandError(output, context);
726
- }
727
- const contents = (0, smithy_client_1.map)({
728
- $metadata: deserializeMetadata(output),
729
- });
730
- await (0, smithy_client_1.collectBody)(output.body, context);
731
- return contents;
732
- };
733
- exports.de_TagResourceCommand = de_TagResourceCommand;
734
- const de_TagResourceCommandError = async (output, context) => {
735
- const parsedOutput = {
736
- ...output,
737
- body: await parseErrorBody(output.body, context),
738
- };
739
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
740
- switch (errorCode) {
741
- case "AccessDeniedException":
742
- case "com.amazonaws.internetmonitor#AccessDeniedException":
743
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
744
- case "BadRequestException":
745
- case "com.amazonaws.internetmonitor#BadRequestException":
746
- throw await de_BadRequestExceptionRes(parsedOutput, context);
747
- case "InternalServerErrorException":
748
- case "com.amazonaws.internetmonitor#InternalServerErrorException":
749
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
750
- case "NotFoundException":
751
- case "com.amazonaws.internetmonitor#NotFoundException":
752
- throw await de_NotFoundExceptionRes(parsedOutput, context);
753
- case "TooManyRequestsException":
754
- case "com.amazonaws.internetmonitor#TooManyRequestsException":
755
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
756
- default:
757
- const parsedBody = parsedOutput.body;
758
- return throwDefaultError({
759
- output,
760
- parsedBody,
761
- errorCode,
762
- });
763
- }
764
- };
765
- const de_UntagResourceCommand = async (output, context) => {
766
- if (output.statusCode !== 204 && output.statusCode >= 300) {
767
- return de_UntagResourceCommandError(output, context);
768
- }
769
- const contents = (0, smithy_client_1.map)({
770
- $metadata: deserializeMetadata(output),
771
- });
772
- await (0, smithy_client_1.collectBody)(output.body, context);
773
- return contents;
774
- };
775
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
776
- const de_UntagResourceCommandError = async (output, context) => {
777
- const parsedOutput = {
778
- ...output,
779
- body: await parseErrorBody(output.body, context),
780
- };
781
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
782
- switch (errorCode) {
783
- case "AccessDeniedException":
784
- case "com.amazonaws.internetmonitor#AccessDeniedException":
785
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
786
- case "BadRequestException":
787
- case "com.amazonaws.internetmonitor#BadRequestException":
788
- throw await de_BadRequestExceptionRes(parsedOutput, context);
789
- case "InternalServerErrorException":
790
- case "com.amazonaws.internetmonitor#InternalServerErrorException":
791
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
792
- case "NotFoundException":
793
- case "com.amazonaws.internetmonitor#NotFoundException":
794
- throw await de_NotFoundExceptionRes(parsedOutput, context);
795
- case "TooManyRequestsException":
796
- case "com.amazonaws.internetmonitor#TooManyRequestsException":
797
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
798
- default:
799
- const parsedBody = parsedOutput.body;
800
- return throwDefaultError({
801
- output,
802
- parsedBody,
803
- errorCode,
804
- });
805
- }
806
- };
807
- const de_UpdateMonitorCommand = async (output, context) => {
808
- if (output.statusCode !== 200 && output.statusCode >= 300) {
809
- return de_UpdateMonitorCommandError(output, context);
810
- }
811
- const contents = (0, smithy_client_1.map)({
812
- $metadata: deserializeMetadata(output),
813
- });
814
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
815
- const doc = (0, smithy_client_1.take)(data, {
816
- MonitorArn: smithy_client_1.expectString,
817
- Status: smithy_client_1.expectString,
818
- });
819
- Object.assign(contents, doc);
820
- return contents;
821
- };
822
- exports.de_UpdateMonitorCommand = de_UpdateMonitorCommand;
823
- const de_UpdateMonitorCommandError = async (output, context) => {
824
- const parsedOutput = {
825
- ...output,
826
- body: await parseErrorBody(output.body, context),
827
- };
828
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
829
- switch (errorCode) {
830
- case "AccessDeniedException":
831
- case "com.amazonaws.internetmonitor#AccessDeniedException":
832
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
833
- case "InternalServerException":
834
- case "com.amazonaws.internetmonitor#InternalServerException":
835
- throw await de_InternalServerExceptionRes(parsedOutput, context);
836
- case "LimitExceededException":
837
- case "com.amazonaws.internetmonitor#LimitExceededException":
838
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
839
- case "ResourceNotFoundException":
840
- case "com.amazonaws.internetmonitor#ResourceNotFoundException":
841
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
842
- case "ThrottlingException":
843
- case "com.amazonaws.internetmonitor#ThrottlingException":
844
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
845
- case "ValidationException":
846
- case "com.amazonaws.internetmonitor#ValidationException":
847
- throw await de_ValidationExceptionRes(parsedOutput, context);
848
- default:
849
- const parsedBody = parsedOutput.body;
850
- return throwDefaultError({
851
- output,
852
- parsedBody,
853
- errorCode,
854
- });
855
- }
856
- };
857
- const throwDefaultError = (0, smithy_client_1.withBaseException)(InternetMonitorServiceException_1.InternetMonitorServiceException);
858
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
859
- const contents = (0, smithy_client_1.map)({});
860
- const data = parsedOutput.body;
861
- const doc = (0, smithy_client_1.take)(data, {
862
- message: smithy_client_1.expectString,
863
- });
864
- Object.assign(contents, doc);
865
- const exception = new models_0_1.AccessDeniedException({
866
- $metadata: deserializeMetadata(parsedOutput),
867
- ...contents,
868
- });
869
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
870
- };
871
- const de_BadRequestExceptionRes = async (parsedOutput, context) => {
872
- const contents = (0, smithy_client_1.map)({});
873
- const data = parsedOutput.body;
874
- const doc = (0, smithy_client_1.take)(data, {
875
- message: smithy_client_1.expectString,
876
- });
877
- Object.assign(contents, doc);
878
- const exception = new models_0_1.BadRequestException({
879
- $metadata: deserializeMetadata(parsedOutput),
880
- ...contents,
881
- });
882
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
883
- };
884
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
885
- const contents = (0, smithy_client_1.map)({});
886
- const data = parsedOutput.body;
887
- const doc = (0, smithy_client_1.take)(data, {
888
- message: smithy_client_1.expectString,
889
- });
890
- Object.assign(contents, doc);
891
- const exception = new models_0_1.ConflictException({
892
- $metadata: deserializeMetadata(parsedOutput),
893
- ...contents,
894
- });
895
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
896
- };
897
- const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
898
- const contents = (0, smithy_client_1.map)({});
899
- const data = parsedOutput.body;
900
- const doc = (0, smithy_client_1.take)(data, {
901
- message: smithy_client_1.expectString,
902
- });
903
- Object.assign(contents, doc);
904
- const exception = new models_0_1.InternalServerErrorException({
905
- $metadata: deserializeMetadata(parsedOutput),
906
- ...contents,
907
- });
908
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
909
- };
910
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
911
- const contents = (0, smithy_client_1.map)({});
912
- const data = parsedOutput.body;
913
- const doc = (0, smithy_client_1.take)(data, {
914
- message: smithy_client_1.expectString,
915
- });
916
- Object.assign(contents, doc);
917
- const exception = new models_0_1.InternalServerException({
918
- $metadata: deserializeMetadata(parsedOutput),
919
- ...contents,
920
- });
921
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
922
- };
923
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
924
- const contents = (0, smithy_client_1.map)({});
925
- const data = parsedOutput.body;
926
- const doc = (0, smithy_client_1.take)(data, {
927
- message: smithy_client_1.expectString,
928
- });
929
- Object.assign(contents, doc);
930
- const exception = new models_0_1.LimitExceededException({
931
- $metadata: deserializeMetadata(parsedOutput),
932
- ...contents,
933
- });
934
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
935
- };
936
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
937
- const contents = (0, smithy_client_1.map)({});
938
- const data = parsedOutput.body;
939
- const doc = (0, smithy_client_1.take)(data, {
940
- message: smithy_client_1.expectString,
941
- });
942
- Object.assign(contents, doc);
943
- const exception = new models_0_1.NotFoundException({
944
- $metadata: deserializeMetadata(parsedOutput),
945
- ...contents,
946
- });
947
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
948
- };
949
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
950
- const contents = (0, smithy_client_1.map)({});
951
- const data = parsedOutput.body;
952
- const doc = (0, smithy_client_1.take)(data, {
953
- message: smithy_client_1.expectString,
954
- });
955
- Object.assign(contents, doc);
956
- const exception = new models_0_1.ResourceNotFoundException({
957
- $metadata: deserializeMetadata(parsedOutput),
958
- ...contents,
959
- });
960
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
961
- };
962
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
963
- const contents = (0, smithy_client_1.map)({});
964
- const data = parsedOutput.body;
965
- const doc = (0, smithy_client_1.take)(data, {
966
- message: smithy_client_1.expectString,
967
- });
968
- Object.assign(contents, doc);
969
- const exception = new models_0_1.ThrottlingException({
970
- $metadata: deserializeMetadata(parsedOutput),
971
- ...contents,
972
- });
973
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
974
- };
975
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
976
- const contents = (0, smithy_client_1.map)({});
977
- const data = parsedOutput.body;
978
- const doc = (0, smithy_client_1.take)(data, {
979
- message: smithy_client_1.expectString,
980
- });
981
- Object.assign(contents, doc);
982
- const exception = new models_0_1.TooManyRequestsException({
983
- $metadata: deserializeMetadata(parsedOutput),
984
- ...contents,
985
- });
986
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
987
- };
988
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
989
- const contents = (0, smithy_client_1.map)({});
990
- const data = parsedOutput.body;
991
- const doc = (0, smithy_client_1.take)(data, {
992
- message: smithy_client_1.expectString,
993
- });
994
- Object.assign(contents, doc);
995
- const exception = new models_0_1.ValidationException({
996
- $metadata: deserializeMetadata(parsedOutput),
997
- ...contents,
998
- });
999
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1000
- };
1001
- const se_HealthEventsConfig = (input, context) => {
1002
- return (0, smithy_client_1.take)(input, {
1003
- AvailabilityLocalHealthEventsConfig: (_) => se_LocalHealthEventsConfig(_, context),
1004
- AvailabilityScoreThreshold: smithy_client_1.serializeFloat,
1005
- PerformanceLocalHealthEventsConfig: (_) => se_LocalHealthEventsConfig(_, context),
1006
- PerformanceScoreThreshold: smithy_client_1.serializeFloat,
1007
- });
1008
- };
1009
- const se_LocalHealthEventsConfig = (input, context) => {
1010
- return (0, smithy_client_1.take)(input, {
1011
- HealthScoreThreshold: smithy_client_1.serializeFloat,
1012
- MinTrafficImpact: smithy_client_1.serializeFloat,
1013
- Status: [],
1014
- });
1015
- };
1016
- const de_AvailabilityMeasurement = (output, context) => {
1017
- return (0, smithy_client_1.take)(output, {
1018
- ExperienceScore: smithy_client_1.limitedParseDouble,
1019
- PercentOfClientLocationImpacted: smithy_client_1.limitedParseDouble,
1020
- PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
1021
- });
1022
- };
1023
- const de_HealthEvent = (output, context) => {
1024
- return (0, smithy_client_1.take)(output, {
1025
- CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1026
- EndedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1027
- EventArn: smithy_client_1.expectString,
1028
- EventId: smithy_client_1.expectString,
1029
- HealthScoreThreshold: smithy_client_1.limitedParseDouble,
1030
- ImpactType: smithy_client_1.expectString,
1031
- ImpactedLocations: (_) => de_ImpactedLocationsList(_, context),
1032
- LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1033
- PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
1034
- StartedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1035
- Status: smithy_client_1.expectString,
1036
- });
1037
- };
1038
- const de_HealthEventList = (output, context) => {
1039
- const retVal = (output || [])
1040
- .filter((e) => e != null)
1041
- .map((entry) => {
1042
- return de_HealthEvent(entry, context);
1043
- });
1044
- return retVal;
1045
- };
1046
- const de_HealthEventsConfig = (output, context) => {
1047
- return (0, smithy_client_1.take)(output, {
1048
- AvailabilityLocalHealthEventsConfig: (_) => de_LocalHealthEventsConfig(_, context),
1049
- AvailabilityScoreThreshold: smithy_client_1.limitedParseDouble,
1050
- PerformanceLocalHealthEventsConfig: (_) => de_LocalHealthEventsConfig(_, context),
1051
- PerformanceScoreThreshold: smithy_client_1.limitedParseDouble,
1052
- });
1053
- };
1054
- const de_ImpactedLocation = (output, context) => {
1055
- return (0, smithy_client_1.take)(output, {
1056
- ASName: smithy_client_1.expectString,
1057
- ASNumber: smithy_client_1.expectLong,
1058
- CausedBy: smithy_client_1._json,
1059
- City: smithy_client_1.expectString,
1060
- Country: smithy_client_1.expectString,
1061
- CountryCode: smithy_client_1.expectString,
1062
- InternetHealth: (_) => de_InternetHealth(_, context),
1063
- Latitude: smithy_client_1.limitedParseDouble,
1064
- Longitude: smithy_client_1.limitedParseDouble,
1065
- Metro: smithy_client_1.expectString,
1066
- ServiceLocation: smithy_client_1.expectString,
1067
- Status: smithy_client_1.expectString,
1068
- Subdivision: smithy_client_1.expectString,
1069
- SubdivisionCode: smithy_client_1.expectString,
1070
- });
1071
- };
1072
- const de_ImpactedLocationsList = (output, context) => {
1073
- const retVal = (output || [])
1074
- .filter((e) => e != null)
1075
- .map((entry) => {
1076
- return de_ImpactedLocation(entry, context);
1077
- });
1078
- return retVal;
1079
- };
1080
- const de_InternetHealth = (output, context) => {
1081
- return (0, smithy_client_1.take)(output, {
1082
- Availability: (_) => de_AvailabilityMeasurement(_, context),
1083
- Performance: (_) => de_PerformanceMeasurement(_, context),
1084
- });
1085
- };
1086
- const de_LocalHealthEventsConfig = (output, context) => {
1087
- return (0, smithy_client_1.take)(output, {
1088
- HealthScoreThreshold: smithy_client_1.limitedParseDouble,
1089
- MinTrafficImpact: smithy_client_1.limitedParseDouble,
1090
- Status: smithy_client_1.expectString,
1091
- });
1092
- };
1093
- const de_PerformanceMeasurement = (output, context) => {
1094
- return (0, smithy_client_1.take)(output, {
1095
- ExperienceScore: smithy_client_1.limitedParseDouble,
1096
- PercentOfClientLocationImpacted: smithy_client_1.limitedParseDouble,
1097
- PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
1098
- RoundTripTime: (_) => de_RoundTripTime(_, context),
1099
- });
1100
- };
1101
- const de_RoundTripTime = (output, context) => {
1102
- return (0, smithy_client_1.take)(output, {
1103
- P50: smithy_client_1.limitedParseDouble,
1104
- P90: smithy_client_1.limitedParseDouble,
1105
- P95: smithy_client_1.limitedParseDouble,
1106
- });
1107
- };
1108
- const deserializeMetadata = (output) => ({
1109
- httpStatusCode: output.statusCode,
1110
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1111
- extendedRequestId: output.headers["x-amz-id-2"],
1112
- cfId: output.headers["x-amz-cf-id"],
1113
- });
1114
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1115
- const isSerializableHeaderValue = (value) => value !== undefined &&
1116
- value !== null &&
1117
- value !== "" &&
1118
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1119
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1120
- const _ES = "EventStatus";
1121
- const _ET = "EndTime";
1122
- const _MR = "MaxResults";
1123
- const _MS = "MonitorStatus";
1124
- const _NT = "NextToken";
1125
- const _ST = "StartTime";
1126
- const _TK = "TagKeys";
1127
- const _tK = "tagKeys";
1128
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1129
- if (encoded.length) {
1130
- return JSON.parse(encoded);
1131
- }
1132
- return {};
1133
- });
1134
- const parseErrorBody = async (errorBody, context) => {
1135
- const value = await parseBody(errorBody, context);
1136
- value.message = value.message ?? value.Message;
1137
- return value;
1138
- };
1139
- const loadRestJsonErrorCode = (output, data) => {
1140
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1141
- const sanitizeErrorCode = (rawValue) => {
1142
- let cleanValue = rawValue;
1143
- if (typeof cleanValue === "number") {
1144
- cleanValue = cleanValue.toString();
1145
- }
1146
- if (cleanValue.indexOf(",") >= 0) {
1147
- cleanValue = cleanValue.split(",")[0];
1148
- }
1149
- if (cleanValue.indexOf(":") >= 0) {
1150
- cleanValue = cleanValue.split(":")[0];
1151
- }
1152
- if (cleanValue.indexOf("#") >= 0) {
1153
- cleanValue = cleanValue.split("#")[1];
1154
- }
1155
- return cleanValue;
1156
- };
1157
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1158
- if (headerKey !== undefined) {
1159
- return sanitizeErrorCode(output.headers[headerKey]);
1160
- }
1161
- if (data.code !== undefined) {
1162
- return sanitizeErrorCode(data.code);
1163
- }
1164
- if (data["__type"] !== undefined) {
1165
- return sanitizeErrorCode(data["__type"]);
1166
- }
1167
- };
1
+ module.exports = require("../index.js");