@aws-sdk/client-cloudwatch 3.477.0 → 3.478.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 (37) hide show
  1. package/dist-cjs/pagination/DescribeAlarmHistoryPaginator.js +2 -24
  2. package/dist-cjs/pagination/DescribeAlarmsPaginator.js +2 -24
  3. package/dist-cjs/pagination/DescribeAnomalyDetectorsPaginator.js +2 -24
  4. package/dist-cjs/pagination/DescribeInsightRulesPaginator.js +2 -24
  5. package/dist-cjs/pagination/GetMetricDataPaginator.js +2 -24
  6. package/dist-cjs/pagination/ListDashboardsPaginator.js +2 -23
  7. package/dist-cjs/pagination/ListManagedInsightRulesPaginator.js +2 -24
  8. package/dist-cjs/pagination/ListMetricStreamsPaginator.js +2 -24
  9. package/dist-cjs/pagination/ListMetricsPaginator.js +2 -23
  10. package/dist-es/pagination/DescribeAlarmHistoryPaginator.js +2 -23
  11. package/dist-es/pagination/DescribeAlarmsPaginator.js +2 -23
  12. package/dist-es/pagination/DescribeAnomalyDetectorsPaginator.js +2 -23
  13. package/dist-es/pagination/DescribeInsightRulesPaginator.js +2 -23
  14. package/dist-es/pagination/GetMetricDataPaginator.js +2 -23
  15. package/dist-es/pagination/ListDashboardsPaginator.js +2 -22
  16. package/dist-es/pagination/ListManagedInsightRulesPaginator.js +2 -23
  17. package/dist-es/pagination/ListMetricStreamsPaginator.js +2 -23
  18. package/dist-es/pagination/ListMetricsPaginator.js +2 -22
  19. package/dist-types/pagination/DescribeAlarmHistoryPaginator.d.ts +1 -1
  20. package/dist-types/pagination/DescribeAlarmsPaginator.d.ts +1 -1
  21. package/dist-types/pagination/DescribeAnomalyDetectorsPaginator.d.ts +1 -1
  22. package/dist-types/pagination/DescribeInsightRulesPaginator.d.ts +1 -1
  23. package/dist-types/pagination/GetMetricDataPaginator.d.ts +1 -1
  24. package/dist-types/pagination/ListDashboardsPaginator.d.ts +1 -1
  25. package/dist-types/pagination/ListManagedInsightRulesPaginator.d.ts +1 -1
  26. package/dist-types/pagination/ListMetricStreamsPaginator.d.ts +1 -1
  27. package/dist-types/pagination/ListMetricsPaginator.d.ts +1 -1
  28. package/dist-types/ts3.4/pagination/DescribeAlarmHistoryPaginator.d.ts +3 -3
  29. package/dist-types/ts3.4/pagination/DescribeAlarmsPaginator.d.ts +3 -3
  30. package/dist-types/ts3.4/pagination/DescribeAnomalyDetectorsPaginator.d.ts +3 -3
  31. package/dist-types/ts3.4/pagination/DescribeInsightRulesPaginator.d.ts +3 -3
  32. package/dist-types/ts3.4/pagination/GetMetricDataPaginator.d.ts +3 -3
  33. package/dist-types/ts3.4/pagination/ListDashboardsPaginator.d.ts +3 -3
  34. package/dist-types/ts3.4/pagination/ListManagedInsightRulesPaginator.d.ts +3 -3
  35. package/dist-types/ts3.4/pagination/ListMetricStreamsPaginator.d.ts +3 -3
  36. package/dist-types/ts3.4/pagination/ListMetricsPaginator.d.ts +3 -3
  37. package/package.json +6 -5
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateDescribeAlarmHistory = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const DescribeAlarmHistoryCommand_1 = require("../commands/DescribeAlarmHistoryCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new DescribeAlarmHistoryCommand_1.DescribeAlarmHistoryCommand(input), ...args);
8
- };
9
- async function* paginateDescribeAlarmHistory(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxRecords"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateDescribeAlarmHistory = paginateDescribeAlarmHistory;
7
+ exports.paginateDescribeAlarmHistory = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, DescribeAlarmHistoryCommand_1.DescribeAlarmHistoryCommand, "NextToken", "NextToken", "MaxRecords");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateDescribeAlarms = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const DescribeAlarmsCommand_1 = require("../commands/DescribeAlarmsCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new DescribeAlarmsCommand_1.DescribeAlarmsCommand(input), ...args);
8
- };
9
- async function* paginateDescribeAlarms(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxRecords"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateDescribeAlarms = paginateDescribeAlarms;
7
+ exports.paginateDescribeAlarms = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, DescribeAlarmsCommand_1.DescribeAlarmsCommand, "NextToken", "NextToken", "MaxRecords");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateDescribeAnomalyDetectors = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const DescribeAnomalyDetectorsCommand_1 = require("../commands/DescribeAnomalyDetectorsCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new DescribeAnomalyDetectorsCommand_1.DescribeAnomalyDetectorsCommand(input), ...args);
8
- };
9
- async function* paginateDescribeAnomalyDetectors(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxResults"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateDescribeAnomalyDetectors = paginateDescribeAnomalyDetectors;
7
+ exports.paginateDescribeAnomalyDetectors = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, DescribeAnomalyDetectorsCommand_1.DescribeAnomalyDetectorsCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateDescribeInsightRules = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const DescribeInsightRulesCommand_1 = require("../commands/DescribeInsightRulesCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new DescribeInsightRulesCommand_1.DescribeInsightRulesCommand(input), ...args);
8
- };
9
- async function* paginateDescribeInsightRules(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxResults"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateDescribeInsightRules = paginateDescribeInsightRules;
7
+ exports.paginateDescribeInsightRules = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, DescribeInsightRulesCommand_1.DescribeInsightRulesCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateGetMetricData = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const GetMetricDataCommand_1 = require("../commands/GetMetricDataCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new GetMetricDataCommand_1.GetMetricDataCommand(input), ...args);
8
- };
9
- async function* paginateGetMetricData(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxDatapoints"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateGetMetricData = paginateGetMetricData;
7
+ exports.paginateGetMetricData = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, GetMetricDataCommand_1.GetMetricDataCommand, "NextToken", "NextToken", "MaxDatapoints");
@@ -1,28 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListDashboards = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const ListDashboardsCommand_1 = require("../commands/ListDashboardsCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListDashboardsCommand_1.ListDashboardsCommand(input), ...args);
8
- };
9
- async function* paginateListDashboards(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
16
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
17
- }
18
- else {
19
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
20
- }
21
- yield page;
22
- const prevToken = token;
23
- token = page.NextToken;
24
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
25
- }
26
- return undefined;
27
- }
28
- exports.paginateListDashboards = paginateListDashboards;
7
+ exports.paginateListDashboards = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, ListDashboardsCommand_1.ListDashboardsCommand, "NextToken", "NextToken", "");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListManagedInsightRules = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const ListManagedInsightRulesCommand_1 = require("../commands/ListManagedInsightRulesCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListManagedInsightRulesCommand_1.ListManagedInsightRulesCommand(input), ...args);
8
- };
9
- async function* paginateListManagedInsightRules(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxResults"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateListManagedInsightRules = paginateListManagedInsightRules;
7
+ exports.paginateListManagedInsightRules = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, ListManagedInsightRulesCommand_1.ListManagedInsightRulesCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListMetricStreams = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const ListMetricStreamsCommand_1 = require("../commands/ListMetricStreamsCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListMetricStreamsCommand_1.ListMetricStreamsCommand(input), ...args);
8
- };
9
- async function* paginateListMetricStreams(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- input["MaxResults"] = config.pageSize;
16
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.NextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateListMetricStreams = paginateListMetricStreams;
7
+ exports.paginateListMetricStreams = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, ListMetricStreamsCommand_1.ListMetricStreamsCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,28 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListMetrics = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const CloudWatchClient_1 = require("../CloudWatchClient");
5
6
  const ListMetricsCommand_1 = require("../commands/ListMetricsCommand");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListMetricsCommand_1.ListMetricsCommand(input), ...args);
8
- };
9
- async function* paginateListMetrics(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.NextToken = token;
15
- if (config.client instanceof CloudWatchClient_1.CloudWatchClient) {
16
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
17
- }
18
- else {
19
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
20
- }
21
- yield page;
22
- const prevToken = token;
23
- token = page.NextToken;
24
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
25
- }
26
- return undefined;
27
- }
28
- exports.paginateListMetrics = paginateListMetrics;
7
+ exports.paginateListMetrics = (0, core_1.createPaginator)(CloudWatchClient_1.CloudWatchClient, ListMetricsCommand_1.ListMetricsCommand, "NextToken", "NextToken", "");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { DescribeAlarmHistoryCommand, } from "../commands/DescribeAlarmHistoryCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new DescribeAlarmHistoryCommand(input), ...args);
5
- };
6
- export async function* paginateDescribeAlarmHistory(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxRecords"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateDescribeAlarmHistory = createPaginator(CloudWatchClient, DescribeAlarmHistoryCommand, "NextToken", "NextToken", "MaxRecords");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { DescribeAlarmsCommand, } from "../commands/DescribeAlarmsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new DescribeAlarmsCommand(input), ...args);
5
- };
6
- export async function* paginateDescribeAlarms(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxRecords"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateDescribeAlarms = createPaginator(CloudWatchClient, DescribeAlarmsCommand, "NextToken", "NextToken", "MaxRecords");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { DescribeAnomalyDetectorsCommand, } from "../commands/DescribeAnomalyDetectorsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new DescribeAnomalyDetectorsCommand(input), ...args);
5
- };
6
- export async function* paginateDescribeAnomalyDetectors(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxResults"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateDescribeAnomalyDetectors = createPaginator(CloudWatchClient, DescribeAnomalyDetectorsCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { DescribeInsightRulesCommand, } from "../commands/DescribeInsightRulesCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new DescribeInsightRulesCommand(input), ...args);
5
- };
6
- export async function* paginateDescribeInsightRules(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxResults"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateDescribeInsightRules = createPaginator(CloudWatchClient, DescribeInsightRulesCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { GetMetricDataCommand, } from "../commands/GetMetricDataCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new GetMetricDataCommand(input), ...args);
5
- };
6
- export async function* paginateGetMetricData(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxDatapoints"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateGetMetricData = createPaginator(CloudWatchClient, GetMetricDataCommand, "NextToken", "NextToken", "MaxDatapoints");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { ListDashboardsCommand, } from "../commands/ListDashboardsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListDashboardsCommand(input), ...args);
5
- };
6
- export async function* paginateListDashboards(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- if (config.client instanceof CloudWatchClient) {
13
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
- }
15
- else {
16
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
17
- }
18
- yield page;
19
- const prevToken = token;
20
- token = page.NextToken;
21
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
- }
23
- return undefined;
24
- }
4
+ export const paginateListDashboards = createPaginator(CloudWatchClient, ListDashboardsCommand, "NextToken", "NextToken", "");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { ListManagedInsightRulesCommand, } from "../commands/ListManagedInsightRulesCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListManagedInsightRulesCommand(input), ...args);
5
- };
6
- export async function* paginateListManagedInsightRules(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxResults"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListManagedInsightRules = createPaginator(CloudWatchClient, ListManagedInsightRulesCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { ListMetricStreamsCommand, } from "../commands/ListMetricStreamsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListMetricStreamsCommand(input), ...args);
5
- };
6
- export async function* paginateListMetricStreams(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- input["MaxResults"] = config.pageSize;
13
- if (config.client instanceof CloudWatchClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.NextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListMetricStreams = createPaginator(CloudWatchClient, ListMetricStreamsCommand, "NextToken", "NextToken", "MaxResults");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { CloudWatchClient } from "../CloudWatchClient";
2
3
  import { ListMetricsCommand } from "../commands/ListMetricsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListMetricsCommand(input), ...args);
5
- };
6
- export async function* paginateListMetrics(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.NextToken = token;
12
- if (config.client instanceof CloudWatchClient) {
13
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
- }
15
- else {
16
- throw new Error("Invalid client, expected CloudWatch | CloudWatchClient");
17
- }
18
- yield page;
19
- const prevToken = token;
20
- token = page.NextToken;
21
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
- }
23
- return undefined;
24
- }
4
+ export const paginateListMetrics = createPaginator(CloudWatchClient, ListMetricsCommand, "NextToken", "NextToken", "");
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateDescribeAlarmHistory(config: CloudWatchPaginationConfiguration, input: DescribeAlarmHistoryCommandInput, ...additionalArguments: any): Paginator<DescribeAlarmHistoryCommandOutput>;
7
+ export declare const paginateDescribeAlarmHistory: (config: CloudWatchPaginationConfiguration, input: DescribeAlarmHistoryCommandInput, ...rest: any[]) => Paginator<DescribeAlarmHistoryCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateDescribeAlarms(config: CloudWatchPaginationConfiguration, input: DescribeAlarmsCommandInput, ...additionalArguments: any): Paginator<DescribeAlarmsCommandOutput>;
7
+ export declare const paginateDescribeAlarms: (config: CloudWatchPaginationConfiguration, input: DescribeAlarmsCommandInput, ...rest: any[]) => Paginator<DescribeAlarmsCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateDescribeAnomalyDetectors(config: CloudWatchPaginationConfiguration, input: DescribeAnomalyDetectorsCommandInput, ...additionalArguments: any): Paginator<DescribeAnomalyDetectorsCommandOutput>;
7
+ export declare const paginateDescribeAnomalyDetectors: (config: CloudWatchPaginationConfiguration, input: DescribeAnomalyDetectorsCommandInput, ...rest: any[]) => Paginator<DescribeAnomalyDetectorsCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateDescribeInsightRules(config: CloudWatchPaginationConfiguration, input: DescribeInsightRulesCommandInput, ...additionalArguments: any): Paginator<DescribeInsightRulesCommandOutput>;
7
+ export declare const paginateDescribeInsightRules: (config: CloudWatchPaginationConfiguration, input: DescribeInsightRulesCommandInput, ...rest: any[]) => Paginator<DescribeInsightRulesCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateGetMetricData(config: CloudWatchPaginationConfiguration, input: GetMetricDataCommandInput, ...additionalArguments: any): Paginator<GetMetricDataCommandOutput>;
7
+ export declare const paginateGetMetricData: (config: CloudWatchPaginationConfiguration, input: GetMetricDataCommandInput, ...rest: any[]) => Paginator<GetMetricDataCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListDashboards(config: CloudWatchPaginationConfiguration, input: ListDashboardsCommandInput, ...additionalArguments: any): Paginator<ListDashboardsCommandOutput>;
7
+ export declare const paginateListDashboards: (config: CloudWatchPaginationConfiguration, input: ListDashboardsCommandInput, ...rest: any[]) => Paginator<ListDashboardsCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListManagedInsightRules(config: CloudWatchPaginationConfiguration, input: ListManagedInsightRulesCommandInput, ...additionalArguments: any): Paginator<ListManagedInsightRulesCommandOutput>;
7
+ export declare const paginateListManagedInsightRules: (config: CloudWatchPaginationConfiguration, input: ListManagedInsightRulesCommandInput, ...rest: any[]) => Paginator<ListManagedInsightRulesCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListMetricStreams(config: CloudWatchPaginationConfiguration, input: ListMetricStreamsCommandInput, ...additionalArguments: any): Paginator<ListMetricStreamsCommandOutput>;
7
+ export declare const paginateListMetricStreams: (config: CloudWatchPaginationConfiguration, input: ListMetricStreamsCommandInput, ...rest: any[]) => Paginator<ListMetricStreamsCommandOutput>;
@@ -4,4 +4,4 @@ import { CloudWatchPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListMetrics(config: CloudWatchPaginationConfiguration, input: ListMetricsCommandInput, ...additionalArguments: any): Paginator<ListMetricsCommandOutput>;
7
+ export declare const paginateListMetrics: (config: CloudWatchPaginationConfiguration, input: ListMetricsCommandInput, ...rest: any[]) => Paginator<ListMetricsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  DescribeAlarmHistoryCommandOutput,
5
5
  } from "../commands/DescribeAlarmHistoryCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateDescribeAlarmHistory(
7
+ export declare const paginateDescribeAlarmHistory: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: DescribeAlarmHistoryCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<DescribeAlarmHistoryCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<DescribeAlarmHistoryCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  DescribeAlarmsCommandOutput,
5
5
  } from "../commands/DescribeAlarmsCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateDescribeAlarms(
7
+ export declare const paginateDescribeAlarms: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: DescribeAlarmsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<DescribeAlarmsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<DescribeAlarmsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  DescribeAnomalyDetectorsCommandOutput,
5
5
  } from "../commands/DescribeAnomalyDetectorsCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateDescribeAnomalyDetectors(
7
+ export declare const paginateDescribeAnomalyDetectors: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: DescribeAnomalyDetectorsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<DescribeAnomalyDetectorsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<DescribeAnomalyDetectorsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  DescribeInsightRulesCommandOutput,
5
5
  } from "../commands/DescribeInsightRulesCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateDescribeInsightRules(
7
+ export declare const paginateDescribeInsightRules: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: DescribeInsightRulesCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<DescribeInsightRulesCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<DescribeInsightRulesCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  GetMetricDataCommandOutput,
5
5
  } from "../commands/GetMetricDataCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateGetMetricData(
7
+ export declare const paginateGetMetricData: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: GetMetricDataCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<GetMetricDataCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<GetMetricDataCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListDashboardsCommandOutput,
5
5
  } from "../commands/ListDashboardsCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListDashboards(
7
+ export declare const paginateListDashboards: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: ListDashboardsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListDashboardsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListDashboardsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListManagedInsightRulesCommandOutput,
5
5
  } from "../commands/ListManagedInsightRulesCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListManagedInsightRules(
7
+ export declare const paginateListManagedInsightRules: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: ListManagedInsightRulesCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListManagedInsightRulesCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListManagedInsightRulesCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListMetricStreamsCommandOutput,
5
5
  } from "../commands/ListMetricStreamsCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListMetricStreams(
7
+ export declare const paginateListMetricStreams: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: ListMetricStreamsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListMetricStreamsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListMetricStreamsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListMetricsCommandOutput,
5
5
  } from "../commands/ListMetricsCommand";
6
6
  import { CloudWatchPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListMetrics(
7
+ export declare const paginateListMetrics: (
8
8
  config: CloudWatchPaginationConfiguration,
9
9
  input: ListMetricsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListMetricsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListMetricsCommandOutput>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudwatch",
3
3
  "description": "AWS SDK for JavaScript Cloudwatch Client for Node.js, Browser and React Native",
4
- "version": "3.477.0",
4
+ "version": "3.478.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,20 +20,21 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.477.0",
23
+ "@aws-sdk/client-sts": "3.478.0",
24
24
  "@aws-sdk/core": "3.477.0",
25
- "@aws-sdk/credential-provider-node": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.478.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
29
29
  "@aws-sdk/middleware-signing": "3.468.0",
30
- "@aws-sdk/middleware-user-agent": "3.470.0",
30
+ "@aws-sdk/middleware-user-agent": "3.478.0",
31
31
  "@aws-sdk/region-config-resolver": "3.470.0",
32
32
  "@aws-sdk/types": "3.468.0",
33
- "@aws-sdk/util-endpoints": "3.470.0",
33
+ "@aws-sdk/util-endpoints": "3.478.0",
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",