@aws-sdk/client-internetmonitor 3.310.0 → 3.315.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.
@@ -13,16 +13,15 @@ const se_CreateMonitorCommand = async (input, context) => {
13
13
  };
14
14
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
15
15
  let body;
16
- body = JSON.stringify({
17
- ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
18
- ...(input.InternetMeasurementsLogDelivery != null && {
19
- InternetMeasurementsLogDelivery: se_InternetMeasurementsLogDelivery(input.InternetMeasurementsLogDelivery, context),
20
- }),
21
- ...(input.MaxCityNetworksToMonitor != null && { MaxCityNetworksToMonitor: input.MaxCityNetworksToMonitor }),
22
- ...(input.MonitorName != null && { MonitorName: input.MonitorName }),
23
- ...(input.Resources != null && { Resources: se_SetOfARNs(input.Resources, context) }),
24
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
25
- });
16
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
17
+ ClientToken: (_) => _ ?? (0, uuid_1.v4)(),
18
+ InternetMeasurementsLogDelivery: (_) => (0, smithy_client_1._json)(_),
19
+ MaxCityNetworksToMonitor: [],
20
+ MonitorName: [],
21
+ Resources: (_) => (0, smithy_client_1._json)(_),
22
+ Tags: (_) => (0, smithy_client_1._json)(_),
23
+ TrafficPercentageToMonitor: [],
24
+ }));
26
25
  return new protocol_http_1.HttpRequest({
27
26
  protocol,
28
27
  hostname,
@@ -93,7 +92,7 @@ const se_ListHealthEventsCommand = async (input, context) => {
93
92
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
94
93
  "/v20210603/Monitors/{MonitorName}/HealthEvents";
95
94
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
96
- const query = map({
95
+ const query = (0, smithy_client_1.map)({
97
96
  StartTime: [
98
97
  () => input.StartTime !== void 0,
99
98
  () => (input.StartTime.toISOString().split(".")[0] + "Z").toString(),
@@ -120,7 +119,7 @@ const se_ListMonitorsCommand = async (input, context) => {
120
119
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
120
  const headers = {};
122
121
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
123
- const query = map({
122
+ const query = (0, smithy_client_1.map)({
124
123
  NextToken: [, input.NextToken],
125
124
  MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
126
125
  MonitorStatus: [, input.MonitorStatus],
@@ -163,9 +162,9 @@ const se_TagResourceCommand = async (input, context) => {
163
162
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
164
163
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
165
164
  let body;
166
- body = JSON.stringify({
167
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
168
- });
165
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
166
+ Tags: (_) => (0, smithy_client_1._json)(_),
167
+ }));
169
168
  return new protocol_http_1.HttpRequest({
170
169
  protocol,
171
170
  hostname,
@@ -182,7 +181,7 @@ const se_UntagResourceCommand = async (input, context) => {
182
181
  const headers = {};
183
182
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
184
183
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
185
- const query = map({
184
+ const query = (0, smithy_client_1.map)({
186
185
  tagKeys: [
187
186
  (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
188
187
  () => (input.TagKeys || []).map((_entry) => _entry),
@@ -209,16 +208,15 @@ const se_UpdateMonitorCommand = async (input, context) => {
209
208
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
210
209
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
211
210
  let body;
212
- body = JSON.stringify({
213
- ClientToken: input.ClientToken ?? (0, uuid_1.v4)(),
214
- ...(input.InternetMeasurementsLogDelivery != null && {
215
- InternetMeasurementsLogDelivery: se_InternetMeasurementsLogDelivery(input.InternetMeasurementsLogDelivery, context),
216
- }),
217
- ...(input.MaxCityNetworksToMonitor != null && { MaxCityNetworksToMonitor: input.MaxCityNetworksToMonitor }),
218
- ...(input.ResourcesToAdd != null && { ResourcesToAdd: se_SetOfARNs(input.ResourcesToAdd, context) }),
219
- ...(input.ResourcesToRemove != null && { ResourcesToRemove: se_SetOfARNs(input.ResourcesToRemove, context) }),
220
- ...(input.Status != null && { Status: input.Status }),
221
- });
211
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
212
+ ClientToken: (_) => _ ?? (0, uuid_1.v4)(),
213
+ InternetMeasurementsLogDelivery: (_) => (0, smithy_client_1._json)(_),
214
+ MaxCityNetworksToMonitor: [],
215
+ ResourcesToAdd: (_) => (0, smithy_client_1._json)(_),
216
+ ResourcesToRemove: (_) => (0, smithy_client_1._json)(_),
217
+ Status: [],
218
+ TrafficPercentageToMonitor: [],
219
+ }));
222
220
  return new protocol_http_1.HttpRequest({
223
221
  protocol,
224
222
  hostname,
@@ -234,16 +232,15 @@ const de_CreateMonitorCommand = async (output, context) => {
234
232
  if (output.statusCode !== 200 && output.statusCode >= 300) {
235
233
  return de_CreateMonitorCommandError(output, context);
236
234
  }
237
- const contents = map({
235
+ const contents = (0, smithy_client_1.map)({
238
236
  $metadata: deserializeMetadata(output),
239
237
  });
240
238
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
241
- if (data.Arn != null) {
242
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
243
- }
244
- if (data.Status != null) {
245
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
246
- }
239
+ const doc = (0, smithy_client_1.take)(data, {
240
+ Arn: smithy_client_1.expectString,
241
+ Status: smithy_client_1.expectString,
242
+ });
243
+ Object.assign(contents, doc);
247
244
  return contents;
248
245
  };
249
246
  exports.de_CreateMonitorCommand = de_CreateMonitorCommand;
@@ -274,10 +271,9 @@ const de_CreateMonitorCommandError = async (output, context) => {
274
271
  throw await de_ValidationExceptionRes(parsedOutput, context);
275
272
  default:
276
273
  const parsedBody = parsedOutput.body;
277
- (0, smithy_client_1.throwDefaultError)({
274
+ return throwDefaultError({
278
275
  output,
279
276
  parsedBody,
280
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
281
277
  errorCode,
282
278
  });
283
279
  }
@@ -286,7 +282,7 @@ const de_DeleteMonitorCommand = async (output, context) => {
286
282
  if (output.statusCode !== 200 && output.statusCode >= 300) {
287
283
  return de_DeleteMonitorCommandError(output, context);
288
284
  }
289
- const contents = map({
285
+ const contents = (0, smithy_client_1.map)({
290
286
  $metadata: deserializeMetadata(output),
291
287
  });
292
288
  await collectBody(output.body, context);
@@ -314,10 +310,9 @@ const de_DeleteMonitorCommandError = async (output, context) => {
314
310
  throw await de_ValidationExceptionRes(parsedOutput, context);
315
311
  default:
316
312
  const parsedBody = parsedOutput.body;
317
- (0, smithy_client_1.throwDefaultError)({
313
+ return throwDefaultError({
318
314
  output,
319
315
  parsedBody,
320
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
321
316
  errorCode,
322
317
  });
323
318
  }
@@ -326,40 +321,23 @@ const de_GetHealthEventCommand = async (output, context) => {
326
321
  if (output.statusCode !== 200 && output.statusCode >= 300) {
327
322
  return de_GetHealthEventCommandError(output, context);
328
323
  }
329
- const contents = map({
324
+ const contents = (0, smithy_client_1.map)({
330
325
  $metadata: deserializeMetadata(output),
331
326
  });
332
327
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
333
- if (data.CreatedAt != null) {
334
- contents.CreatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.CreatedAt));
335
- }
336
- if (data.EndedAt != null) {
337
- contents.EndedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.EndedAt));
338
- }
339
- if (data.EventArn != null) {
340
- contents.EventArn = (0, smithy_client_1.expectString)(data.EventArn);
341
- }
342
- if (data.EventId != null) {
343
- contents.EventId = (0, smithy_client_1.expectString)(data.EventId);
344
- }
345
- if (data.ImpactType != null) {
346
- contents.ImpactType = (0, smithy_client_1.expectString)(data.ImpactType);
347
- }
348
- if (data.ImpactedLocations != null) {
349
- contents.ImpactedLocations = de_ImpactedLocationsList(data.ImpactedLocations, context);
350
- }
351
- if (data.LastUpdatedAt != null) {
352
- contents.LastUpdatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.LastUpdatedAt));
353
- }
354
- if (data.PercentOfTotalTrafficImpacted != null) {
355
- contents.PercentOfTotalTrafficImpacted = (0, smithy_client_1.limitedParseDouble)(data.PercentOfTotalTrafficImpacted);
356
- }
357
- if (data.StartedAt != null) {
358
- contents.StartedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.StartedAt));
359
- }
360
- if (data.Status != null) {
361
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
362
- }
328
+ const doc = (0, smithy_client_1.take)(data, {
329
+ CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
330
+ EndedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
331
+ EventArn: smithy_client_1.expectString,
332
+ EventId: smithy_client_1.expectString,
333
+ ImpactType: smithy_client_1.expectString,
334
+ ImpactedLocations: (_) => de_ImpactedLocationsList(_, context),
335
+ LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
336
+ PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
337
+ StartedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
338
+ Status: smithy_client_1.expectString,
339
+ });
340
+ Object.assign(contents, doc);
363
341
  return contents;
364
342
  };
365
343
  exports.de_GetHealthEventCommand = de_GetHealthEventCommand;
@@ -384,10 +362,9 @@ const de_GetHealthEventCommandError = async (output, context) => {
384
362
  throw await de_ValidationExceptionRes(parsedOutput, context);
385
363
  default:
386
364
  const parsedBody = parsedOutput.body;
387
- (0, smithy_client_1.throwDefaultError)({
365
+ return throwDefaultError({
388
366
  output,
389
367
  parsedBody,
390
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
391
368
  errorCode,
392
369
  });
393
370
  }
@@ -396,43 +373,25 @@ const de_GetMonitorCommand = async (output, context) => {
396
373
  if (output.statusCode !== 200 && output.statusCode >= 300) {
397
374
  return de_GetMonitorCommandError(output, context);
398
375
  }
399
- const contents = map({
376
+ const contents = (0, smithy_client_1.map)({
400
377
  $metadata: deserializeMetadata(output),
401
378
  });
402
379
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
403
- if (data.CreatedAt != null) {
404
- contents.CreatedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.CreatedAt));
405
- }
406
- if (data.InternetMeasurementsLogDelivery != null) {
407
- contents.InternetMeasurementsLogDelivery = de_InternetMeasurementsLogDelivery(data.InternetMeasurementsLogDelivery, context);
408
- }
409
- if (data.MaxCityNetworksToMonitor != null) {
410
- contents.MaxCityNetworksToMonitor = (0, smithy_client_1.expectInt32)(data.MaxCityNetworksToMonitor);
411
- }
412
- if (data.ModifiedAt != null) {
413
- contents.ModifiedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.ModifiedAt));
414
- }
415
- if (data.MonitorArn != null) {
416
- contents.MonitorArn = (0, smithy_client_1.expectString)(data.MonitorArn);
417
- }
418
- if (data.MonitorName != null) {
419
- contents.MonitorName = (0, smithy_client_1.expectString)(data.MonitorName);
420
- }
421
- if (data.ProcessingStatus != null) {
422
- contents.ProcessingStatus = (0, smithy_client_1.expectString)(data.ProcessingStatus);
423
- }
424
- if (data.ProcessingStatusInfo != null) {
425
- contents.ProcessingStatusInfo = (0, smithy_client_1.expectString)(data.ProcessingStatusInfo);
426
- }
427
- if (data.Resources != null) {
428
- contents.Resources = de_SetOfARNs(data.Resources, context);
429
- }
430
- if (data.Status != null) {
431
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
432
- }
433
- if (data.Tags != null) {
434
- contents.Tags = de_TagMap(data.Tags, context);
435
- }
380
+ const doc = (0, smithy_client_1.take)(data, {
381
+ CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
382
+ InternetMeasurementsLogDelivery: smithy_client_1._json,
383
+ MaxCityNetworksToMonitor: smithy_client_1.expectInt32,
384
+ ModifiedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
385
+ MonitorArn: smithy_client_1.expectString,
386
+ MonitorName: smithy_client_1.expectString,
387
+ ProcessingStatus: smithy_client_1.expectString,
388
+ ProcessingStatusInfo: smithy_client_1.expectString,
389
+ Resources: smithy_client_1._json,
390
+ Status: smithy_client_1.expectString,
391
+ Tags: smithy_client_1._json,
392
+ TrafficPercentageToMonitor: smithy_client_1.expectInt32,
393
+ });
394
+ Object.assign(contents, doc);
436
395
  return contents;
437
396
  };
438
397
  exports.de_GetMonitorCommand = de_GetMonitorCommand;
@@ -457,10 +416,9 @@ const de_GetMonitorCommandError = async (output, context) => {
457
416
  throw await de_ValidationExceptionRes(parsedOutput, context);
458
417
  default:
459
418
  const parsedBody = parsedOutput.body;
460
- (0, smithy_client_1.throwDefaultError)({
419
+ return throwDefaultError({
461
420
  output,
462
421
  parsedBody,
463
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
464
422
  errorCode,
465
423
  });
466
424
  }
@@ -469,16 +427,15 @@ const de_ListHealthEventsCommand = async (output, context) => {
469
427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
470
428
  return de_ListHealthEventsCommandError(output, context);
471
429
  }
472
- const contents = map({
430
+ const contents = (0, smithy_client_1.map)({
473
431
  $metadata: deserializeMetadata(output),
474
432
  });
475
433
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
476
- if (data.HealthEvents != null) {
477
- contents.HealthEvents = de_HealthEventList(data.HealthEvents, context);
478
- }
479
- if (data.NextToken != null) {
480
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
481
- }
434
+ const doc = (0, smithy_client_1.take)(data, {
435
+ HealthEvents: (_) => de_HealthEventList(_, context),
436
+ NextToken: smithy_client_1.expectString,
437
+ });
438
+ Object.assign(contents, doc);
482
439
  return contents;
483
440
  };
484
441
  exports.de_ListHealthEventsCommand = de_ListHealthEventsCommand;
@@ -503,10 +460,9 @@ const de_ListHealthEventsCommandError = async (output, context) => {
503
460
  throw await de_ValidationExceptionRes(parsedOutput, context);
504
461
  default:
505
462
  const parsedBody = parsedOutput.body;
506
- (0, smithy_client_1.throwDefaultError)({
463
+ return throwDefaultError({
507
464
  output,
508
465
  parsedBody,
509
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
510
466
  errorCode,
511
467
  });
512
468
  }
@@ -515,16 +471,15 @@ const de_ListMonitorsCommand = async (output, context) => {
515
471
  if (output.statusCode !== 200 && output.statusCode >= 300) {
516
472
  return de_ListMonitorsCommandError(output, context);
517
473
  }
518
- const contents = map({
474
+ const contents = (0, smithy_client_1.map)({
519
475
  $metadata: deserializeMetadata(output),
520
476
  });
521
477
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
522
- if (data.Monitors != null) {
523
- contents.Monitors = de_MonitorList(data.Monitors, context);
524
- }
525
- if (data.NextToken != null) {
526
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
527
- }
478
+ const doc = (0, smithy_client_1.take)(data, {
479
+ Monitors: smithy_client_1._json,
480
+ NextToken: smithy_client_1.expectString,
481
+ });
482
+ Object.assign(contents, doc);
528
483
  return contents;
529
484
  };
530
485
  exports.de_ListMonitorsCommand = de_ListMonitorsCommand;
@@ -549,10 +504,9 @@ const de_ListMonitorsCommandError = async (output, context) => {
549
504
  throw await de_ValidationExceptionRes(parsedOutput, context);
550
505
  default:
551
506
  const parsedBody = parsedOutput.body;
552
- (0, smithy_client_1.throwDefaultError)({
507
+ return throwDefaultError({
553
508
  output,
554
509
  parsedBody,
555
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
556
510
  errorCode,
557
511
  });
558
512
  }
@@ -561,13 +515,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
561
515
  if (output.statusCode !== 200 && output.statusCode >= 300) {
562
516
  return de_ListTagsForResourceCommandError(output, context);
563
517
  }
564
- const contents = map({
518
+ const contents = (0, smithy_client_1.map)({
565
519
  $metadata: deserializeMetadata(output),
566
520
  });
567
521
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
568
- if (data.Tags != null) {
569
- contents.Tags = de_TagMap(data.Tags, context);
570
- }
522
+ const doc = (0, smithy_client_1.take)(data, {
523
+ Tags: smithy_client_1._json,
524
+ });
525
+ Object.assign(contents, doc);
571
526
  return contents;
572
527
  };
573
528
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -595,10 +550,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
595
550
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
596
551
  default:
597
552
  const parsedBody = parsedOutput.body;
598
- (0, smithy_client_1.throwDefaultError)({
553
+ return throwDefaultError({
599
554
  output,
600
555
  parsedBody,
601
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
602
556
  errorCode,
603
557
  });
604
558
  }
@@ -607,7 +561,7 @@ const de_TagResourceCommand = async (output, context) => {
607
561
  if (output.statusCode !== 204 && output.statusCode >= 300) {
608
562
  return de_TagResourceCommandError(output, context);
609
563
  }
610
- const contents = map({
564
+ const contents = (0, smithy_client_1.map)({
611
565
  $metadata: deserializeMetadata(output),
612
566
  });
613
567
  await collectBody(output.body, context);
@@ -638,10 +592,9 @@ const de_TagResourceCommandError = async (output, context) => {
638
592
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
639
593
  default:
640
594
  const parsedBody = parsedOutput.body;
641
- (0, smithy_client_1.throwDefaultError)({
595
+ return throwDefaultError({
642
596
  output,
643
597
  parsedBody,
644
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
645
598
  errorCode,
646
599
  });
647
600
  }
@@ -650,7 +603,7 @@ const de_UntagResourceCommand = async (output, context) => {
650
603
  if (output.statusCode !== 204 && output.statusCode >= 300) {
651
604
  return de_UntagResourceCommandError(output, context);
652
605
  }
653
- const contents = map({
606
+ const contents = (0, smithy_client_1.map)({
654
607
  $metadata: deserializeMetadata(output),
655
608
  });
656
609
  await collectBody(output.body, context);
@@ -681,10 +634,9 @@ const de_UntagResourceCommandError = async (output, context) => {
681
634
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
682
635
  default:
683
636
  const parsedBody = parsedOutput.body;
684
- (0, smithy_client_1.throwDefaultError)({
637
+ return throwDefaultError({
685
638
  output,
686
639
  parsedBody,
687
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
688
640
  errorCode,
689
641
  });
690
642
  }
@@ -693,16 +645,15 @@ const de_UpdateMonitorCommand = async (output, context) => {
693
645
  if (output.statusCode !== 200 && output.statusCode >= 300) {
694
646
  return de_UpdateMonitorCommandError(output, context);
695
647
  }
696
- const contents = map({
648
+ const contents = (0, smithy_client_1.map)({
697
649
  $metadata: deserializeMetadata(output),
698
650
  });
699
651
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
700
- if (data.MonitorArn != null) {
701
- contents.MonitorArn = (0, smithy_client_1.expectString)(data.MonitorArn);
702
- }
703
- if (data.Status != null) {
704
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
705
- }
652
+ const doc = (0, smithy_client_1.take)(data, {
653
+ MonitorArn: smithy_client_1.expectString,
654
+ Status: smithy_client_1.expectString,
655
+ });
656
+ Object.assign(contents, doc);
706
657
  return contents;
707
658
  };
708
659
  exports.de_UpdateMonitorCommand = de_UpdateMonitorCommand;
@@ -733,21 +684,21 @@ const de_UpdateMonitorCommandError = async (output, context) => {
733
684
  throw await de_ValidationExceptionRes(parsedOutput, context);
734
685
  default:
735
686
  const parsedBody = parsedOutput.body;
736
- (0, smithy_client_1.throwDefaultError)({
687
+ return throwDefaultError({
737
688
  output,
738
689
  parsedBody,
739
- exceptionCtor: InternetMonitorServiceException_1.InternetMonitorServiceException,
740
690
  errorCode,
741
691
  });
742
692
  }
743
693
  };
744
- const map = smithy_client_1.map;
694
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(InternetMonitorServiceException_1.InternetMonitorServiceException);
745
695
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
746
- const contents = map({});
696
+ const contents = (0, smithy_client_1.map)({});
747
697
  const data = parsedOutput.body;
748
- if (data.message != null) {
749
- contents.message = (0, smithy_client_1.expectString)(data.message);
750
- }
698
+ const doc = (0, smithy_client_1.take)(data, {
699
+ message: smithy_client_1.expectString,
700
+ });
701
+ Object.assign(contents, doc);
751
702
  const exception = new models_0_1.AccessDeniedException({
752
703
  $metadata: deserializeMetadata(parsedOutput),
753
704
  ...contents,
@@ -755,11 +706,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
755
706
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
756
707
  };
757
708
  const de_BadRequestExceptionRes = async (parsedOutput, context) => {
758
- const contents = map({});
709
+ const contents = (0, smithy_client_1.map)({});
759
710
  const data = parsedOutput.body;
760
- if (data.message != null) {
761
- contents.message = (0, smithy_client_1.expectString)(data.message);
762
- }
711
+ const doc = (0, smithy_client_1.take)(data, {
712
+ message: smithy_client_1.expectString,
713
+ });
714
+ Object.assign(contents, doc);
763
715
  const exception = new models_0_1.BadRequestException({
764
716
  $metadata: deserializeMetadata(parsedOutput),
765
717
  ...contents,
@@ -767,11 +719,12 @@ const de_BadRequestExceptionRes = async (parsedOutput, context) => {
767
719
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
768
720
  };
769
721
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
770
- const contents = map({});
722
+ const contents = (0, smithy_client_1.map)({});
771
723
  const data = parsedOutput.body;
772
- if (data.message != null) {
773
- contents.message = (0, smithy_client_1.expectString)(data.message);
774
- }
724
+ const doc = (0, smithy_client_1.take)(data, {
725
+ message: smithy_client_1.expectString,
726
+ });
727
+ Object.assign(contents, doc);
775
728
  const exception = new models_0_1.ConflictException({
776
729
  $metadata: deserializeMetadata(parsedOutput),
777
730
  ...contents,
@@ -779,11 +732,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
779
732
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
780
733
  };
781
734
  const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
782
- const contents = map({});
735
+ const contents = (0, smithy_client_1.map)({});
783
736
  const data = parsedOutput.body;
784
- if (data.message != null) {
785
- contents.message = (0, smithy_client_1.expectString)(data.message);
786
- }
737
+ const doc = (0, smithy_client_1.take)(data, {
738
+ message: smithy_client_1.expectString,
739
+ });
740
+ Object.assign(contents, doc);
787
741
  const exception = new models_0_1.InternalServerErrorException({
788
742
  $metadata: deserializeMetadata(parsedOutput),
789
743
  ...contents,
@@ -791,11 +745,12 @@ const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
791
745
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
792
746
  };
793
747
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
794
- const contents = map({});
748
+ const contents = (0, smithy_client_1.map)({});
795
749
  const data = parsedOutput.body;
796
- if (data.message != null) {
797
- contents.message = (0, smithy_client_1.expectString)(data.message);
798
- }
750
+ const doc = (0, smithy_client_1.take)(data, {
751
+ message: smithy_client_1.expectString,
752
+ });
753
+ Object.assign(contents, doc);
799
754
  const exception = new models_0_1.InternalServerException({
800
755
  $metadata: deserializeMetadata(parsedOutput),
801
756
  ...contents,
@@ -803,11 +758,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
803
758
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
804
759
  };
805
760
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
806
- const contents = map({});
761
+ const contents = (0, smithy_client_1.map)({});
807
762
  const data = parsedOutput.body;
808
- if (data.message != null) {
809
- contents.message = (0, smithy_client_1.expectString)(data.message);
810
- }
763
+ const doc = (0, smithy_client_1.take)(data, {
764
+ message: smithy_client_1.expectString,
765
+ });
766
+ Object.assign(contents, doc);
811
767
  const exception = new models_0_1.LimitExceededException({
812
768
  $metadata: deserializeMetadata(parsedOutput),
813
769
  ...contents,
@@ -815,11 +771,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
815
771
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
816
772
  };
817
773
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
818
- const contents = map({});
774
+ const contents = (0, smithy_client_1.map)({});
819
775
  const data = parsedOutput.body;
820
- if (data.message != null) {
821
- contents.message = (0, smithy_client_1.expectString)(data.message);
822
- }
776
+ const doc = (0, smithy_client_1.take)(data, {
777
+ message: smithy_client_1.expectString,
778
+ });
779
+ Object.assign(contents, doc);
823
780
  const exception = new models_0_1.NotFoundException({
824
781
  $metadata: deserializeMetadata(parsedOutput),
825
782
  ...contents,
@@ -827,11 +784,12 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
827
784
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
828
785
  };
829
786
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
830
- const contents = map({});
787
+ const contents = (0, smithy_client_1.map)({});
831
788
  const data = parsedOutput.body;
832
- if (data.message != null) {
833
- contents.message = (0, smithy_client_1.expectString)(data.message);
834
- }
789
+ const doc = (0, smithy_client_1.take)(data, {
790
+ message: smithy_client_1.expectString,
791
+ });
792
+ Object.assign(contents, doc);
835
793
  const exception = new models_0_1.ResourceNotFoundException({
836
794
  $metadata: deserializeMetadata(parsedOutput),
837
795
  ...contents,
@@ -839,11 +797,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
839
797
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
840
798
  };
841
799
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
842
- const contents = map({});
800
+ const contents = (0, smithy_client_1.map)({});
843
801
  const data = parsedOutput.body;
844
- if (data.message != null) {
845
- contents.message = (0, smithy_client_1.expectString)(data.message);
846
- }
802
+ const doc = (0, smithy_client_1.take)(data, {
803
+ message: smithy_client_1.expectString,
804
+ });
805
+ Object.assign(contents, doc);
847
806
  const exception = new models_0_1.ThrottlingException({
848
807
  $metadata: deserializeMetadata(parsedOutput),
849
808
  ...contents,
@@ -851,11 +810,12 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
851
810
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
852
811
  };
853
812
  const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
854
- const contents = map({});
813
+ const contents = (0, smithy_client_1.map)({});
855
814
  const data = parsedOutput.body;
856
- if (data.message != null) {
857
- contents.message = (0, smithy_client_1.expectString)(data.message);
858
- }
815
+ const doc = (0, smithy_client_1.take)(data, {
816
+ message: smithy_client_1.expectString,
817
+ });
818
+ Object.assign(contents, doc);
859
819
  const exception = new models_0_1.TooManyRequestsException({
860
820
  $metadata: deserializeMetadata(parsedOutput),
861
821
  ...contents,
@@ -863,203 +823,93 @@ const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
863
823
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
864
824
  };
865
825
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
866
- const contents = map({});
826
+ const contents = (0, smithy_client_1.map)({});
867
827
  const data = parsedOutput.body;
868
- if (data.message != null) {
869
- contents.message = (0, smithy_client_1.expectString)(data.message);
870
- }
828
+ const doc = (0, smithy_client_1.take)(data, {
829
+ message: smithy_client_1.expectString,
830
+ });
831
+ Object.assign(contents, doc);
871
832
  const exception = new models_0_1.ValidationException({
872
833
  $metadata: deserializeMetadata(parsedOutput),
873
834
  ...contents,
874
835
  });
875
836
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
876
837
  };
877
- const se_InternetMeasurementsLogDelivery = (input, context) => {
878
- return {
879
- ...(input.S3Config != null && { S3Config: se_S3Config(input.S3Config, context) }),
880
- };
881
- };
882
- const se_S3Config = (input, context) => {
883
- return {
884
- ...(input.BucketName != null && { BucketName: input.BucketName }),
885
- ...(input.BucketPrefix != null && { BucketPrefix: input.BucketPrefix }),
886
- ...(input.LogDeliveryStatus != null && { LogDeliveryStatus: input.LogDeliveryStatus }),
887
- };
888
- };
889
- const se_SetOfARNs = (input, context) => {
890
- return input
891
- .filter((e) => e != null)
892
- .map((entry) => {
893
- return entry;
894
- });
895
- };
896
- const se_TagMap = (input, context) => {
897
- return Object.entries(input).reduce((acc, [key, value]) => {
898
- if (value === null) {
899
- return acc;
900
- }
901
- acc[key] = value;
902
- return acc;
903
- }, {});
904
- };
905
838
  const de_AvailabilityMeasurement = (output, context) => {
906
- return {
907
- ExperienceScore: (0, smithy_client_1.limitedParseDouble)(output.ExperienceScore),
908
- PercentOfClientLocationImpacted: (0, smithy_client_1.limitedParseDouble)(output.PercentOfClientLocationImpacted),
909
- PercentOfTotalTrafficImpacted: (0, smithy_client_1.limitedParseDouble)(output.PercentOfTotalTrafficImpacted),
910
- };
839
+ return (0, smithy_client_1.take)(output, {
840
+ ExperienceScore: smithy_client_1.limitedParseDouble,
841
+ PercentOfClientLocationImpacted: smithy_client_1.limitedParseDouble,
842
+ PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
843
+ });
911
844
  };
912
845
  const de_HealthEvent = (output, context) => {
913
- return {
914
- CreatedAt: output.CreatedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.CreatedAt)) : undefined,
915
- EndedAt: output.EndedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.EndedAt)) : undefined,
916
- EventArn: (0, smithy_client_1.expectString)(output.EventArn),
917
- EventId: (0, smithy_client_1.expectString)(output.EventId),
918
- ImpactType: (0, smithy_client_1.expectString)(output.ImpactType),
919
- ImpactedLocations: output.ImpactedLocations != null ? de_ImpactedLocationsList(output.ImpactedLocations, context) : undefined,
920
- LastUpdatedAt: output.LastUpdatedAt != null
921
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.LastUpdatedAt))
922
- : undefined,
923
- PercentOfTotalTrafficImpacted: (0, smithy_client_1.limitedParseDouble)(output.PercentOfTotalTrafficImpacted),
924
- StartedAt: output.StartedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.StartedAt)) : undefined,
925
- Status: (0, smithy_client_1.expectString)(output.Status),
926
- };
846
+ return (0, smithy_client_1.take)(output, {
847
+ CreatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
848
+ EndedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
849
+ EventArn: smithy_client_1.expectString,
850
+ EventId: smithy_client_1.expectString,
851
+ ImpactType: smithy_client_1.expectString,
852
+ ImpactedLocations: (_) => de_ImpactedLocationsList(_, context),
853
+ LastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
854
+ PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
855
+ StartedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
856
+ Status: smithy_client_1.expectString,
857
+ });
927
858
  };
928
859
  const de_HealthEventList = (output, context) => {
929
860
  const retVal = (output || [])
930
861
  .filter((e) => e != null)
931
862
  .map((entry) => {
932
- if (entry === null) {
933
- return null;
934
- }
935
863
  return de_HealthEvent(entry, context);
936
864
  });
937
865
  return retVal;
938
866
  };
939
867
  const de_ImpactedLocation = (output, context) => {
940
- return {
941
- ASName: (0, smithy_client_1.expectString)(output.ASName),
942
- ASNumber: (0, smithy_client_1.expectLong)(output.ASNumber),
943
- CausedBy: output.CausedBy != null ? de_NetworkImpairment(output.CausedBy, context) : undefined,
944
- City: (0, smithy_client_1.expectString)(output.City),
945
- Country: (0, smithy_client_1.expectString)(output.Country),
946
- CountryCode: (0, smithy_client_1.expectString)(output.CountryCode),
947
- InternetHealth: output.InternetHealth != null ? de_InternetHealth(output.InternetHealth, context) : undefined,
948
- Latitude: (0, smithy_client_1.limitedParseDouble)(output.Latitude),
949
- Longitude: (0, smithy_client_1.limitedParseDouble)(output.Longitude),
950
- Metro: (0, smithy_client_1.expectString)(output.Metro),
951
- ServiceLocation: (0, smithy_client_1.expectString)(output.ServiceLocation),
952
- Status: (0, smithy_client_1.expectString)(output.Status),
953
- Subdivision: (0, smithy_client_1.expectString)(output.Subdivision),
954
- SubdivisionCode: (0, smithy_client_1.expectString)(output.SubdivisionCode),
955
- };
868
+ return (0, smithy_client_1.take)(output, {
869
+ ASName: smithy_client_1.expectString,
870
+ ASNumber: smithy_client_1.expectLong,
871
+ CausedBy: smithy_client_1._json,
872
+ City: smithy_client_1.expectString,
873
+ Country: smithy_client_1.expectString,
874
+ CountryCode: smithy_client_1.expectString,
875
+ InternetHealth: (_) => de_InternetHealth(_, context),
876
+ Latitude: smithy_client_1.limitedParseDouble,
877
+ Longitude: smithy_client_1.limitedParseDouble,
878
+ Metro: smithy_client_1.expectString,
879
+ ServiceLocation: smithy_client_1.expectString,
880
+ Status: smithy_client_1.expectString,
881
+ Subdivision: smithy_client_1.expectString,
882
+ SubdivisionCode: smithy_client_1.expectString,
883
+ });
956
884
  };
957
885
  const de_ImpactedLocationsList = (output, context) => {
958
886
  const retVal = (output || [])
959
887
  .filter((e) => e != null)
960
888
  .map((entry) => {
961
- if (entry === null) {
962
- return null;
963
- }
964
889
  return de_ImpactedLocation(entry, context);
965
890
  });
966
891
  return retVal;
967
892
  };
968
893
  const de_InternetHealth = (output, context) => {
969
- return {
970
- Availability: output.Availability != null ? de_AvailabilityMeasurement(output.Availability, context) : undefined,
971
- Performance: output.Performance != null ? de_PerformanceMeasurement(output.Performance, context) : undefined,
972
- };
973
- };
974
- const de_InternetMeasurementsLogDelivery = (output, context) => {
975
- return {
976
- S3Config: output.S3Config != null ? de_S3Config(output.S3Config, context) : undefined,
977
- };
978
- };
979
- const de_Monitor = (output, context) => {
980
- return {
981
- MonitorArn: (0, smithy_client_1.expectString)(output.MonitorArn),
982
- MonitorName: (0, smithy_client_1.expectString)(output.MonitorName),
983
- ProcessingStatus: (0, smithy_client_1.expectString)(output.ProcessingStatus),
984
- Status: (0, smithy_client_1.expectString)(output.Status),
985
- };
986
- };
987
- const de_MonitorList = (output, context) => {
988
- const retVal = (output || [])
989
- .filter((e) => e != null)
990
- .map((entry) => {
991
- if (entry === null) {
992
- return null;
993
- }
994
- return de_Monitor(entry, context);
995
- });
996
- return retVal;
997
- };
998
- const de_Network = (output, context) => {
999
- return {
1000
- ASName: (0, smithy_client_1.expectString)(output.ASName),
1001
- ASNumber: (0, smithy_client_1.expectLong)(output.ASNumber),
1002
- };
1003
- };
1004
- const de_NetworkImpairment = (output, context) => {
1005
- return {
1006
- AsPath: output.AsPath != null ? de_NetworkList(output.AsPath, context) : undefined,
1007
- NetworkEventType: (0, smithy_client_1.expectString)(output.NetworkEventType),
1008
- Networks: output.Networks != null ? de_NetworkList(output.Networks, context) : undefined,
1009
- };
1010
- };
1011
- const de_NetworkList = (output, context) => {
1012
- const retVal = (output || [])
1013
- .filter((e) => e != null)
1014
- .map((entry) => {
1015
- if (entry === null) {
1016
- return null;
1017
- }
1018
- return de_Network(entry, context);
894
+ return (0, smithy_client_1.take)(output, {
895
+ Availability: (_) => de_AvailabilityMeasurement(_, context),
896
+ Performance: (_) => de_PerformanceMeasurement(_, context),
1019
897
  });
1020
- return retVal;
1021
898
  };
1022
899
  const de_PerformanceMeasurement = (output, context) => {
1023
- return {
1024
- ExperienceScore: (0, smithy_client_1.limitedParseDouble)(output.ExperienceScore),
1025
- PercentOfClientLocationImpacted: (0, smithy_client_1.limitedParseDouble)(output.PercentOfClientLocationImpacted),
1026
- PercentOfTotalTrafficImpacted: (0, smithy_client_1.limitedParseDouble)(output.PercentOfTotalTrafficImpacted),
1027
- RoundTripTime: output.RoundTripTime != null ? de_RoundTripTime(output.RoundTripTime, context) : undefined,
1028
- };
900
+ return (0, smithy_client_1.take)(output, {
901
+ ExperienceScore: smithy_client_1.limitedParseDouble,
902
+ PercentOfClientLocationImpacted: smithy_client_1.limitedParseDouble,
903
+ PercentOfTotalTrafficImpacted: smithy_client_1.limitedParseDouble,
904
+ RoundTripTime: (_) => de_RoundTripTime(_, context),
905
+ });
1029
906
  };
1030
907
  const de_RoundTripTime = (output, context) => {
1031
- return {
1032
- P50: (0, smithy_client_1.limitedParseDouble)(output.P50),
1033
- P90: (0, smithy_client_1.limitedParseDouble)(output.P90),
1034
- P95: (0, smithy_client_1.limitedParseDouble)(output.P95),
1035
- };
1036
- };
1037
- const de_S3Config = (output, context) => {
1038
- return {
1039
- BucketName: (0, smithy_client_1.expectString)(output.BucketName),
1040
- BucketPrefix: (0, smithy_client_1.expectString)(output.BucketPrefix),
1041
- LogDeliveryStatus: (0, smithy_client_1.expectString)(output.LogDeliveryStatus),
1042
- };
1043
- };
1044
- const de_SetOfARNs = (output, context) => {
1045
- const retVal = (output || [])
1046
- .filter((e) => e != null)
1047
- .map((entry) => {
1048
- if (entry === null) {
1049
- return null;
1050
- }
1051
- return (0, smithy_client_1.expectString)(entry);
908
+ return (0, smithy_client_1.take)(output, {
909
+ P50: smithy_client_1.limitedParseDouble,
910
+ P90: smithy_client_1.limitedParseDouble,
911
+ P95: smithy_client_1.limitedParseDouble,
1052
912
  });
1053
- return retVal;
1054
- };
1055
- const de_TagMap = (output, context) => {
1056
- return Object.entries(output).reduce((acc, [key, value]) => {
1057
- if (value === null) {
1058
- return acc;
1059
- }
1060
- acc[key] = (0, smithy_client_1.expectString)(value);
1061
- return acc;
1062
- }, {});
1063
913
  };
1064
914
  const deserializeMetadata = (output) => ({
1065
915
  httpStatusCode: output.statusCode,