@aws-sdk/client-amp 3.920.0 → 3.922.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-es/Amp.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import { createAggregatedClient } from "@smithy/smithy-client";
2
2
  import { AmpClient } from "./AmpClient";
3
3
  import { CreateAlertManagerDefinitionCommand, } from "./commands/CreateAlertManagerDefinitionCommand";
4
+ import { CreateAnomalyDetectorCommand, } from "./commands/CreateAnomalyDetectorCommand";
4
5
  import { CreateLoggingConfigurationCommand, } from "./commands/CreateLoggingConfigurationCommand";
5
6
  import { CreateQueryLoggingConfigurationCommand, } from "./commands/CreateQueryLoggingConfigurationCommand";
6
7
  import { CreateRuleGroupsNamespaceCommand, } from "./commands/CreateRuleGroupsNamespaceCommand";
7
8
  import { CreateScraperCommand, } from "./commands/CreateScraperCommand";
8
9
  import { CreateWorkspaceCommand, } from "./commands/CreateWorkspaceCommand";
9
10
  import { DeleteAlertManagerDefinitionCommand, } from "./commands/DeleteAlertManagerDefinitionCommand";
11
+ import { DeleteAnomalyDetectorCommand, } from "./commands/DeleteAnomalyDetectorCommand";
10
12
  import { DeleteLoggingConfigurationCommand, } from "./commands/DeleteLoggingConfigurationCommand";
11
13
  import { DeleteQueryLoggingConfigurationCommand, } from "./commands/DeleteQueryLoggingConfigurationCommand";
12
14
  import { DeleteResourcePolicyCommand, } from "./commands/DeleteResourcePolicyCommand";
@@ -15,6 +17,7 @@ import { DeleteScraperCommand, } from "./commands/DeleteScraperCommand";
15
17
  import { DeleteScraperLoggingConfigurationCommand, } from "./commands/DeleteScraperLoggingConfigurationCommand";
16
18
  import { DeleteWorkspaceCommand, } from "./commands/DeleteWorkspaceCommand";
17
19
  import { DescribeAlertManagerDefinitionCommand, } from "./commands/DescribeAlertManagerDefinitionCommand";
20
+ import { DescribeAnomalyDetectorCommand, } from "./commands/DescribeAnomalyDetectorCommand";
18
21
  import { DescribeLoggingConfigurationCommand, } from "./commands/DescribeLoggingConfigurationCommand";
19
22
  import { DescribeQueryLoggingConfigurationCommand, } from "./commands/DescribeQueryLoggingConfigurationCommand";
20
23
  import { DescribeResourcePolicyCommand, } from "./commands/DescribeResourcePolicyCommand";
@@ -24,11 +27,13 @@ import { DescribeScraperLoggingConfigurationCommand, } from "./commands/Describe
24
27
  import { DescribeWorkspaceCommand, } from "./commands/DescribeWorkspaceCommand";
25
28
  import { DescribeWorkspaceConfigurationCommand, } from "./commands/DescribeWorkspaceConfigurationCommand";
26
29
  import { GetDefaultScraperConfigurationCommand, } from "./commands/GetDefaultScraperConfigurationCommand";
30
+ import { ListAnomalyDetectorsCommand, } from "./commands/ListAnomalyDetectorsCommand";
27
31
  import { ListRuleGroupsNamespacesCommand, } from "./commands/ListRuleGroupsNamespacesCommand";
28
32
  import { ListScrapersCommand, } from "./commands/ListScrapersCommand";
29
33
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
30
34
  import { ListWorkspacesCommand, } from "./commands/ListWorkspacesCommand";
31
35
  import { PutAlertManagerDefinitionCommand, } from "./commands/PutAlertManagerDefinitionCommand";
36
+ import { PutAnomalyDetectorCommand, } from "./commands/PutAnomalyDetectorCommand";
32
37
  import { PutResourcePolicyCommand, } from "./commands/PutResourcePolicyCommand";
33
38
  import { PutRuleGroupsNamespaceCommand, } from "./commands/PutRuleGroupsNamespaceCommand";
34
39
  import { TagResourceCommand } from "./commands/TagResourceCommand";
@@ -41,12 +46,14 @@ import { UpdateWorkspaceAliasCommand, } from "./commands/UpdateWorkspaceAliasCom
41
46
  import { UpdateWorkspaceConfigurationCommand, } from "./commands/UpdateWorkspaceConfigurationCommand";
42
47
  const commands = {
43
48
  CreateAlertManagerDefinitionCommand,
49
+ CreateAnomalyDetectorCommand,
44
50
  CreateLoggingConfigurationCommand,
45
51
  CreateQueryLoggingConfigurationCommand,
46
52
  CreateRuleGroupsNamespaceCommand,
47
53
  CreateScraperCommand,
48
54
  CreateWorkspaceCommand,
49
55
  DeleteAlertManagerDefinitionCommand,
56
+ DeleteAnomalyDetectorCommand,
50
57
  DeleteLoggingConfigurationCommand,
51
58
  DeleteQueryLoggingConfigurationCommand,
52
59
  DeleteResourcePolicyCommand,
@@ -55,6 +62,7 @@ const commands = {
55
62
  DeleteScraperLoggingConfigurationCommand,
56
63
  DeleteWorkspaceCommand,
57
64
  DescribeAlertManagerDefinitionCommand,
65
+ DescribeAnomalyDetectorCommand,
58
66
  DescribeLoggingConfigurationCommand,
59
67
  DescribeQueryLoggingConfigurationCommand,
60
68
  DescribeResourcePolicyCommand,
@@ -64,11 +72,13 @@ const commands = {
64
72
  DescribeWorkspaceCommand,
65
73
  DescribeWorkspaceConfigurationCommand,
66
74
  GetDefaultScraperConfigurationCommand,
75
+ ListAnomalyDetectorsCommand,
67
76
  ListRuleGroupsNamespacesCommand,
68
77
  ListScrapersCommand,
69
78
  ListTagsForResourceCommand,
70
79
  ListWorkspacesCommand,
71
80
  PutAlertManagerDefinitionCommand,
81
+ PutAnomalyDetectorCommand,
72
82
  PutResourcePolicyCommand,
73
83
  PutRuleGroupsNamespaceCommand,
74
84
  TagResourceCommand,
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_CreateAnomalyDetectorCommand, se_CreateAnomalyDetectorCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class CreateAnomalyDetectorCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("AmazonPrometheusService", "CreateAnomalyDetector", {})
17
+ .n("AmpClient", "CreateAnomalyDetectorCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_CreateAnomalyDetectorCommand)
20
+ .de(de_CreateAnomalyDetectorCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_DeleteAnomalyDetectorCommand, se_DeleteAnomalyDetectorCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class DeleteAnomalyDetectorCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("AmazonPrometheusService", "DeleteAnomalyDetector", {})
17
+ .n("AmpClient", "DeleteAnomalyDetectorCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_DeleteAnomalyDetectorCommand)
20
+ .de(de_DeleteAnomalyDetectorCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_DescribeAnomalyDetectorCommand, se_DescribeAnomalyDetectorCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class DescribeAnomalyDetectorCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("AmazonPrometheusService", "DescribeAnomalyDetector", {})
17
+ .n("AmpClient", "DescribeAnomalyDetectorCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_DescribeAnomalyDetectorCommand)
20
+ .de(de_DescribeAnomalyDetectorCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_ListAnomalyDetectorsCommand, se_ListAnomalyDetectorsCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListAnomalyDetectorsCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("AmazonPrometheusService", "ListAnomalyDetectors", {})
17
+ .n("AmpClient", "ListAnomalyDetectorsCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_ListAnomalyDetectorsCommand)
20
+ .de(de_ListAnomalyDetectorsCommand)
21
+ .build() {
22
+ }
@@ -0,0 +1,22 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { de_PutAnomalyDetectorCommand, se_PutAnomalyDetectorCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class PutAnomalyDetectorCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [
12
+ getSerdePlugin(config, this.serialize, this.deserialize),
13
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
14
+ ];
15
+ })
16
+ .s("AmazonPrometheusService", "PutAnomalyDetector", {})
17
+ .n("AmpClient", "PutAnomalyDetectorCommand")
18
+ .f(void 0, void 0)
19
+ .ser(se_PutAnomalyDetectorCommand)
20
+ .de(de_PutAnomalyDetectorCommand)
21
+ .build() {
22
+ }
@@ -1,10 +1,12 @@
1
1
  export * from "./CreateAlertManagerDefinitionCommand";
2
+ export * from "./CreateAnomalyDetectorCommand";
2
3
  export * from "./CreateLoggingConfigurationCommand";
3
4
  export * from "./CreateQueryLoggingConfigurationCommand";
4
5
  export * from "./CreateRuleGroupsNamespaceCommand";
5
6
  export * from "./CreateScraperCommand";
6
7
  export * from "./CreateWorkspaceCommand";
7
8
  export * from "./DeleteAlertManagerDefinitionCommand";
9
+ export * from "./DeleteAnomalyDetectorCommand";
8
10
  export * from "./DeleteLoggingConfigurationCommand";
9
11
  export * from "./DeleteQueryLoggingConfigurationCommand";
10
12
  export * from "./DeleteResourcePolicyCommand";
@@ -13,6 +15,7 @@ export * from "./DeleteScraperCommand";
13
15
  export * from "./DeleteScraperLoggingConfigurationCommand";
14
16
  export * from "./DeleteWorkspaceCommand";
15
17
  export * from "./DescribeAlertManagerDefinitionCommand";
18
+ export * from "./DescribeAnomalyDetectorCommand";
16
19
  export * from "./DescribeLoggingConfigurationCommand";
17
20
  export * from "./DescribeQueryLoggingConfigurationCommand";
18
21
  export * from "./DescribeResourcePolicyCommand";
@@ -22,11 +25,13 @@ export * from "./DescribeScraperLoggingConfigurationCommand";
22
25
  export * from "./DescribeWorkspaceCommand";
23
26
  export * from "./DescribeWorkspaceConfigurationCommand";
24
27
  export * from "./GetDefaultScraperConfigurationCommand";
28
+ export * from "./ListAnomalyDetectorsCommand";
25
29
  export * from "./ListRuleGroupsNamespacesCommand";
26
30
  export * from "./ListScrapersCommand";
27
31
  export * from "./ListTagsForResourceCommand";
28
32
  export * from "./ListWorkspacesCommand";
29
33
  export * from "./PutAlertManagerDefinitionCommand";
34
+ export * from "./PutAnomalyDetectorCommand";
30
35
  export * from "./PutResourcePolicyCommand";
31
36
  export * from "./PutRuleGroupsNamespaceCommand";
32
37
  export * from "./TagResourceCommand";
@@ -181,6 +181,43 @@ export const ScraperLoggingConfigurationStatusCode = {
181
181
  UPDATE_FAILED: "UPDATE_FAILED",
182
182
  UPDATING: "UPDATING",
183
183
  };
184
+ export var IgnoreNearExpected;
185
+ (function (IgnoreNearExpected) {
186
+ IgnoreNearExpected.visit = (value, visitor) => {
187
+ if (value.amount !== undefined)
188
+ return visitor.amount(value.amount);
189
+ if (value.ratio !== undefined)
190
+ return visitor.ratio(value.ratio);
191
+ return visitor._(value.$unknown[0], value.$unknown[1]);
192
+ };
193
+ })(IgnoreNearExpected || (IgnoreNearExpected = {}));
194
+ export var AnomalyDetectorConfiguration;
195
+ (function (AnomalyDetectorConfiguration) {
196
+ AnomalyDetectorConfiguration.visit = (value, visitor) => {
197
+ if (value.randomCutForest !== undefined)
198
+ return visitor.randomCutForest(value.randomCutForest);
199
+ return visitor._(value.$unknown[0], value.$unknown[1]);
200
+ };
201
+ })(AnomalyDetectorConfiguration || (AnomalyDetectorConfiguration = {}));
202
+ export var AnomalyDetectorMissingDataAction;
203
+ (function (AnomalyDetectorMissingDataAction) {
204
+ AnomalyDetectorMissingDataAction.visit = (value, visitor) => {
205
+ if (value.markAsAnomaly !== undefined)
206
+ return visitor.markAsAnomaly(value.markAsAnomaly);
207
+ if (value.skip !== undefined)
208
+ return visitor.skip(value.skip);
209
+ return visitor._(value.$unknown[0], value.$unknown[1]);
210
+ };
211
+ })(AnomalyDetectorMissingDataAction || (AnomalyDetectorMissingDataAction = {}));
212
+ export const AnomalyDetectorStatusCode = {
213
+ ACTIVE: "ACTIVE",
214
+ CREATING: "CREATING",
215
+ CREATION_FAILED: "CREATION_FAILED",
216
+ DELETING: "DELETING",
217
+ DELETION_FAILED: "DELETION_FAILED",
218
+ UPDATE_FAILED: "UPDATE_FAILED",
219
+ UPDATING: "UPDATING",
220
+ };
184
221
  export const WorkspaceStatusCode = {
185
222
  ACTIVE: "ACTIVE",
186
223
  CREATING: "CREATING",
@@ -0,0 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
2
+ import { AmpClient } from "../AmpClient";
3
+ import { ListAnomalyDetectorsCommand, } from "../commands/ListAnomalyDetectorsCommand";
4
+ export const paginateListAnomalyDetectors = createPaginator(AmpClient, ListAnomalyDetectorsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,4 +1,5 @@
1
1
  export * from "./Interfaces";
2
+ export * from "./ListAnomalyDetectorsPaginator";
2
3
  export * from "./ListRuleGroupsNamespacesPaginator";
3
4
  export * from "./ListScrapersPaginator";
4
5
  export * from "./ListWorkspacesPaginator";
@@ -1,9 +1,9 @@
1
1
  import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
2
  import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, convertMap, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { _json, collectBody, convertMap, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "@smithy/uuid";
5
5
  import { AmpServiceException as __BaseException } from "../models/AmpServiceException";
6
- import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ScrapeConfiguration, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
+ import { AccessDeniedException, AnomalyDetectorConfiguration, ConflictException, IgnoreNearExpected, InternalServerException, ResourceNotFoundException, ScrapeConfiguration, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
7
  export const se_CreateAlertManagerDefinitionCommand = async (input, context) => {
8
8
  const b = rb(input, context);
9
9
  const headers = {
@@ -19,6 +19,26 @@ export const se_CreateAlertManagerDefinitionCommand = async (input, context) =>
19
19
  b.m("POST").h(headers).b(body);
20
20
  return b.build();
21
21
  };
22
+ export const se_CreateAnomalyDetectorCommand = async (input, context) => {
23
+ const b = rb(input, context);
24
+ const headers = {
25
+ "content-type": "application/json",
26
+ };
27
+ b.bp("/workspaces/{workspaceId}/anomalydetectors");
28
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
29
+ let body;
30
+ body = JSON.stringify(take(input, {
31
+ alias: [],
32
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
33
+ configuration: (_) => se_AnomalyDetectorConfiguration(_, context),
34
+ evaluationIntervalInSeconds: [],
35
+ labels: (_) => _json(_),
36
+ missingDataAction: (_) => _json(_),
37
+ tags: (_) => _json(_),
38
+ }));
39
+ b.m("POST").h(headers).b(body);
40
+ return b.build();
41
+ };
22
42
  export const se_CreateLoggingConfigurationCommand = async (input, context) => {
23
43
  const b = rb(input, context);
24
44
  const headers = {
@@ -113,6 +133,19 @@ export const se_DeleteAlertManagerDefinitionCommand = async (input, context) =>
113
133
  b.m("DELETE").h(headers).q(query).b(body);
114
134
  return b.build();
115
135
  };
136
+ export const se_DeleteAnomalyDetectorCommand = async (input, context) => {
137
+ const b = rb(input, context);
138
+ const headers = {};
139
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
140
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
141
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
142
+ const query = map({
143
+ [_cT]: [, input[_cT] ?? generateIdempotencyToken()],
144
+ });
145
+ let body;
146
+ b.m("DELETE").h(headers).q(query).b(body);
147
+ return b.build();
148
+ };
116
149
  export const se_DeleteLoggingConfigurationCommand = async (input, context) => {
117
150
  const b = rb(input, context);
118
151
  const headers = {};
@@ -208,6 +241,16 @@ export const se_DescribeAlertManagerDefinitionCommand = async (input, context) =
208
241
  b.m("GET").h(headers).b(body);
209
242
  return b.build();
210
243
  };
244
+ export const se_DescribeAnomalyDetectorCommand = async (input, context) => {
245
+ const b = rb(input, context);
246
+ const headers = {};
247
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
248
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
249
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
250
+ let body;
251
+ b.m("GET").h(headers).b(body);
252
+ return b.build();
253
+ };
211
254
  export const se_DescribeLoggingConfigurationCommand = async (input, context) => {
212
255
  const b = rb(input, context);
213
256
  const headers = {};
@@ -289,6 +332,20 @@ export const se_GetDefaultScraperConfigurationCommand = async (input, context) =
289
332
  b.m("GET").h(headers).b(body);
290
333
  return b.build();
291
334
  };
335
+ export const se_ListAnomalyDetectorsCommand = async (input, context) => {
336
+ const b = rb(input, context);
337
+ const headers = {};
338
+ b.bp("/workspaces/{workspaceId}/anomalydetectors");
339
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
340
+ const query = map({
341
+ [_a]: [, input[_a]],
342
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
343
+ [_nT]: [, input[_nT]],
344
+ });
345
+ let body;
346
+ b.m("GET").h(headers).q(query).b(body);
347
+ return b.build();
348
+ };
292
349
  export const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
293
350
  const b = rb(input, context);
294
351
  const headers = {};
@@ -353,6 +410,25 @@ export const se_PutAlertManagerDefinitionCommand = async (input, context) => {
353
410
  b.m("PUT").h(headers).b(body);
354
411
  return b.build();
355
412
  };
413
+ export const se_PutAnomalyDetectorCommand = async (input, context) => {
414
+ const b = rb(input, context);
415
+ const headers = {
416
+ "content-type": "application/json",
417
+ };
418
+ b.bp("/workspaces/{workspaceId}/anomalydetectors/{anomalyDetectorId}");
419
+ b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
420
+ b.p("anomalyDetectorId", () => input.anomalyDetectorId, "{anomalyDetectorId}", false);
421
+ let body;
422
+ body = JSON.stringify(take(input, {
423
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
424
+ configuration: (_) => se_AnomalyDetectorConfiguration(_, context),
425
+ evaluationIntervalInSeconds: [],
426
+ labels: (_) => _json(_),
427
+ missingDataAction: (_) => _json(_),
428
+ }));
429
+ b.m("PUT").h(headers).b(body);
430
+ return b.build();
431
+ };
356
432
  export const se_PutResourcePolicyCommand = async (input, context) => {
357
433
  const b = rb(input, context);
358
434
  const headers = {
@@ -519,6 +595,23 @@ export const de_CreateAlertManagerDefinitionCommand = async (output, context) =>
519
595
  Object.assign(contents, doc);
520
596
  return contents;
521
597
  };
598
+ export const de_CreateAnomalyDetectorCommand = async (output, context) => {
599
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
600
+ return de_CommandError(output, context);
601
+ }
602
+ const contents = map({
603
+ $metadata: deserializeMetadata(output),
604
+ });
605
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
606
+ const doc = take(data, {
607
+ anomalyDetectorId: __expectString,
608
+ arn: __expectString,
609
+ status: _json,
610
+ tags: _json,
611
+ });
612
+ Object.assign(contents, doc);
613
+ return contents;
614
+ };
522
615
  export const de_CreateLoggingConfigurationCommand = async (output, context) => {
523
616
  if (output.statusCode !== 202 && output.statusCode >= 300) {
524
617
  return de_CommandError(output, context);
@@ -609,6 +702,16 @@ export const de_DeleteAlertManagerDefinitionCommand = async (output, context) =>
609
702
  await collectBody(output.body, context);
610
703
  return contents;
611
704
  };
705
+ export const de_DeleteAnomalyDetectorCommand = async (output, context) => {
706
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
707
+ return de_CommandError(output, context);
708
+ }
709
+ const contents = map({
710
+ $metadata: deserializeMetadata(output),
711
+ });
712
+ await collectBody(output.body, context);
713
+ return contents;
714
+ };
612
715
  export const de_DeleteLoggingConfigurationCommand = async (output, context) => {
613
716
  if (output.statusCode !== 202 && output.statusCode >= 300) {
614
717
  return de_CommandError(output, context);
@@ -698,6 +801,20 @@ export const de_DescribeAlertManagerDefinitionCommand = async (output, context)
698
801
  Object.assign(contents, doc);
699
802
  return contents;
700
803
  };
804
+ export const de_DescribeAnomalyDetectorCommand = async (output, context) => {
805
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
806
+ return de_CommandError(output, context);
807
+ }
808
+ const contents = map({
809
+ $metadata: deserializeMetadata(output),
810
+ });
811
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
812
+ const doc = take(data, {
813
+ anomalyDetector: (_) => de_AnomalyDetectorDescription(_, context),
814
+ });
815
+ Object.assign(contents, doc);
816
+ return contents;
817
+ };
701
818
  export const de_DescribeLoggingConfigurationCommand = async (output, context) => {
702
819
  if (output.statusCode !== 200 && output.statusCode >= 300) {
703
820
  return de_CommandError(output, context);
@@ -830,6 +947,21 @@ export const de_GetDefaultScraperConfigurationCommand = async (output, context)
830
947
  Object.assign(contents, doc);
831
948
  return contents;
832
949
  };
950
+ export const de_ListAnomalyDetectorsCommand = async (output, context) => {
951
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
952
+ return de_CommandError(output, context);
953
+ }
954
+ const contents = map({
955
+ $metadata: deserializeMetadata(output),
956
+ });
957
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
958
+ const doc = take(data, {
959
+ anomalyDetectors: (_) => de_AnomalyDetectorSummaryList(_, context),
960
+ nextToken: __expectString,
961
+ });
962
+ Object.assign(contents, doc);
963
+ return contents;
964
+ };
833
965
  export const de_ListRuleGroupsNamespacesCommand = async (output, context) => {
834
966
  if (output.statusCode !== 200 && output.statusCode >= 300) {
835
967
  return de_CommandError(output, context);
@@ -903,6 +1035,23 @@ export const de_PutAlertManagerDefinitionCommand = async (output, context) => {
903
1035
  Object.assign(contents, doc);
904
1036
  return contents;
905
1037
  };
1038
+ export const de_PutAnomalyDetectorCommand = async (output, context) => {
1039
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
1040
+ return de_CommandError(output, context);
1041
+ }
1042
+ const contents = map({
1043
+ $metadata: deserializeMetadata(output),
1044
+ });
1045
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1046
+ const doc = take(data, {
1047
+ anomalyDetectorId: __expectString,
1048
+ arn: __expectString,
1049
+ status: _json,
1050
+ tags: _json,
1051
+ });
1052
+ Object.assign(contents, doc);
1053
+ return contents;
1054
+ };
906
1055
  export const de_PutResourcePolicyCommand = async (output, context) => {
907
1056
  if (output.statusCode !== 202 && output.statusCode >= 300) {
908
1057
  return de_CommandError(output, context);
@@ -1183,6 +1332,28 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1183
1332
  });
1184
1333
  return __decorateServiceException(exception, parsedOutput.body);
1185
1334
  };
1335
+ const se_AnomalyDetectorConfiguration = (input, context) => {
1336
+ return AnomalyDetectorConfiguration.visit(input, {
1337
+ randomCutForest: (value) => ({ randomCutForest: se_RandomCutForestConfiguration(value, context) }),
1338
+ _: (name, value) => ({ [name]: value }),
1339
+ });
1340
+ };
1341
+ const se_IgnoreNearExpected = (input, context) => {
1342
+ return IgnoreNearExpected.visit(input, {
1343
+ amount: (value) => ({ amount: __serializeFloat(value) }),
1344
+ ratio: (value) => ({ ratio: __serializeFloat(value) }),
1345
+ _: (name, value) => ({ [name]: value }),
1346
+ });
1347
+ };
1348
+ const se_RandomCutForestConfiguration = (input, context) => {
1349
+ return take(input, {
1350
+ ignoreNearExpectedFromAbove: (_) => se_IgnoreNearExpected(_, context),
1351
+ ignoreNearExpectedFromBelow: (_) => se_IgnoreNearExpected(_, context),
1352
+ query: [],
1353
+ sampleSize: [],
1354
+ shingleSize: [],
1355
+ });
1356
+ };
1186
1357
  const se_ScrapeConfiguration = (input, context) => {
1187
1358
  return ScrapeConfiguration.visit(input, {
1188
1359
  configurationBlob: (value) => ({ configurationBlob: context.base64Encoder(value) }),
@@ -1197,6 +1368,57 @@ const de_AlertManagerDefinitionDescription = (output, context) => {
1197
1368
  status: _json,
1198
1369
  });
1199
1370
  };
1371
+ const de_AnomalyDetectorConfiguration = (output, context) => {
1372
+ if (output.randomCutForest != null) {
1373
+ return {
1374
+ randomCutForest: de_RandomCutForestConfiguration(output.randomCutForest, context),
1375
+ };
1376
+ }
1377
+ return { $unknown: Object.entries(output)[0] };
1378
+ };
1379
+ const de_AnomalyDetectorDescription = (output, context) => {
1380
+ return take(output, {
1381
+ alias: __expectString,
1382
+ anomalyDetectorId: __expectString,
1383
+ arn: __expectString,
1384
+ configuration: (_) => de_AnomalyDetectorConfiguration(__expectUnion(_), context),
1385
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1386
+ evaluationIntervalInSeconds: __expectInt32,
1387
+ labels: _json,
1388
+ missingDataAction: (_) => _json(__expectUnion(_)),
1389
+ modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1390
+ status: _json,
1391
+ tags: _json,
1392
+ });
1393
+ };
1394
+ const de_AnomalyDetectorSummary = (output, context) => {
1395
+ return take(output, {
1396
+ alias: __expectString,
1397
+ anomalyDetectorId: __expectString,
1398
+ arn: __expectString,
1399
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1400
+ modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1401
+ status: _json,
1402
+ tags: _json,
1403
+ });
1404
+ };
1405
+ const de_AnomalyDetectorSummaryList = (output, context) => {
1406
+ const retVal = (output || [])
1407
+ .filter((e) => e != null)
1408
+ .map((entry) => {
1409
+ return de_AnomalyDetectorSummary(entry, context);
1410
+ });
1411
+ return retVal;
1412
+ };
1413
+ const de_IgnoreNearExpected = (output, context) => {
1414
+ if (__limitedParseDouble(output.amount) !== undefined) {
1415
+ return { amount: __limitedParseDouble(output.amount) };
1416
+ }
1417
+ if (__limitedParseDouble(output.ratio) !== undefined) {
1418
+ return { ratio: __limitedParseDouble(output.ratio) };
1419
+ }
1420
+ return { $unknown: Object.entries(output)[0] };
1421
+ };
1200
1422
  const de_LoggingConfigurationMetadata = (output, context) => {
1201
1423
  return take(output, {
1202
1424
  createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -1215,6 +1437,15 @@ const de_QueryLoggingConfigurationMetadata = (output, context) => {
1215
1437
  workspace: __expectString,
1216
1438
  });
1217
1439
  };
1440
+ const de_RandomCutForestConfiguration = (output, context) => {
1441
+ return take(output, {
1442
+ ignoreNearExpectedFromAbove: (_) => de_IgnoreNearExpected(__expectUnion(_), context),
1443
+ ignoreNearExpectedFromBelow: (_) => de_IgnoreNearExpected(__expectUnion(_), context),
1444
+ query: __expectString,
1445
+ sampleSize: __expectInt32,
1446
+ shingleSize: __expectInt32,
1447
+ });
1448
+ };
1218
1449
  const de_RuleGroupsNamespaceDescription = (output, context) => {
1219
1450
  return take(output, {
1220
1451
  arn: __expectString,
@@ -1,3 +1,5 @@
1
+ export * from "./waitForAnomalyDetectorActive";
2
+ export * from "./waitForAnomalyDetectorDeleted";
1
3
  export * from "./waitForScraperActive";
2
4
  export * from "./waitForScraperDeleted";
3
5
  export * from "./waitForWorkspaceActive";
@@ -0,0 +1,49 @@
1
+ import { checkExceptions, createWaiter, WaiterState } from "@smithy/util-waiter";
2
+ import { DescribeAnomalyDetectorCommand, } from "../commands/DescribeAnomalyDetectorCommand";
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new DescribeAnomalyDetectorCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.anomalyDetector.status.statusCode;
11
+ };
12
+ if (returnComparator() === "ACTIVE") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
15
+ }
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.anomalyDetector.status.statusCode;
20
+ };
21
+ if (returnComparator() === "CREATING") {
22
+ return { state: WaiterState.RETRY, reason };
23
+ }
24
+ }
25
+ catch (e) { }
26
+ try {
27
+ const returnComparator = () => {
28
+ return result.anomalyDetector.status.statusCode;
29
+ };
30
+ if (returnComparator() === "UPDATING") {
31
+ return { state: WaiterState.RETRY, reason };
32
+ }
33
+ }
34
+ catch (e) { }
35
+ }
36
+ catch (exception) {
37
+ reason = exception;
38
+ }
39
+ return { state: WaiterState.RETRY, reason };
40
+ };
41
+ export const waitForAnomalyDetectorActive = async (params, input) => {
42
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
43
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
44
+ };
45
+ export const waitUntilAnomalyDetectorActive = async (params, input) => {
46
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
47
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
48
+ return checkExceptions(result);
49
+ };