@aws-sdk/client-cloudwatch 3.145.0 → 3.153.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.
- package/CHANGELOG.md +30 -0
- package/dist-cjs/CloudWatch.js +30 -0
- package/dist-cjs/commands/ListManagedInsightRulesCommand.js +36 -0
- package/dist-cjs/commands/PutManagedInsightRulesCommand.js +36 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/models/models_0.js +30 -2
- package/dist-cjs/pagination/DescribeAnomalyDetectorsPaginator.js +36 -0
- package/dist-cjs/pagination/ListManagedInsightRulesPaginator.js +36 -0
- package/dist-cjs/pagination/index.js +2 -0
- package/dist-cjs/protocols/Aws_query.js +230 -2
- package/dist-es/CloudWatch.js +30 -0
- package/dist-es/commands/ListManagedInsightRulesCommand.js +39 -0
- package/dist-es/commands/PutManagedInsightRulesCommand.js +39 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +7 -0
- package/dist-es/pagination/DescribeAnomalyDetectorsPaginator.js +75 -0
- package/dist-es/pagination/ListManagedInsightRulesPaginator.js +75 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_query.js +345 -72
- package/dist-types/CloudWatch.d.ts +48 -4
- package/dist-types/CloudWatchClient.d.ts +4 -2
- package/dist-types/commands/DeleteAnomalyDetectorCommand.d.ts +9 -1
- package/dist-types/commands/ListManagedInsightRulesCommand.d.ts +41 -0
- package/dist-types/commands/PutManagedInsightRulesCommand.d.ts +51 -0
- package/dist-types/commands/PutMetricDataCommand.d.ts +3 -3
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +242 -14
- package/dist-types/pagination/DescribeAnomalyDetectorsPaginator.d.ts +4 -0
- package/dist-types/pagination/ListManagedInsightRulesPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_query.d.ts +6 -0
- package/dist-types/ts3.4/CloudWatch.d.ts +10 -0
- package/dist-types/ts3.4/CloudWatchClient.d.ts +4 -2
- package/dist-types/ts3.4/commands/ListManagedInsightRulesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/PutManagedInsightRulesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +63 -0
- package/dist-types/ts3.4/pagination/DescribeAnomalyDetectorsPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListManagedInsightRulesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_query.d.ts +6 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.deserializeAws_queryUntagResourceCommand = exports.deserializeAws_queryTagResourceCommand = exports.deserializeAws_queryStopMetricStreamsCommand = exports.deserializeAws_queryStartMetricStreamsCommand = exports.deserializeAws_querySetAlarmStateCommand = exports.deserializeAws_queryPutMetricStreamCommand = exports.deserializeAws_queryPutMetricDataCommand = exports.deserializeAws_queryPutMetricAlarmCommand = exports.deserializeAws_queryPutInsightRuleCommand = exports.deserializeAws_queryPutDashboardCommand = exports.deserializeAws_queryPutCompositeAlarmCommand = exports.deserializeAws_queryPutAnomalyDetectorCommand = exports.deserializeAws_queryListTagsForResourceCommand = exports.deserializeAws_queryListMetricStreamsCommand = exports.deserializeAws_queryListMetricsCommand = exports.deserializeAws_queryListDashboardsCommand = exports.deserializeAws_queryGetMetricWidgetImageCommand = exports.deserializeAws_queryGetMetricStreamCommand = exports.deserializeAws_queryGetMetricStatisticsCommand = exports.deserializeAws_queryGetMetricDataCommand = exports.deserializeAws_queryGetInsightRuleReportCommand = exports.deserializeAws_queryGetDashboardCommand = void 0;
|
|
3
|
+
exports.deserializeAws_queryDisableInsightRulesCommand = exports.deserializeAws_queryDisableAlarmActionsCommand = exports.deserializeAws_queryDescribeInsightRulesCommand = exports.deserializeAws_queryDescribeAnomalyDetectorsCommand = exports.deserializeAws_queryDescribeAlarmsForMetricCommand = exports.deserializeAws_queryDescribeAlarmsCommand = exports.deserializeAws_queryDescribeAlarmHistoryCommand = exports.deserializeAws_queryDeleteMetricStreamCommand = exports.deserializeAws_queryDeleteInsightRulesCommand = exports.deserializeAws_queryDeleteDashboardsCommand = exports.deserializeAws_queryDeleteAnomalyDetectorCommand = exports.deserializeAws_queryDeleteAlarmsCommand = exports.serializeAws_queryUntagResourceCommand = exports.serializeAws_queryTagResourceCommand = exports.serializeAws_queryStopMetricStreamsCommand = exports.serializeAws_queryStartMetricStreamsCommand = exports.serializeAws_querySetAlarmStateCommand = exports.serializeAws_queryPutMetricStreamCommand = exports.serializeAws_queryPutMetricDataCommand = exports.serializeAws_queryPutMetricAlarmCommand = exports.serializeAws_queryPutManagedInsightRulesCommand = exports.serializeAws_queryPutInsightRuleCommand = exports.serializeAws_queryPutDashboardCommand = exports.serializeAws_queryPutCompositeAlarmCommand = exports.serializeAws_queryPutAnomalyDetectorCommand = exports.serializeAws_queryListTagsForResourceCommand = exports.serializeAws_queryListMetricStreamsCommand = exports.serializeAws_queryListMetricsCommand = exports.serializeAws_queryListManagedInsightRulesCommand = exports.serializeAws_queryListDashboardsCommand = exports.serializeAws_queryGetMetricWidgetImageCommand = exports.serializeAws_queryGetMetricStreamCommand = exports.serializeAws_queryGetMetricStatisticsCommand = exports.serializeAws_queryGetMetricDataCommand = exports.serializeAws_queryGetInsightRuleReportCommand = exports.serializeAws_queryGetDashboardCommand = exports.serializeAws_queryEnableInsightRulesCommand = exports.serializeAws_queryEnableAlarmActionsCommand = exports.serializeAws_queryDisableInsightRulesCommand = exports.serializeAws_queryDisableAlarmActionsCommand = exports.serializeAws_queryDescribeInsightRulesCommand = exports.serializeAws_queryDescribeAnomalyDetectorsCommand = exports.serializeAws_queryDescribeAlarmsForMetricCommand = exports.serializeAws_queryDescribeAlarmsCommand = exports.serializeAws_queryDescribeAlarmHistoryCommand = exports.serializeAws_queryDeleteMetricStreamCommand = exports.serializeAws_queryDeleteInsightRulesCommand = exports.serializeAws_queryDeleteDashboardsCommand = exports.serializeAws_queryDeleteAnomalyDetectorCommand = exports.serializeAws_queryDeleteAlarmsCommand = void 0;
|
|
4
|
+
exports.deserializeAws_queryUntagResourceCommand = exports.deserializeAws_queryTagResourceCommand = exports.deserializeAws_queryStopMetricStreamsCommand = exports.deserializeAws_queryStartMetricStreamsCommand = exports.deserializeAws_querySetAlarmStateCommand = exports.deserializeAws_queryPutMetricStreamCommand = exports.deserializeAws_queryPutMetricDataCommand = exports.deserializeAws_queryPutMetricAlarmCommand = exports.deserializeAws_queryPutManagedInsightRulesCommand = exports.deserializeAws_queryPutInsightRuleCommand = exports.deserializeAws_queryPutDashboardCommand = exports.deserializeAws_queryPutCompositeAlarmCommand = exports.deserializeAws_queryPutAnomalyDetectorCommand = exports.deserializeAws_queryListTagsForResourceCommand = exports.deserializeAws_queryListMetricStreamsCommand = exports.deserializeAws_queryListMetricsCommand = exports.deserializeAws_queryListManagedInsightRulesCommand = exports.deserializeAws_queryListDashboardsCommand = exports.deserializeAws_queryGetMetricWidgetImageCommand = exports.deserializeAws_queryGetMetricStreamCommand = exports.deserializeAws_queryGetMetricStatisticsCommand = exports.deserializeAws_queryGetMetricDataCommand = exports.deserializeAws_queryGetInsightRuleReportCommand = exports.deserializeAws_queryGetDashboardCommand = exports.deserializeAws_queryEnableInsightRulesCommand = exports.deserializeAws_queryEnableAlarmActionsCommand = void 0;
|
|
5
5
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
6
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
7
7
|
const entities_1 = require("entities");
|
|
@@ -281,6 +281,19 @@ const serializeAws_queryListDashboardsCommand = async (input, context) => {
|
|
|
281
281
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
282
282
|
};
|
|
283
283
|
exports.serializeAws_queryListDashboardsCommand = serializeAws_queryListDashboardsCommand;
|
|
284
|
+
const serializeAws_queryListManagedInsightRulesCommand = async (input, context) => {
|
|
285
|
+
const headers = {
|
|
286
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
287
|
+
};
|
|
288
|
+
let body;
|
|
289
|
+
body = buildFormUrlencodedString({
|
|
290
|
+
...serializeAws_queryListManagedInsightRulesInput(input, context),
|
|
291
|
+
Action: "ListManagedInsightRules",
|
|
292
|
+
Version: "2010-08-01",
|
|
293
|
+
});
|
|
294
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
295
|
+
};
|
|
296
|
+
exports.serializeAws_queryListManagedInsightRulesCommand = serializeAws_queryListManagedInsightRulesCommand;
|
|
284
297
|
const serializeAws_queryListMetricsCommand = async (input, context) => {
|
|
285
298
|
const headers = {
|
|
286
299
|
"content-type": "application/x-www-form-urlencoded",
|
|
@@ -372,6 +385,19 @@ const serializeAws_queryPutInsightRuleCommand = async (input, context) => {
|
|
|
372
385
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
373
386
|
};
|
|
374
387
|
exports.serializeAws_queryPutInsightRuleCommand = serializeAws_queryPutInsightRuleCommand;
|
|
388
|
+
const serializeAws_queryPutManagedInsightRulesCommand = async (input, context) => {
|
|
389
|
+
const headers = {
|
|
390
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
391
|
+
};
|
|
392
|
+
let body;
|
|
393
|
+
body = buildFormUrlencodedString({
|
|
394
|
+
...serializeAws_queryPutManagedInsightRulesInput(input, context),
|
|
395
|
+
Action: "PutManagedInsightRules",
|
|
396
|
+
Version: "2010-08-01",
|
|
397
|
+
});
|
|
398
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
399
|
+
};
|
|
400
|
+
exports.serializeAws_queryPutManagedInsightRulesCommand = serializeAws_queryPutManagedInsightRulesCommand;
|
|
375
401
|
const serializeAws_queryPutMetricAlarmCommand = async (input, context) => {
|
|
376
402
|
const headers = {
|
|
377
403
|
"content-type": "application/x-www-form-urlencoded",
|
|
@@ -1238,6 +1264,46 @@ const deserializeAws_queryListDashboardsCommandError = async (output, context) =
|
|
|
1238
1264
|
});
|
|
1239
1265
|
}
|
|
1240
1266
|
};
|
|
1267
|
+
const deserializeAws_queryListManagedInsightRulesCommand = async (output, context) => {
|
|
1268
|
+
if (output.statusCode >= 300) {
|
|
1269
|
+
return deserializeAws_queryListManagedInsightRulesCommandError(output, context);
|
|
1270
|
+
}
|
|
1271
|
+
const data = await parseBody(output.body, context);
|
|
1272
|
+
let contents = {};
|
|
1273
|
+
contents = deserializeAws_queryListManagedInsightRulesOutput(data.ListManagedInsightRulesResult, context);
|
|
1274
|
+
const response = {
|
|
1275
|
+
$metadata: deserializeMetadata(output),
|
|
1276
|
+
...contents,
|
|
1277
|
+
};
|
|
1278
|
+
return Promise.resolve(response);
|
|
1279
|
+
};
|
|
1280
|
+
exports.deserializeAws_queryListManagedInsightRulesCommand = deserializeAws_queryListManagedInsightRulesCommand;
|
|
1281
|
+
const deserializeAws_queryListManagedInsightRulesCommandError = async (output, context) => {
|
|
1282
|
+
const parsedOutput = {
|
|
1283
|
+
...output,
|
|
1284
|
+
body: await parseBody(output.body, context),
|
|
1285
|
+
};
|
|
1286
|
+
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
1287
|
+
switch (errorCode) {
|
|
1288
|
+
case "InvalidNextToken":
|
|
1289
|
+
case "com.amazonaws.cloudwatch#InvalidNextToken":
|
|
1290
|
+
throw await deserializeAws_queryInvalidNextTokenResponse(parsedOutput, context);
|
|
1291
|
+
case "InvalidParameterValueException":
|
|
1292
|
+
case "com.amazonaws.cloudwatch#InvalidParameterValueException":
|
|
1293
|
+
throw await deserializeAws_queryInvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
1294
|
+
case "MissingRequiredParameterException":
|
|
1295
|
+
case "com.amazonaws.cloudwatch#MissingRequiredParameterException":
|
|
1296
|
+
throw await deserializeAws_queryMissingRequiredParameterExceptionResponse(parsedOutput, context);
|
|
1297
|
+
default:
|
|
1298
|
+
const parsedBody = parsedOutput.body;
|
|
1299
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
1300
|
+
output,
|
|
1301
|
+
parsedBody: parsedBody.Error,
|
|
1302
|
+
exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
|
|
1303
|
+
errorCode,
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1241
1307
|
const deserializeAws_queryListMetricsCommand = async (output, context) => {
|
|
1242
1308
|
if (output.statusCode >= 300) {
|
|
1243
1309
|
return deserializeAws_queryListMetricsCommandError(output, context);
|
|
@@ -1512,6 +1578,43 @@ const deserializeAws_queryPutInsightRuleCommandError = async (output, context) =
|
|
|
1512
1578
|
});
|
|
1513
1579
|
}
|
|
1514
1580
|
};
|
|
1581
|
+
const deserializeAws_queryPutManagedInsightRulesCommand = async (output, context) => {
|
|
1582
|
+
if (output.statusCode >= 300) {
|
|
1583
|
+
return deserializeAws_queryPutManagedInsightRulesCommandError(output, context);
|
|
1584
|
+
}
|
|
1585
|
+
const data = await parseBody(output.body, context);
|
|
1586
|
+
let contents = {};
|
|
1587
|
+
contents = deserializeAws_queryPutManagedInsightRulesOutput(data.PutManagedInsightRulesResult, context);
|
|
1588
|
+
const response = {
|
|
1589
|
+
$metadata: deserializeMetadata(output),
|
|
1590
|
+
...contents,
|
|
1591
|
+
};
|
|
1592
|
+
return Promise.resolve(response);
|
|
1593
|
+
};
|
|
1594
|
+
exports.deserializeAws_queryPutManagedInsightRulesCommand = deserializeAws_queryPutManagedInsightRulesCommand;
|
|
1595
|
+
const deserializeAws_queryPutManagedInsightRulesCommandError = async (output, context) => {
|
|
1596
|
+
const parsedOutput = {
|
|
1597
|
+
...output,
|
|
1598
|
+
body: await parseBody(output.body, context),
|
|
1599
|
+
};
|
|
1600
|
+
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
1601
|
+
switch (errorCode) {
|
|
1602
|
+
case "InvalidParameterValueException":
|
|
1603
|
+
case "com.amazonaws.cloudwatch#InvalidParameterValueException":
|
|
1604
|
+
throw await deserializeAws_queryInvalidParameterValueExceptionResponse(parsedOutput, context);
|
|
1605
|
+
case "MissingRequiredParameterException":
|
|
1606
|
+
case "com.amazonaws.cloudwatch#MissingRequiredParameterException":
|
|
1607
|
+
throw await deserializeAws_queryMissingRequiredParameterExceptionResponse(parsedOutput, context);
|
|
1608
|
+
default:
|
|
1609
|
+
const parsedBody = parsedOutput.body;
|
|
1610
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
1611
|
+
output,
|
|
1612
|
+
parsedBody: parsedBody.Error,
|
|
1613
|
+
exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
|
|
1614
|
+
errorCode,
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1515
1618
|
const deserializeAws_queryPutMetricAlarmCommand = async (output, context) => {
|
|
1516
1619
|
if (output.statusCode >= 300) {
|
|
1517
1620
|
return deserializeAws_queryPutMetricAlarmCommandError(output, context);
|
|
@@ -2525,6 +2628,19 @@ const serializeAws_queryListDashboardsInput = (input, context) => {
|
|
|
2525
2628
|
}
|
|
2526
2629
|
return entries;
|
|
2527
2630
|
};
|
|
2631
|
+
const serializeAws_queryListManagedInsightRulesInput = (input, context) => {
|
|
2632
|
+
const entries = {};
|
|
2633
|
+
if (input.ResourceARN != null) {
|
|
2634
|
+
entries["ResourceARN"] = input.ResourceARN;
|
|
2635
|
+
}
|
|
2636
|
+
if (input.NextToken != null) {
|
|
2637
|
+
entries["NextToken"] = input.NextToken;
|
|
2638
|
+
}
|
|
2639
|
+
if (input.MaxResults != null) {
|
|
2640
|
+
entries["MaxResults"] = input.MaxResults;
|
|
2641
|
+
}
|
|
2642
|
+
return entries;
|
|
2643
|
+
};
|
|
2528
2644
|
const serializeAws_queryListMetricsInput = (input, context) => {
|
|
2529
2645
|
const entries = {};
|
|
2530
2646
|
if (input.Namespace != null) {
|
|
@@ -2565,6 +2681,38 @@ const serializeAws_queryListTagsForResourceInput = (input, context) => {
|
|
|
2565
2681
|
}
|
|
2566
2682
|
return entries;
|
|
2567
2683
|
};
|
|
2684
|
+
const serializeAws_queryManagedRule = (input, context) => {
|
|
2685
|
+
const entries = {};
|
|
2686
|
+
if (input.TemplateName != null) {
|
|
2687
|
+
entries["TemplateName"] = input.TemplateName;
|
|
2688
|
+
}
|
|
2689
|
+
if (input.ResourceARN != null) {
|
|
2690
|
+
entries["ResourceARN"] = input.ResourceARN;
|
|
2691
|
+
}
|
|
2692
|
+
if (input.Tags != null) {
|
|
2693
|
+
const memberEntries = serializeAws_queryTagList(input.Tags, context);
|
|
2694
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
2695
|
+
const loc = `Tags.${key}`;
|
|
2696
|
+
entries[loc] = value;
|
|
2697
|
+
});
|
|
2698
|
+
}
|
|
2699
|
+
return entries;
|
|
2700
|
+
};
|
|
2701
|
+
const serializeAws_queryManagedRules = (input, context) => {
|
|
2702
|
+
const entries = {};
|
|
2703
|
+
let counter = 1;
|
|
2704
|
+
for (const entry of input) {
|
|
2705
|
+
if (entry === null) {
|
|
2706
|
+
continue;
|
|
2707
|
+
}
|
|
2708
|
+
const memberEntries = serializeAws_queryManagedRule(entry, context);
|
|
2709
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
2710
|
+
entries[`member.${counter}.${key}`] = value;
|
|
2711
|
+
});
|
|
2712
|
+
counter++;
|
|
2713
|
+
}
|
|
2714
|
+
return entries;
|
|
2715
|
+
};
|
|
2568
2716
|
const serializeAws_queryMetric = (input, context) => {
|
|
2569
2717
|
const entries = {};
|
|
2570
2718
|
if (input.Namespace != null) {
|
|
@@ -2947,6 +3095,17 @@ const serializeAws_queryPutInsightRuleInput = (input, context) => {
|
|
|
2947
3095
|
}
|
|
2948
3096
|
return entries;
|
|
2949
3097
|
};
|
|
3098
|
+
const serializeAws_queryPutManagedInsightRulesInput = (input, context) => {
|
|
3099
|
+
const entries = {};
|
|
3100
|
+
if (input.ManagedRules != null) {
|
|
3101
|
+
const memberEntries = serializeAws_queryManagedRules(input.ManagedRules, context);
|
|
3102
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
3103
|
+
const loc = `ManagedRules.${key}`;
|
|
3104
|
+
entries[loc] = value;
|
|
3105
|
+
});
|
|
3106
|
+
}
|
|
3107
|
+
return entries;
|
|
3108
|
+
};
|
|
2950
3109
|
const serializeAws_queryPutMetricAlarmInput = (input, context) => {
|
|
2951
3110
|
const entries = {};
|
|
2952
3111
|
if (input.AlarmName != null) {
|
|
@@ -3962,6 +4121,7 @@ const deserializeAws_queryInsightRule = (output, context) => {
|
|
|
3962
4121
|
State: undefined,
|
|
3963
4122
|
Schema: undefined,
|
|
3964
4123
|
Definition: undefined,
|
|
4124
|
+
ManagedRule: undefined,
|
|
3965
4125
|
};
|
|
3966
4126
|
if (output["Name"] !== undefined) {
|
|
3967
4127
|
contents.Name = (0, smithy_client_1.expectString)(output["Name"]);
|
|
@@ -3975,6 +4135,9 @@ const deserializeAws_queryInsightRule = (output, context) => {
|
|
|
3975
4135
|
if (output["Definition"] !== undefined) {
|
|
3976
4136
|
contents.Definition = (0, smithy_client_1.expectString)(output["Definition"]);
|
|
3977
4137
|
}
|
|
4138
|
+
if (output["ManagedRule"] !== undefined) {
|
|
4139
|
+
contents.ManagedRule = (0, smithy_client_1.parseBoolean)(output["ManagedRule"]);
|
|
4140
|
+
}
|
|
3978
4141
|
return contents;
|
|
3979
4142
|
};
|
|
3980
4143
|
const deserializeAws_queryInsightRuleContributor = (output, context) => {
|
|
@@ -4171,6 +4334,22 @@ const deserializeAws_queryListDashboardsOutput = (output, context) => {
|
|
|
4171
4334
|
}
|
|
4172
4335
|
return contents;
|
|
4173
4336
|
};
|
|
4337
|
+
const deserializeAws_queryListManagedInsightRulesOutput = (output, context) => {
|
|
4338
|
+
const contents = {
|
|
4339
|
+
ManagedRules: undefined,
|
|
4340
|
+
NextToken: undefined,
|
|
4341
|
+
};
|
|
4342
|
+
if (output.ManagedRules === "") {
|
|
4343
|
+
contents.ManagedRules = [];
|
|
4344
|
+
}
|
|
4345
|
+
else if (output["ManagedRules"] !== undefined && output["ManagedRules"]["member"] !== undefined) {
|
|
4346
|
+
contents.ManagedRules = deserializeAws_queryManagedRuleDescriptions((0, smithy_client_1.getArrayIfSingleItem)(output["ManagedRules"]["member"]), context);
|
|
4347
|
+
}
|
|
4348
|
+
if (output["NextToken"] !== undefined) {
|
|
4349
|
+
contents.NextToken = (0, smithy_client_1.expectString)(output["NextToken"]);
|
|
4350
|
+
}
|
|
4351
|
+
return contents;
|
|
4352
|
+
};
|
|
4174
4353
|
const deserializeAws_queryListMetricsOutput = (output, context) => {
|
|
4175
4354
|
const contents = {
|
|
4176
4355
|
Metrics: undefined,
|
|
@@ -4215,6 +4394,43 @@ const deserializeAws_queryListTagsForResourceOutput = (output, context) => {
|
|
|
4215
4394
|
}
|
|
4216
4395
|
return contents;
|
|
4217
4396
|
};
|
|
4397
|
+
const deserializeAws_queryManagedRuleDescription = (output, context) => {
|
|
4398
|
+
const contents = {
|
|
4399
|
+
TemplateName: undefined,
|
|
4400
|
+
ResourceARN: undefined,
|
|
4401
|
+
RuleState: undefined,
|
|
4402
|
+
};
|
|
4403
|
+
if (output["TemplateName"] !== undefined) {
|
|
4404
|
+
contents.TemplateName = (0, smithy_client_1.expectString)(output["TemplateName"]);
|
|
4405
|
+
}
|
|
4406
|
+
if (output["ResourceARN"] !== undefined) {
|
|
4407
|
+
contents.ResourceARN = (0, smithy_client_1.expectString)(output["ResourceARN"]);
|
|
4408
|
+
}
|
|
4409
|
+
if (output["RuleState"] !== undefined) {
|
|
4410
|
+
contents.RuleState = deserializeAws_queryManagedRuleState(output["RuleState"], context);
|
|
4411
|
+
}
|
|
4412
|
+
return contents;
|
|
4413
|
+
};
|
|
4414
|
+
const deserializeAws_queryManagedRuleDescriptions = (output, context) => {
|
|
4415
|
+
return (output || [])
|
|
4416
|
+
.filter((e) => e != null)
|
|
4417
|
+
.map((entry) => {
|
|
4418
|
+
return deserializeAws_queryManagedRuleDescription(entry, context);
|
|
4419
|
+
});
|
|
4420
|
+
};
|
|
4421
|
+
const deserializeAws_queryManagedRuleState = (output, context) => {
|
|
4422
|
+
const contents = {
|
|
4423
|
+
RuleName: undefined,
|
|
4424
|
+
State: undefined,
|
|
4425
|
+
};
|
|
4426
|
+
if (output["RuleName"] !== undefined) {
|
|
4427
|
+
contents.RuleName = (0, smithy_client_1.expectString)(output["RuleName"]);
|
|
4428
|
+
}
|
|
4429
|
+
if (output["State"] !== undefined) {
|
|
4430
|
+
contents.State = (0, smithy_client_1.expectString)(output["State"]);
|
|
4431
|
+
}
|
|
4432
|
+
return contents;
|
|
4433
|
+
};
|
|
4218
4434
|
const deserializeAws_queryMessageData = (output, context) => {
|
|
4219
4435
|
const contents = {
|
|
4220
4436
|
Code: undefined,
|
|
@@ -4676,6 +4892,18 @@ const deserializeAws_queryPutInsightRuleOutput = (output, context) => {
|
|
|
4676
4892
|
const contents = {};
|
|
4677
4893
|
return contents;
|
|
4678
4894
|
};
|
|
4895
|
+
const deserializeAws_queryPutManagedInsightRulesOutput = (output, context) => {
|
|
4896
|
+
const contents = {
|
|
4897
|
+
Failures: undefined,
|
|
4898
|
+
};
|
|
4899
|
+
if (output.Failures === "") {
|
|
4900
|
+
contents.Failures = [];
|
|
4901
|
+
}
|
|
4902
|
+
else if (output["Failures"] !== undefined && output["Failures"]["member"] !== undefined) {
|
|
4903
|
+
contents.Failures = deserializeAws_queryBatchFailures((0, smithy_client_1.getArrayIfSingleItem)(output["Failures"]["member"]), context);
|
|
4904
|
+
}
|
|
4905
|
+
return contents;
|
|
4906
|
+
};
|
|
4679
4907
|
const deserializeAws_queryPutMetricStreamOutput = (output, context) => {
|
|
4680
4908
|
const contents = {
|
|
4681
4909
|
Arn: undefined,
|
package/dist-es/CloudWatch.js
CHANGED
|
@@ -21,6 +21,7 @@ import { GetMetricStatisticsCommand, } from "./commands/GetMetricStatisticsComma
|
|
|
21
21
|
import { GetMetricStreamCommand, } from "./commands/GetMetricStreamCommand";
|
|
22
22
|
import { GetMetricWidgetImageCommand, } from "./commands/GetMetricWidgetImageCommand";
|
|
23
23
|
import { ListDashboardsCommand, } from "./commands/ListDashboardsCommand";
|
|
24
|
+
import { ListManagedInsightRulesCommand, } from "./commands/ListManagedInsightRulesCommand";
|
|
24
25
|
import { ListMetricsCommand } from "./commands/ListMetricsCommand";
|
|
25
26
|
import { ListMetricStreamsCommand, } from "./commands/ListMetricStreamsCommand";
|
|
26
27
|
import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
|
|
@@ -28,6 +29,7 @@ import { PutAnomalyDetectorCommand, } from "./commands/PutAnomalyDetectorCommand
|
|
|
28
29
|
import { PutCompositeAlarmCommand, } from "./commands/PutCompositeAlarmCommand";
|
|
29
30
|
import { PutDashboardCommand, } from "./commands/PutDashboardCommand";
|
|
30
31
|
import { PutInsightRuleCommand, } from "./commands/PutInsightRuleCommand";
|
|
32
|
+
import { PutManagedInsightRulesCommand, } from "./commands/PutManagedInsightRulesCommand";
|
|
31
33
|
import { PutMetricAlarmCommand, } from "./commands/PutMetricAlarmCommand";
|
|
32
34
|
import { PutMetricDataCommand, } from "./commands/PutMetricDataCommand";
|
|
33
35
|
import { PutMetricStreamCommand, } from "./commands/PutMetricStreamCommand";
|
|
@@ -335,6 +337,20 @@ var CloudWatch = (function (_super) {
|
|
|
335
337
|
return this.send(command, optionsOrCb);
|
|
336
338
|
}
|
|
337
339
|
};
|
|
340
|
+
CloudWatch.prototype.listManagedInsightRules = function (args, optionsOrCb, cb) {
|
|
341
|
+
var command = new ListManagedInsightRulesCommand(args);
|
|
342
|
+
if (typeof optionsOrCb === "function") {
|
|
343
|
+
this.send(command, optionsOrCb);
|
|
344
|
+
}
|
|
345
|
+
else if (typeof cb === "function") {
|
|
346
|
+
if (typeof optionsOrCb !== "object")
|
|
347
|
+
throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
|
|
348
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
return this.send(command, optionsOrCb);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
338
354
|
CloudWatch.prototype.listMetrics = function (args, optionsOrCb, cb) {
|
|
339
355
|
var command = new ListMetricsCommand(args);
|
|
340
356
|
if (typeof optionsOrCb === "function") {
|
|
@@ -433,6 +449,20 @@ var CloudWatch = (function (_super) {
|
|
|
433
449
|
return this.send(command, optionsOrCb);
|
|
434
450
|
}
|
|
435
451
|
};
|
|
452
|
+
CloudWatch.prototype.putManagedInsightRules = function (args, optionsOrCb, cb) {
|
|
453
|
+
var command = new PutManagedInsightRulesCommand(args);
|
|
454
|
+
if (typeof optionsOrCb === "function") {
|
|
455
|
+
this.send(command, optionsOrCb);
|
|
456
|
+
}
|
|
457
|
+
else if (typeof cb === "function") {
|
|
458
|
+
if (typeof optionsOrCb !== "object")
|
|
459
|
+
throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
|
|
460
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
return this.send(command, optionsOrCb);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
436
466
|
CloudWatch.prototype.putMetricAlarm = function (args, optionsOrCb, cb) {
|
|
437
467
|
var command = new PutMetricAlarmCommand(args);
|
|
438
468
|
if (typeof optionsOrCb === "function") {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { ListManagedInsightRulesInputFilterSensitiveLog, ListManagedInsightRulesOutputFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_queryListManagedInsightRulesCommand, serializeAws_queryListManagedInsightRulesCommand, } from "../protocols/Aws_query";
|
|
6
|
+
var ListManagedInsightRulesCommand = (function (_super) {
|
|
7
|
+
__extends(ListManagedInsightRulesCommand, _super);
|
|
8
|
+
function ListManagedInsightRulesCommand(input) {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.input = input;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
ListManagedInsightRulesCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
|
|
14
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
15
|
+
var stack = clientStack.concat(this.middlewareStack);
|
|
16
|
+
var logger = configuration.logger;
|
|
17
|
+
var clientName = "CloudWatchClient";
|
|
18
|
+
var commandName = "ListManagedInsightRulesCommand";
|
|
19
|
+
var handlerExecutionContext = {
|
|
20
|
+
logger: logger,
|
|
21
|
+
clientName: clientName,
|
|
22
|
+
commandName: commandName,
|
|
23
|
+
inputFilterSensitiveLog: ListManagedInsightRulesInputFilterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: ListManagedInsightRulesOutputFilterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
var requestHandler = configuration.requestHandler;
|
|
27
|
+
return stack.resolve(function (request) {
|
|
28
|
+
return requestHandler.handle(request.request, options || {});
|
|
29
|
+
}, handlerExecutionContext);
|
|
30
|
+
};
|
|
31
|
+
ListManagedInsightRulesCommand.prototype.serialize = function (input, context) {
|
|
32
|
+
return serializeAws_queryListManagedInsightRulesCommand(input, context);
|
|
33
|
+
};
|
|
34
|
+
ListManagedInsightRulesCommand.prototype.deserialize = function (output, context) {
|
|
35
|
+
return deserializeAws_queryListManagedInsightRulesCommand(output, context);
|
|
36
|
+
};
|
|
37
|
+
return ListManagedInsightRulesCommand;
|
|
38
|
+
}($Command));
|
|
39
|
+
export { ListManagedInsightRulesCommand };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { PutManagedInsightRulesInputFilterSensitiveLog, PutManagedInsightRulesOutputFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_queryPutManagedInsightRulesCommand, serializeAws_queryPutManagedInsightRulesCommand, } from "../protocols/Aws_query";
|
|
6
|
+
var PutManagedInsightRulesCommand = (function (_super) {
|
|
7
|
+
__extends(PutManagedInsightRulesCommand, _super);
|
|
8
|
+
function PutManagedInsightRulesCommand(input) {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.input = input;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
PutManagedInsightRulesCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
|
|
14
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
15
|
+
var stack = clientStack.concat(this.middlewareStack);
|
|
16
|
+
var logger = configuration.logger;
|
|
17
|
+
var clientName = "CloudWatchClient";
|
|
18
|
+
var commandName = "PutManagedInsightRulesCommand";
|
|
19
|
+
var handlerExecutionContext = {
|
|
20
|
+
logger: logger,
|
|
21
|
+
clientName: clientName,
|
|
22
|
+
commandName: commandName,
|
|
23
|
+
inputFilterSensitiveLog: PutManagedInsightRulesInputFilterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: PutManagedInsightRulesOutputFilterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
var requestHandler = configuration.requestHandler;
|
|
27
|
+
return stack.resolve(function (request) {
|
|
28
|
+
return requestHandler.handle(request.request, options || {});
|
|
29
|
+
}, handlerExecutionContext);
|
|
30
|
+
};
|
|
31
|
+
PutManagedInsightRulesCommand.prototype.serialize = function (input, context) {
|
|
32
|
+
return serializeAws_queryPutManagedInsightRulesCommand(input, context);
|
|
33
|
+
};
|
|
34
|
+
PutManagedInsightRulesCommand.prototype.deserialize = function (output, context) {
|
|
35
|
+
return deserializeAws_queryPutManagedInsightRulesCommand(output, context);
|
|
36
|
+
};
|
|
37
|
+
return PutManagedInsightRulesCommand;
|
|
38
|
+
}($Command));
|
|
39
|
+
export { PutManagedInsightRulesCommand };
|
|
@@ -19,6 +19,7 @@ export * from "./GetMetricStatisticsCommand";
|
|
|
19
19
|
export * from "./GetMetricStreamCommand";
|
|
20
20
|
export * from "./GetMetricWidgetImageCommand";
|
|
21
21
|
export * from "./ListDashboardsCommand";
|
|
22
|
+
export * from "./ListManagedInsightRulesCommand";
|
|
22
23
|
export * from "./ListMetricStreamsCommand";
|
|
23
24
|
export * from "./ListMetricsCommand";
|
|
24
25
|
export * from "./ListTagsForResourceCommand";
|
|
@@ -26,6 +27,7 @@ export * from "./PutAnomalyDetectorCommand";
|
|
|
26
27
|
export * from "./PutCompositeAlarmCommand";
|
|
27
28
|
export * from "./PutDashboardCommand";
|
|
28
29
|
export * from "./PutInsightRuleCommand";
|
|
30
|
+
export * from "./PutManagedInsightRulesCommand";
|
|
29
31
|
export * from "./PutMetricAlarmCommand";
|
|
30
32
|
export * from "./PutMetricDataCommand";
|
|
31
33
|
export * from "./PutMetricStreamCommand";
|
|
@@ -260,6 +260,10 @@ export var GetMetricWidgetImageInputFilterSensitiveLog = function (obj) { return
|
|
|
260
260
|
export var GetMetricWidgetImageOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
261
261
|
export var ListDashboardsInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
262
262
|
export var ListDashboardsOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
263
|
+
export var ListManagedInsightRulesInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
264
|
+
export var ManagedRuleStateFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
265
|
+
export var ManagedRuleDescriptionFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
266
|
+
export var ListManagedInsightRulesOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
263
267
|
export var ListMetricsInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
264
268
|
export var ListMetricsOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
265
269
|
export var ListMetricStreamsInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -275,6 +279,9 @@ export var PutDashboardInputFilterSensitiveLog = function (obj) { return (__assi
|
|
|
275
279
|
export var PutDashboardOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
276
280
|
export var PutInsightRuleInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
277
281
|
export var PutInsightRuleOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
282
|
+
export var ManagedRuleFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
283
|
+
export var PutManagedInsightRulesInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
284
|
+
export var PutManagedInsightRulesOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
278
285
|
export var PutMetricAlarmInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
279
286
|
export var StatisticSetFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
280
287
|
export var MetricDatumFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
|
+
import { CloudWatch } from "../CloudWatch";
|
|
3
|
+
import { CloudWatchClient } from "../CloudWatchClient";
|
|
4
|
+
import { DescribeAnomalyDetectorsCommand, } from "../commands/DescribeAnomalyDetectorsCommand";
|
|
5
|
+
var makePagedClientRequest = function (client, input) {
|
|
6
|
+
var args = [];
|
|
7
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
+
args[_i - 2] = arguments[_i];
|
|
9
|
+
}
|
|
10
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
+
return __generator(this, function (_a) {
|
|
12
|
+
switch (_a.label) {
|
|
13
|
+
case 0: return [4, client.send.apply(client, __spreadArray([new DescribeAnomalyDetectorsCommand(input)], __read(args), false))];
|
|
14
|
+
case 1: return [2, _a.sent()];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var makePagedRequest = function (client, input) {
|
|
20
|
+
var args = [];
|
|
21
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
+
args[_i - 2] = arguments[_i];
|
|
23
|
+
}
|
|
24
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
+
return __generator(this, function (_a) {
|
|
26
|
+
switch (_a.label) {
|
|
27
|
+
case 0: return [4, client.describeAnomalyDetectors.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
+
case 1: return [2, _a.sent()];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export function paginateDescribeAnomalyDetectors(config, input) {
|
|
34
|
+
var additionalArguments = [];
|
|
35
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
36
|
+
additionalArguments[_i - 2] = arguments[_i];
|
|
37
|
+
}
|
|
38
|
+
return __asyncGenerator(this, arguments, function paginateDescribeAnomalyDetectors_1() {
|
|
39
|
+
var token, hasNext, page, prevToken;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
switch (_a.label) {
|
|
42
|
+
case 0:
|
|
43
|
+
token = config.startingToken || undefined;
|
|
44
|
+
hasNext = true;
|
|
45
|
+
_a.label = 1;
|
|
46
|
+
case 1:
|
|
47
|
+
if (!hasNext) return [3, 9];
|
|
48
|
+
input.NextToken = token;
|
|
49
|
+
input["MaxResults"] = config.pageSize;
|
|
50
|
+
if (!(config.client instanceof CloudWatch)) return [3, 3];
|
|
51
|
+
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
+
case 2:
|
|
53
|
+
page = _a.sent();
|
|
54
|
+
return [3, 6];
|
|
55
|
+
case 3:
|
|
56
|
+
if (!(config.client instanceof CloudWatchClient)) return [3, 5];
|
|
57
|
+
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
+
case 4:
|
|
59
|
+
page = _a.sent();
|
|
60
|
+
return [3, 6];
|
|
61
|
+
case 5: throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
|
|
62
|
+
case 6: return [4, __await(page)];
|
|
63
|
+
case 7: return [4, _a.sent()];
|
|
64
|
+
case 8:
|
|
65
|
+
_a.sent();
|
|
66
|
+
prevToken = token;
|
|
67
|
+
token = page.NextToken;
|
|
68
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
69
|
+
return [3, 1];
|
|
70
|
+
case 9: return [4, __await(undefined)];
|
|
71
|
+
case 10: return [2, _a.sent()];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
|
+
import { CloudWatch } from "../CloudWatch";
|
|
3
|
+
import { CloudWatchClient } from "../CloudWatchClient";
|
|
4
|
+
import { ListManagedInsightRulesCommand, } from "../commands/ListManagedInsightRulesCommand";
|
|
5
|
+
var makePagedClientRequest = function (client, input) {
|
|
6
|
+
var args = [];
|
|
7
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8
|
+
args[_i - 2] = arguments[_i];
|
|
9
|
+
}
|
|
10
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
11
|
+
return __generator(this, function (_a) {
|
|
12
|
+
switch (_a.label) {
|
|
13
|
+
case 0: return [4, client.send.apply(client, __spreadArray([new ListManagedInsightRulesCommand(input)], __read(args), false))];
|
|
14
|
+
case 1: return [2, _a.sent()];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var makePagedRequest = function (client, input) {
|
|
20
|
+
var args = [];
|
|
21
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
22
|
+
args[_i - 2] = arguments[_i];
|
|
23
|
+
}
|
|
24
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
25
|
+
return __generator(this, function (_a) {
|
|
26
|
+
switch (_a.label) {
|
|
27
|
+
case 0: return [4, client.listManagedInsightRules.apply(client, __spreadArray([input], __read(args), false))];
|
|
28
|
+
case 1: return [2, _a.sent()];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export function paginateListManagedInsightRules(config, input) {
|
|
34
|
+
var additionalArguments = [];
|
|
35
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
36
|
+
additionalArguments[_i - 2] = arguments[_i];
|
|
37
|
+
}
|
|
38
|
+
return __asyncGenerator(this, arguments, function paginateListManagedInsightRules_1() {
|
|
39
|
+
var token, hasNext, page, prevToken;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
switch (_a.label) {
|
|
42
|
+
case 0:
|
|
43
|
+
token = config.startingToken || undefined;
|
|
44
|
+
hasNext = true;
|
|
45
|
+
_a.label = 1;
|
|
46
|
+
case 1:
|
|
47
|
+
if (!hasNext) return [3, 9];
|
|
48
|
+
input.NextToken = token;
|
|
49
|
+
input["MaxResults"] = config.pageSize;
|
|
50
|
+
if (!(config.client instanceof CloudWatch)) return [3, 3];
|
|
51
|
+
return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
52
|
+
case 2:
|
|
53
|
+
page = _a.sent();
|
|
54
|
+
return [3, 6];
|
|
55
|
+
case 3:
|
|
56
|
+
if (!(config.client instanceof CloudWatchClient)) return [3, 5];
|
|
57
|
+
return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
|
|
58
|
+
case 4:
|
|
59
|
+
page = _a.sent();
|
|
60
|
+
return [3, 6];
|
|
61
|
+
case 5: throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
|
|
62
|
+
case 6: return [4, __await(page)];
|
|
63
|
+
case 7: return [4, _a.sent()];
|
|
64
|
+
case 8:
|
|
65
|
+
_a.sent();
|
|
66
|
+
prevToken = token;
|
|
67
|
+
token = page.NextToken;
|
|
68
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
69
|
+
return [3, 1];
|
|
70
|
+
case 9: return [4, __await(undefined)];
|
|
71
|
+
case 10: return [2, _a.sent()];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|