@aws-sdk/client-amp 3.920.0 → 3.921.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 (47) hide show
  1. package/README.md +40 -0
  2. package/dist-cjs/index.js +452 -0
  3. package/dist-es/Amp.js +10 -0
  4. package/dist-es/commands/CreateAnomalyDetectorCommand.js +22 -0
  5. package/dist-es/commands/DeleteAnomalyDetectorCommand.js +22 -0
  6. package/dist-es/commands/DescribeAnomalyDetectorCommand.js +22 -0
  7. package/dist-es/commands/ListAnomalyDetectorsCommand.js +22 -0
  8. package/dist-es/commands/PutAnomalyDetectorCommand.js +22 -0
  9. package/dist-es/commands/index.js +5 -0
  10. package/dist-es/models/models_0.js +37 -0
  11. package/dist-es/pagination/ListAnomalyDetectorsPaginator.js +4 -0
  12. package/dist-es/pagination/index.js +1 -0
  13. package/dist-es/protocols/Aws_restJson1.js +233 -2
  14. package/dist-es/waiters/index.js +2 -0
  15. package/dist-es/waiters/waitForAnomalyDetectorActive.js +49 -0
  16. package/dist-es/waiters/waitForAnomalyDetectorDeleted.js +34 -0
  17. package/dist-types/Amp.d.ts +35 -0
  18. package/dist-types/AmpClient.d.ts +7 -2
  19. package/dist-types/commands/CreateAnomalyDetectorCommand.d.ts +128 -0
  20. package/dist-types/commands/DeleteAnomalyDetectorCommand.d.ts +92 -0
  21. package/dist-types/commands/DescribeAnomalyDetectorCommand.d.ts +126 -0
  22. package/dist-types/commands/ListAnomalyDetectorsCommand.d.ts +108 -0
  23. package/dist-types/commands/PutAnomalyDetectorCommand.d.ts +125 -0
  24. package/dist-types/commands/index.d.ts +5 -0
  25. package/dist-types/models/models_0.d.ts +500 -0
  26. package/dist-types/pagination/ListAnomalyDetectorsPaginator.d.ts +7 -0
  27. package/dist-types/pagination/index.d.ts +1 -0
  28. package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
  29. package/dist-types/ts3.4/Amp.d.ts +85 -0
  30. package/dist-types/ts3.4/AmpClient.d.ts +30 -0
  31. package/dist-types/ts3.4/commands/CreateAnomalyDetectorCommand.d.ts +51 -0
  32. package/dist-types/ts3.4/commands/DeleteAnomalyDetectorCommand.d.ts +46 -0
  33. package/dist-types/ts3.4/commands/DescribeAnomalyDetectorCommand.d.ts +51 -0
  34. package/dist-types/ts3.4/commands/ListAnomalyDetectorsCommand.d.ts +51 -0
  35. package/dist-types/ts3.4/commands/PutAnomalyDetectorCommand.d.ts +51 -0
  36. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  37. package/dist-types/ts3.4/models/models_0.d.ts +175 -0
  38. package/dist-types/ts3.4/pagination/ListAnomalyDetectorsPaginator.d.ts +11 -0
  39. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  40. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
  41. package/dist-types/ts3.4/waiters/index.d.ts +2 -0
  42. package/dist-types/ts3.4/waiters/waitForAnomalyDetectorActive.d.ts +11 -0
  43. package/dist-types/ts3.4/waiters/waitForAnomalyDetectorDeleted.d.ts +11 -0
  44. package/dist-types/waiters/index.d.ts +2 -0
  45. package/dist-types/waiters/waitForAnomalyDetectorActive.d.ts +14 -0
  46. package/dist-types/waiters/waitForAnomalyDetectorDeleted.d.ts +14 -0
  47. package/package.json +34 -34
package/dist-cjs/index.js CHANGED
@@ -301,6 +301,43 @@ const ScraperLoggingConfigurationStatusCode = {
301
301
  UPDATE_FAILED: "UPDATE_FAILED",
302
302
  UPDATING: "UPDATING",
303
303
  };
304
+ exports.IgnoreNearExpected = void 0;
305
+ (function (IgnoreNearExpected) {
306
+ IgnoreNearExpected.visit = (value, visitor) => {
307
+ if (value.amount !== undefined)
308
+ return visitor.amount(value.amount);
309
+ if (value.ratio !== undefined)
310
+ return visitor.ratio(value.ratio);
311
+ return visitor._(value.$unknown[0], value.$unknown[1]);
312
+ };
313
+ })(exports.IgnoreNearExpected || (exports.IgnoreNearExpected = {}));
314
+ exports.AnomalyDetectorConfiguration = void 0;
315
+ (function (AnomalyDetectorConfiguration) {
316
+ AnomalyDetectorConfiguration.visit = (value, visitor) => {
317
+ if (value.randomCutForest !== undefined)
318
+ return visitor.randomCutForest(value.randomCutForest);
319
+ return visitor._(value.$unknown[0], value.$unknown[1]);
320
+ };
321
+ })(exports.AnomalyDetectorConfiguration || (exports.AnomalyDetectorConfiguration = {}));
322
+ exports.AnomalyDetectorMissingDataAction = void 0;
323
+ (function (AnomalyDetectorMissingDataAction) {
324
+ AnomalyDetectorMissingDataAction.visit = (value, visitor) => {
325
+ if (value.markAsAnomaly !== undefined)
326
+ return visitor.markAsAnomaly(value.markAsAnomaly);
327
+ if (value.skip !== undefined)
328
+ return visitor.skip(value.skip);
329
+ return visitor._(value.$unknown[0], value.$unknown[1]);
330
+ };
331
+ })(exports.AnomalyDetectorMissingDataAction || (exports.AnomalyDetectorMissingDataAction = {}));
332
+ const AnomalyDetectorStatusCode = {
333
+ ACTIVE: "ACTIVE",
334
+ CREATING: "CREATING",
335
+ CREATION_FAILED: "CREATION_FAILED",
336
+ DELETING: "DELETING",
337
+ DELETION_FAILED: "DELETION_FAILED",
338
+ UPDATE_FAILED: "UPDATE_FAILED",
339
+ UPDATING: "UPDATING",
340
+ };
304
341
  const WorkspaceStatusCode = {
305
342
  ACTIVE: "ACTIVE",
306
343
  CREATING: "CREATING",
@@ -359,6 +396,26 @@ const se_CreateAlertManagerDefinitionCommand = async (input, context) => {
359
396
  b.m("POST").h(headers).b(body);
360
397
  return b.build();
361
398
  };
399
+ const se_CreateAnomalyDetectorCommand = async (input, context) => {
400
+ const b = core.requestBuilder(input, context);
401
+ const headers = {
402
+ "content-type": "application/json",
403
+ };
404
+ b.bp("/workspaces/{workspaceId}/anomalydetectors");
405
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
406
+ let body;
407
+ body = JSON.stringify(smithyClient.take(input, {
408
+ alias: [],
409
+ clientToken: [true, (_) => _ ?? uuid.v4()],
410
+ configuration: (_) => se_AnomalyDetectorConfiguration(_),
411
+ evaluationIntervalInSeconds: [],
412
+ labels: (_) => smithyClient._json(_),
413
+ missingDataAction: (_) => smithyClient._json(_),
414
+ tags: (_) => smithyClient._json(_),
415
+ }));
416
+ b.m("POST").h(headers).b(body);
417
+ return b.build();
418
+ };
362
419
  const se_CreateLoggingConfigurationCommand = async (input, context) => {
363
420
  const b = core.requestBuilder(input, context);
364
421
  const headers = {
@@ -453,6 +510,19 @@ const se_DeleteAlertManagerDefinitionCommand = async (input, context) => {
453
510
  b.m("DELETE").h(headers).q(query).b(body);
454
511
  return b.build();
455
512
  };
513
+ const se_DeleteAnomalyDetectorCommand = async (input, context) => {
514
+ const b = core.requestBuilder(input, context);
515
+ const headers = {};
516
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
517
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
518
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
519
+ const query = smithyClient.map({
520
+ [_cT]: [, input[_cT] ?? uuid.v4()],
521
+ });
522
+ let body;
523
+ b.m("DELETE").h(headers).q(query).b(body);
524
+ return b.build();
525
+ };
456
526
  const se_DeleteLoggingConfigurationCommand = async (input, context) => {
457
527
  const b = core.requestBuilder(input, context);
458
528
  const headers = {};
@@ -548,6 +618,16 @@ const se_DescribeAlertManagerDefinitionCommand = async (input, context) => {
548
618
  b.m("GET").h(headers).b(body);
549
619
  return b.build();
550
620
  };
621
+ const se_DescribeAnomalyDetectorCommand = async (input, context) => {
622
+ const b = core.requestBuilder(input, context);
623
+ const headers = {};
624
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
625
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
626
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
627
+ let body;
628
+ b.m("GET").h(headers).b(body);
629
+ return b.build();
630
+ };
551
631
  const se_DescribeLoggingConfigurationCommand = async (input, context) => {
552
632
  const b = core.requestBuilder(input, context);
553
633
  const headers = {};
@@ -629,6 +709,20 @@ const se_GetDefaultScraperConfigurationCommand = async (input, context) => {
629
709
  b.m("GET").h(headers).b(body);
630
710
  return b.build();
631
711
  };
712
+ const se_ListAnomalyDetectorsCommand = async (input, context) => {
713
+ const b = core.requestBuilder(input, context);
714
+ const headers = {};
715
+ b.bp("/workspaces/{workspaceId}/anomalydetectors");
716
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
717
+ const query = smithyClient.map({
718
+ [_a]: [, input[_a]],
719
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
720
+ [_nT]: [, input[_nT]],
721
+ });
722
+ let body;
723
+ b.m("GET").h(headers).q(query).b(body);
724
+ return b.build();
725
+ };
632
726
  const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
633
727
  const b = core.requestBuilder(input, context);
634
728
  const headers = {};
@@ -693,6 +787,25 @@ const se_PutAlertManagerDefinitionCommand = async (input, context) => {
693
787
  b.m("PUT").h(headers).b(body);
694
788
  return b.build();
695
789
  };
790
+ const se_PutAnomalyDetectorCommand = async (input, context) => {
791
+ const b = core.requestBuilder(input, context);
792
+ const headers = {
793
+ "content-type": "application/json",
794
+ };
795
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
796
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
797
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
798
+ let body;
799
+ body = JSON.stringify(smithyClient.take(input, {
800
+ clientToken: [true, (_) => _ ?? uuid.v4()],
801
+ configuration: (_) => se_AnomalyDetectorConfiguration(_),
802
+ evaluationIntervalInSeconds: [],
803
+ labels: (_) => smithyClient._json(_),
804
+ missingDataAction: (_) => smithyClient._json(_),
805
+ }));
806
+ b.m("PUT").h(headers).b(body);
807
+ return b.build();
808
+ };
696
809
  const se_PutResourcePolicyCommand = async (input, context) => {
697
810
  const b = core.requestBuilder(input, context);
698
811
  const headers = {
@@ -859,6 +972,23 @@ const de_CreateAlertManagerDefinitionCommand = async (output, context) => {
859
972
  Object.assign(contents, doc);
860
973
  return contents;
861
974
  };
975
+ const de_CreateAnomalyDetectorCommand = async (output, context) => {
976
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
977
+ return de_CommandError(output, context);
978
+ }
979
+ const contents = smithyClient.map({
980
+ $metadata: deserializeMetadata(output),
981
+ });
982
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
983
+ const doc = smithyClient.take(data, {
984
+ anomalyDetectorId: smithyClient.expectString,
985
+ arn: smithyClient.expectString,
986
+ status: smithyClient._json,
987
+ tags: smithyClient._json,
988
+ });
989
+ Object.assign(contents, doc);
990
+ return contents;
991
+ };
862
992
  const de_CreateLoggingConfigurationCommand = async (output, context) => {
863
993
  if (output.statusCode !== 202 && output.statusCode >= 300) {
864
994
  return de_CommandError(output, context);
@@ -949,6 +1079,16 @@ const de_DeleteAlertManagerDefinitionCommand = async (output, context) => {
949
1079
  await smithyClient.collectBody(output.body, context);
950
1080
  return contents;
951
1081
  };
1082
+ const de_DeleteAnomalyDetectorCommand = async (output, context) => {
1083
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
1084
+ return de_CommandError(output, context);
1085
+ }
1086
+ const contents = smithyClient.map({
1087
+ $metadata: deserializeMetadata(output),
1088
+ });
1089
+ await smithyClient.collectBody(output.body, context);
1090
+ return contents;
1091
+ };
952
1092
  const de_DeleteLoggingConfigurationCommand = async (output, context) => {
953
1093
  if (output.statusCode !== 202 && output.statusCode >= 300) {
954
1094
  return de_CommandError(output, context);
@@ -1038,6 +1178,20 @@ const de_DescribeAlertManagerDefinitionCommand = async (output, context) => {
1038
1178
  Object.assign(contents, doc);
1039
1179
  return contents;
1040
1180
  };
1181
+ const de_DescribeAnomalyDetectorCommand = async (output, context) => {
1182
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
+ return de_CommandError(output, context);
1184
+ }
1185
+ const contents = smithyClient.map({
1186
+ $metadata: deserializeMetadata(output),
1187
+ });
1188
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
1189
+ const doc = smithyClient.take(data, {
1190
+ anomalyDetector: (_) => de_AnomalyDetectorDescription(_),
1191
+ });
1192
+ Object.assign(contents, doc);
1193
+ return contents;
1194
+ };
1041
1195
  const de_DescribeLoggingConfigurationCommand = async (output, context) => {
1042
1196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1043
1197
  return de_CommandError(output, context);
@@ -1170,6 +1324,21 @@ const de_GetDefaultScraperConfigurationCommand = async (output, context) => {
1170
1324
  Object.assign(contents, doc);
1171
1325
  return contents;
1172
1326
  };
1327
+ const de_ListAnomalyDetectorsCommand = async (output, context) => {
1328
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1329
+ return de_CommandError(output, context);
1330
+ }
1331
+ const contents = smithyClient.map({
1332
+ $metadata: deserializeMetadata(output),
1333
+ });
1334
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
1335
+ const doc = smithyClient.take(data, {
1336
+ anomalyDetectors: (_) => de_AnomalyDetectorSummaryList(_),
1337
+ nextToken: smithyClient.expectString,
1338
+ });
1339
+ Object.assign(contents, doc);
1340
+ return contents;
1341
+ };
1173
1342
  const de_ListRuleGroupsNamespacesCommand = async (output, context) => {
1174
1343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1175
1344
  return de_CommandError(output, context);
@@ -1243,6 +1412,23 @@ const de_PutAlertManagerDefinitionCommand = async (output, context) => {
1243
1412
  Object.assign(contents, doc);
1244
1413
  return contents;
1245
1414
  };
1415
+ const de_PutAnomalyDetectorCommand = async (output, context) => {
1416
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
1417
+ return de_CommandError(output, context);
1418
+ }
1419
+ const contents = smithyClient.map({
1420
+ $metadata: deserializeMetadata(output),
1421
+ });
1422
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
1423
+ const doc = smithyClient.take(data, {
1424
+ anomalyDetectorId: smithyClient.expectString,
1425
+ arn: smithyClient.expectString,
1426
+ status: smithyClient._json,
1427
+ tags: smithyClient._json,
1428
+ });
1429
+ Object.assign(contents, doc);
1430
+ return contents;
1431
+ };
1246
1432
  const de_PutResourcePolicyCommand = async (output, context) => {
1247
1433
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1248
1434
  return de_CommandError(output, context);
@@ -1523,6 +1709,28 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1523
1709
  });
1524
1710
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
1525
1711
  };
1712
+ const se_AnomalyDetectorConfiguration = (input, context) => {
1713
+ return exports.AnomalyDetectorConfiguration.visit(input, {
1714
+ randomCutForest: (value) => ({ randomCutForest: se_RandomCutForestConfiguration(value) }),
1715
+ _: (name, value) => ({ [name]: value }),
1716
+ });
1717
+ };
1718
+ const se_IgnoreNearExpected = (input, context) => {
1719
+ return exports.IgnoreNearExpected.visit(input, {
1720
+ amount: (value) => ({ amount: smithyClient.serializeFloat(value) }),
1721
+ ratio: (value) => ({ ratio: smithyClient.serializeFloat(value) }),
1722
+ _: (name, value) => ({ [name]: value }),
1723
+ });
1724
+ };
1725
+ const se_RandomCutForestConfiguration = (input, context) => {
1726
+ return smithyClient.take(input, {
1727
+ ignoreNearExpectedFromAbove: (_) => se_IgnoreNearExpected(_),
1728
+ ignoreNearExpectedFromBelow: (_) => se_IgnoreNearExpected(_),
1729
+ query: [],
1730
+ sampleSize: [],
1731
+ shingleSize: [],
1732
+ });
1733
+ };
1526
1734
  const se_ScrapeConfiguration = (input, context) => {
1527
1735
  return exports.ScrapeConfiguration.visit(input, {
1528
1736
  configurationBlob: (value) => ({ configurationBlob: context.base64Encoder(value) }),
@@ -1537,6 +1745,57 @@ const de_AlertManagerDefinitionDescription = (output, context) => {
1537
1745
  status: smithyClient._json,
1538
1746
  });
1539
1747
  };
1748
+ const de_AnomalyDetectorConfiguration = (output, context) => {
1749
+ if (output.randomCutForest != null) {
1750
+ return {
1751
+ randomCutForest: de_RandomCutForestConfiguration(output.randomCutForest),
1752
+ };
1753
+ }
1754
+ return { $unknown: Object.entries(output)[0] };
1755
+ };
1756
+ const de_AnomalyDetectorDescription = (output, context) => {
1757
+ return smithyClient.take(output, {
1758
+ alias: smithyClient.expectString,
1759
+ anomalyDetectorId: smithyClient.expectString,
1760
+ arn: smithyClient.expectString,
1761
+ configuration: (_) => de_AnomalyDetectorConfiguration(core$1.awsExpectUnion(_)),
1762
+ createdAt: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
1763
+ evaluationIntervalInSeconds: smithyClient.expectInt32,
1764
+ labels: smithyClient._json,
1765
+ missingDataAction: (_) => smithyClient._json(core$1.awsExpectUnion(_)),
1766
+ modifiedAt: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
1767
+ status: smithyClient._json,
1768
+ tags: smithyClient._json,
1769
+ });
1770
+ };
1771
+ const de_AnomalyDetectorSummary = (output, context) => {
1772
+ return smithyClient.take(output, {
1773
+ alias: smithyClient.expectString,
1774
+ anomalyDetectorId: smithyClient.expectString,
1775
+ arn: smithyClient.expectString,
1776
+ createdAt: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
1777
+ modifiedAt: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
1778
+ status: smithyClient._json,
1779
+ tags: smithyClient._json,
1780
+ });
1781
+ };
1782
+ const de_AnomalyDetectorSummaryList = (output, context) => {
1783
+ const retVal = (output || [])
1784
+ .filter((e) => e != null)
1785
+ .map((entry) => {
1786
+ return de_AnomalyDetectorSummary(entry);
1787
+ });
1788
+ return retVal;
1789
+ };
1790
+ const de_IgnoreNearExpected = (output, context) => {
1791
+ if (smithyClient.limitedParseDouble(output.amount) !== undefined) {
1792
+ return { amount: smithyClient.limitedParseDouble(output.amount) };
1793
+ }
1794
+ if (smithyClient.limitedParseDouble(output.ratio) !== undefined) {
1795
+ return { ratio: smithyClient.limitedParseDouble(output.ratio) };
1796
+ }
1797
+ return { $unknown: Object.entries(output)[0] };
1798
+ };
1540
1799
  const de_LoggingConfigurationMetadata = (output, context) => {
1541
1800
  return smithyClient.take(output, {
1542
1801
  createdAt: (_) => smithyClient.expectNonNull(smithyClient.parseEpochTimestamp(smithyClient.expectNumber(_))),
@@ -1555,6 +1814,15 @@ const de_QueryLoggingConfigurationMetadata = (output, context) => {
1555
1814
  workspace: smithyClient.expectString,
1556
1815
  });
1557
1816
  };
1817
+ const de_RandomCutForestConfiguration = (output, context) => {
1818
+ return smithyClient.take(output, {
1819
+ ignoreNearExpectedFromAbove: (_) => de_IgnoreNearExpected(core$1.awsExpectUnion(_)),
1820
+ ignoreNearExpectedFromBelow: (_) => de_IgnoreNearExpected(core$1.awsExpectUnion(_)),
1821
+ query: smithyClient.expectString,
1822
+ sampleSize: smithyClient.expectInt32,
1823
+ shingleSize: smithyClient.expectInt32,
1824
+ });
1825
+ };
1558
1826
  const de_RuleGroupsNamespaceDescription = (output, context) => {
1559
1827
  return smithyClient.take(output, {
1560
1828
  arn: smithyClient.expectString,
@@ -1697,6 +1965,23 @@ class CreateAlertManagerDefinitionCommand extends smithyClient.Command
1697
1965
  .build() {
1698
1966
  }
1699
1967
 
1968
+ class CreateAnomalyDetectorCommand extends smithyClient.Command
1969
+ .classBuilder()
1970
+ .ep(commonParams)
1971
+ .m(function (Command, cs, config, o) {
1972
+ return [
1973
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1974
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1975
+ ];
1976
+ })
1977
+ .s("AmazonPrometheusService", "CreateAnomalyDetector", {})
1978
+ .n("AmpClient", "CreateAnomalyDetectorCommand")
1979
+ .f(void 0, void 0)
1980
+ .ser(se_CreateAnomalyDetectorCommand)
1981
+ .de(de_CreateAnomalyDetectorCommand)
1982
+ .build() {
1983
+ }
1984
+
1700
1985
  class CreateLoggingConfigurationCommand extends smithyClient.Command
1701
1986
  .classBuilder()
1702
1987
  .ep(commonParams)
@@ -1799,6 +2084,23 @@ class DeleteAlertManagerDefinitionCommand extends smithyClient.Command
1799
2084
  .build() {
1800
2085
  }
1801
2086
 
2087
+ class DeleteAnomalyDetectorCommand extends smithyClient.Command
2088
+ .classBuilder()
2089
+ .ep(commonParams)
2090
+ .m(function (Command, cs, config, o) {
2091
+ return [
2092
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
2093
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
2094
+ ];
2095
+ })
2096
+ .s("AmazonPrometheusService", "DeleteAnomalyDetector", {})
2097
+ .n("AmpClient", "DeleteAnomalyDetectorCommand")
2098
+ .f(void 0, void 0)
2099
+ .ser(se_DeleteAnomalyDetectorCommand)
2100
+ .de(de_DeleteAnomalyDetectorCommand)
2101
+ .build() {
2102
+ }
2103
+
1802
2104
  class DeleteLoggingConfigurationCommand extends smithyClient.Command
1803
2105
  .classBuilder()
1804
2106
  .ep(commonParams)
@@ -1935,6 +2237,23 @@ class DescribeAlertManagerDefinitionCommand extends smithyClient.Command
1935
2237
  .build() {
1936
2238
  }
1937
2239
 
2240
+ class DescribeAnomalyDetectorCommand extends smithyClient.Command
2241
+ .classBuilder()
2242
+ .ep(commonParams)
2243
+ .m(function (Command, cs, config, o) {
2244
+ return [
2245
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
2246
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
2247
+ ];
2248
+ })
2249
+ .s("AmazonPrometheusService", "DescribeAnomalyDetector", {})
2250
+ .n("AmpClient", "DescribeAnomalyDetectorCommand")
2251
+ .f(void 0, void 0)
2252
+ .ser(se_DescribeAnomalyDetectorCommand)
2253
+ .de(de_DescribeAnomalyDetectorCommand)
2254
+ .build() {
2255
+ }
2256
+
1938
2257
  class DescribeLoggingConfigurationCommand extends smithyClient.Command
1939
2258
  .classBuilder()
1940
2259
  .ep(commonParams)
@@ -2088,6 +2407,23 @@ class GetDefaultScraperConfigurationCommand extends smithyClient.Command
2088
2407
  .build() {
2089
2408
  }
2090
2409
 
2410
+ class ListAnomalyDetectorsCommand extends smithyClient.Command
2411
+ .classBuilder()
2412
+ .ep(commonParams)
2413
+ .m(function (Command, cs, config, o) {
2414
+ return [
2415
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
2416
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
2417
+ ];
2418
+ })
2419
+ .s("AmazonPrometheusService", "ListAnomalyDetectors", {})
2420
+ .n("AmpClient", "ListAnomalyDetectorsCommand")
2421
+ .f(void 0, void 0)
2422
+ .ser(se_ListAnomalyDetectorsCommand)
2423
+ .de(de_ListAnomalyDetectorsCommand)
2424
+ .build() {
2425
+ }
2426
+
2091
2427
  class ListRuleGroupsNamespacesCommand extends smithyClient.Command
2092
2428
  .classBuilder()
2093
2429
  .ep(commonParams)
@@ -2173,6 +2509,23 @@ class PutAlertManagerDefinitionCommand extends smithyClient.Command
2173
2509
  .build() {
2174
2510
  }
2175
2511
 
2512
+ class PutAnomalyDetectorCommand extends smithyClient.Command
2513
+ .classBuilder()
2514
+ .ep(commonParams)
2515
+ .m(function (Command, cs, config, o) {
2516
+ return [
2517
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
2518
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
2519
+ ];
2520
+ })
2521
+ .s("AmazonPrometheusService", "PutAnomalyDetector", {})
2522
+ .n("AmpClient", "PutAnomalyDetectorCommand")
2523
+ .f(void 0, void 0)
2524
+ .ser(se_PutAnomalyDetectorCommand)
2525
+ .de(de_PutAnomalyDetectorCommand)
2526
+ .build() {
2527
+ }
2528
+
2176
2529
  class PutResourcePolicyCommand extends smithyClient.Command
2177
2530
  .classBuilder()
2178
2531
  .ep(commonParams)
@@ -2345,12 +2698,14 @@ class UpdateWorkspaceConfigurationCommand extends smithyClient.Command
2345
2698
 
2346
2699
  const commands = {
2347
2700
  CreateAlertManagerDefinitionCommand,
2701
+ CreateAnomalyDetectorCommand,
2348
2702
  CreateLoggingConfigurationCommand,
2349
2703
  CreateQueryLoggingConfigurationCommand,
2350
2704
  CreateRuleGroupsNamespaceCommand,
2351
2705
  CreateScraperCommand,
2352
2706
  CreateWorkspaceCommand,
2353
2707
  DeleteAlertManagerDefinitionCommand,
2708
+ DeleteAnomalyDetectorCommand,
2354
2709
  DeleteLoggingConfigurationCommand,
2355
2710
  DeleteQueryLoggingConfigurationCommand,
2356
2711
  DeleteResourcePolicyCommand,
@@ -2359,6 +2714,7 @@ const commands = {
2359
2714
  DeleteScraperLoggingConfigurationCommand,
2360
2715
  DeleteWorkspaceCommand,
2361
2716
  DescribeAlertManagerDefinitionCommand,
2717
+ DescribeAnomalyDetectorCommand,
2362
2718
  DescribeLoggingConfigurationCommand,
2363
2719
  DescribeQueryLoggingConfigurationCommand,
2364
2720
  DescribeResourcePolicyCommand,
@@ -2368,11 +2724,13 @@ const commands = {
2368
2724
  DescribeWorkspaceCommand,
2369
2725
  DescribeWorkspaceConfigurationCommand,
2370
2726
  GetDefaultScraperConfigurationCommand,
2727
+ ListAnomalyDetectorsCommand,
2371
2728
  ListRuleGroupsNamespacesCommand,
2372
2729
  ListScrapersCommand,
2373
2730
  ListTagsForResourceCommand,
2374
2731
  ListWorkspacesCommand,
2375
2732
  PutAlertManagerDefinitionCommand,
2733
+ PutAnomalyDetectorCommand,
2376
2734
  PutResourcePolicyCommand,
2377
2735
  PutRuleGroupsNamespaceCommand,
2378
2736
  TagResourceCommand,
@@ -2388,12 +2746,95 @@ class Amp extends AmpClient {
2388
2746
  }
2389
2747
  smithyClient.createAggregatedClient(commands, Amp);
2390
2748
 
2749
+ const paginateListAnomalyDetectors = core.createPaginator(AmpClient, ListAnomalyDetectorsCommand, "nextToken", "nextToken", "maxResults");
2750
+
2391
2751
  const paginateListRuleGroupsNamespaces = core.createPaginator(AmpClient, ListRuleGroupsNamespacesCommand, "nextToken", "nextToken", "maxResults");
2392
2752
 
2393
2753
  const paginateListScrapers = core.createPaginator(AmpClient, ListScrapersCommand, "nextToken", "nextToken", "maxResults");
2394
2754
 
2395
2755
  const paginateListWorkspaces = core.createPaginator(AmpClient, ListWorkspacesCommand, "nextToken", "nextToken", "maxResults");
2396
2756
 
2757
+ const checkState$5 = async (client, input) => {
2758
+ let reason;
2759
+ try {
2760
+ const result = await client.send(new DescribeAnomalyDetectorCommand(input));
2761
+ reason = result;
2762
+ try {
2763
+ const returnComparator = () => {
2764
+ return result.anomalyDetector.status.statusCode;
2765
+ };
2766
+ if (returnComparator() === "ACTIVE") {
2767
+ return { state: utilWaiter.WaiterState.SUCCESS, reason };
2768
+ }
2769
+ }
2770
+ catch (e) { }
2771
+ try {
2772
+ const returnComparator = () => {
2773
+ return result.anomalyDetector.status.statusCode;
2774
+ };
2775
+ if (returnComparator() === "CREATING") {
2776
+ return { state: utilWaiter.WaiterState.RETRY, reason };
2777
+ }
2778
+ }
2779
+ catch (e) { }
2780
+ try {
2781
+ const returnComparator = () => {
2782
+ return result.anomalyDetector.status.statusCode;
2783
+ };
2784
+ if (returnComparator() === "UPDATING") {
2785
+ return { state: utilWaiter.WaiterState.RETRY, reason };
2786
+ }
2787
+ }
2788
+ catch (e) { }
2789
+ }
2790
+ catch (exception) {
2791
+ reason = exception;
2792
+ }
2793
+ return { state: utilWaiter.WaiterState.RETRY, reason };
2794
+ };
2795
+ const waitForAnomalyDetectorActive = async (params, input) => {
2796
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
2797
+ return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5);
2798
+ };
2799
+ const waitUntilAnomalyDetectorActive = async (params, input) => {
2800
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
2801
+ const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$5);
2802
+ return utilWaiter.checkExceptions(result);
2803
+ };
2804
+
2805
+ const checkState$4 = async (client, input) => {
2806
+ let reason;
2807
+ try {
2808
+ const result = await client.send(new DescribeAnomalyDetectorCommand(input));
2809
+ reason = result;
2810
+ try {
2811
+ const returnComparator = () => {
2812
+ return result.anomalyDetector.status.statusCode;
2813
+ };
2814
+ if (returnComparator() === "DELETING") {
2815
+ return { state: utilWaiter.WaiterState.RETRY, reason };
2816
+ }
2817
+ }
2818
+ catch (e) { }
2819
+ }
2820
+ catch (exception) {
2821
+ reason = exception;
2822
+ if (exception.name && exception.name == "ResourceNotFoundException") {
2823
+ return { state: utilWaiter.WaiterState.SUCCESS, reason };
2824
+ }
2825
+ }
2826
+ return { state: utilWaiter.WaiterState.RETRY, reason };
2827
+ };
2828
+ const waitForAnomalyDetectorDeleted = async (params, input) => {
2829
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
2830
+ return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4);
2831
+ };
2832
+ const waitUntilAnomalyDetectorDeleted = async (params, input) => {
2833
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
2834
+ const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$4);
2835
+ return utilWaiter.checkExceptions(result);
2836
+ };
2837
+
2397
2838
  const checkState$3 = async (client, input) => {
2398
2839
  let reason;
2399
2840
  try {
@@ -2560,14 +3001,17 @@ exports.AlertManagerDefinitionStatusCode = AlertManagerDefinitionStatusCode;
2560
3001
  exports.Amp = Amp;
2561
3002
  exports.AmpClient = AmpClient;
2562
3003
  exports.AmpServiceException = AmpServiceException;
3004
+ exports.AnomalyDetectorStatusCode = AnomalyDetectorStatusCode;
2563
3005
  exports.ConflictException = ConflictException;
2564
3006
  exports.CreateAlertManagerDefinitionCommand = CreateAlertManagerDefinitionCommand;
3007
+ exports.CreateAnomalyDetectorCommand = CreateAnomalyDetectorCommand;
2565
3008
  exports.CreateLoggingConfigurationCommand = CreateLoggingConfigurationCommand;
2566
3009
  exports.CreateQueryLoggingConfigurationCommand = CreateQueryLoggingConfigurationCommand;
2567
3010
  exports.CreateRuleGroupsNamespaceCommand = CreateRuleGroupsNamespaceCommand;
2568
3011
  exports.CreateScraperCommand = CreateScraperCommand;
2569
3012
  exports.CreateWorkspaceCommand = CreateWorkspaceCommand;
2570
3013
  exports.DeleteAlertManagerDefinitionCommand = DeleteAlertManagerDefinitionCommand;
3014
+ exports.DeleteAnomalyDetectorCommand = DeleteAnomalyDetectorCommand;
2571
3015
  exports.DeleteLoggingConfigurationCommand = DeleteLoggingConfigurationCommand;
2572
3016
  exports.DeleteQueryLoggingConfigurationCommand = DeleteQueryLoggingConfigurationCommand;
2573
3017
  exports.DeleteResourcePolicyCommand = DeleteResourcePolicyCommand;
@@ -2576,6 +3020,7 @@ exports.DeleteScraperCommand = DeleteScraperCommand;
2576
3020
  exports.DeleteScraperLoggingConfigurationCommand = DeleteScraperLoggingConfigurationCommand;
2577
3021
  exports.DeleteWorkspaceCommand = DeleteWorkspaceCommand;
2578
3022
  exports.DescribeAlertManagerDefinitionCommand = DescribeAlertManagerDefinitionCommand;
3023
+ exports.DescribeAnomalyDetectorCommand = DescribeAnomalyDetectorCommand;
2579
3024
  exports.DescribeLoggingConfigurationCommand = DescribeLoggingConfigurationCommand;
2580
3025
  exports.DescribeQueryLoggingConfigurationCommand = DescribeQueryLoggingConfigurationCommand;
2581
3026
  exports.DescribeResourcePolicyCommand = DescribeResourcePolicyCommand;
@@ -2586,12 +3031,14 @@ exports.DescribeWorkspaceCommand = DescribeWorkspaceCommand;
2586
3031
  exports.DescribeWorkspaceConfigurationCommand = DescribeWorkspaceConfigurationCommand;
2587
3032
  exports.GetDefaultScraperConfigurationCommand = GetDefaultScraperConfigurationCommand;
2588
3033
  exports.InternalServerException = InternalServerException;
3034
+ exports.ListAnomalyDetectorsCommand = ListAnomalyDetectorsCommand;
2589
3035
  exports.ListRuleGroupsNamespacesCommand = ListRuleGroupsNamespacesCommand;
2590
3036
  exports.ListScrapersCommand = ListScrapersCommand;
2591
3037
  exports.ListTagsForResourceCommand = ListTagsForResourceCommand;
2592
3038
  exports.ListWorkspacesCommand = ListWorkspacesCommand;
2593
3039
  exports.LoggingConfigurationStatusCode = LoggingConfigurationStatusCode;
2594
3040
  exports.PutAlertManagerDefinitionCommand = PutAlertManagerDefinitionCommand;
3041
+ exports.PutAnomalyDetectorCommand = PutAnomalyDetectorCommand;
2595
3042
  exports.PutResourcePolicyCommand = PutResourcePolicyCommand;
2596
3043
  exports.PutRuleGroupsNamespaceCommand = PutRuleGroupsNamespaceCommand;
2597
3044
  exports.QueryLoggingConfigurationStatusCode = QueryLoggingConfigurationStatusCode;
@@ -2615,13 +3062,18 @@ exports.ValidationExceptionReason = ValidationExceptionReason;
2615
3062
  exports.WorkspaceConfigurationStatusCode = WorkspaceConfigurationStatusCode;
2616
3063
  exports.WorkspacePolicyStatusCode = WorkspacePolicyStatusCode;
2617
3064
  exports.WorkspaceStatusCode = WorkspaceStatusCode;
3065
+ exports.paginateListAnomalyDetectors = paginateListAnomalyDetectors;
2618
3066
  exports.paginateListRuleGroupsNamespaces = paginateListRuleGroupsNamespaces;
2619
3067
  exports.paginateListScrapers = paginateListScrapers;
2620
3068
  exports.paginateListWorkspaces = paginateListWorkspaces;
3069
+ exports.waitForAnomalyDetectorActive = waitForAnomalyDetectorActive;
3070
+ exports.waitForAnomalyDetectorDeleted = waitForAnomalyDetectorDeleted;
2621
3071
  exports.waitForScraperActive = waitForScraperActive;
2622
3072
  exports.waitForScraperDeleted = waitForScraperDeleted;
2623
3073
  exports.waitForWorkspaceActive = waitForWorkspaceActive;
2624
3074
  exports.waitForWorkspaceDeleted = waitForWorkspaceDeleted;
3075
+ exports.waitUntilAnomalyDetectorActive = waitUntilAnomalyDetectorActive;
3076
+ exports.waitUntilAnomalyDetectorDeleted = waitUntilAnomalyDetectorDeleted;
2625
3077
  exports.waitUntilScraperActive = waitUntilScraperActive;
2626
3078
  exports.waitUntilScraperDeleted = waitUntilScraperDeleted;
2627
3079
  exports.waitUntilWorkspaceActive = waitUntilWorkspaceActive;