@aws-sdk/client-codestar-notifications 3.34.0 → 3.37.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 +47 -0
- package/{dist/cjs → dist-cjs}/CodestarNotifications.js +0 -87
- package/dist-cjs/CodestarNotificationsClient.js +35 -0
- package/{dist/cjs → dist-cjs}/commands/CreateNotificationRuleCommand.js +2 -29
- package/{dist/cjs → dist-cjs}/commands/DeleteNotificationRuleCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/DeleteTargetCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/DescribeNotificationRuleCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/ListEventTypesCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/ListNotificationRulesCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/ListTargetsCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/SubscribeCommand.js +2 -29
- package/{dist/cjs → dist-cjs}/commands/TagResourceCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/UnsubscribeCommand.js +2 -29
- package/{dist/cjs → dist-cjs}/commands/UntagResourceCommand.js +2 -28
- package/{dist/cjs → dist-cjs}/commands/UpdateNotificationRuleCommand.js +2 -32
- package/{dist/cjs → dist-cjs}/endpoints.js +1 -2
- package/{dist/cjs → dist-cjs}/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/models_0.js +0 -124
- package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
- package/{dist/cjs → dist-cjs}/pagination/ListEventTypesPaginator.js +0 -11
- package/{dist/cjs → dist-cjs}/pagination/ListNotificationRulesPaginator.js +0 -11
- package/{dist/cjs → dist-cjs}/pagination/ListTargetsPaginator.js +0 -11
- package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +13 -19
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
- package/{dist/es → dist-es}/CodestarNotifications.js +0 -1
- package/{dist/es → dist-es}/CodestarNotificationsClient.js +1 -2
- package/{dist/es → dist-es}/commands/CreateNotificationRuleCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DeleteNotificationRuleCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DeleteTargetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DescribeNotificationRuleCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListEventTypesCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListNotificationRulesCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListTagsForResourceCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListTargetsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/SubscribeCommand.js +2 -3
- package/{dist/es → dist-es}/commands/TagResourceCommand.js +2 -3
- package/{dist/es → dist-es}/commands/UnsubscribeCommand.js +2 -3
- package/{dist/es → dist-es}/commands/UntagResourceCommand.js +2 -3
- package/{dist/es → dist-es}/commands/UpdateNotificationRuleCommand.js +2 -3
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/{dist/es → dist-es}/models/models_0.js +0 -1
- package/dist-es/pagination/Interfaces.js +1 -0
- package/{dist/es → dist-es}/pagination/ListEventTypesPaginator.js +0 -1
- package/{dist/es → dist-es}/pagination/ListNotificationRulesPaginator.js +0 -1
- package/{dist/es → dist-es}/pagination/ListTargetsPaginator.js +0 -1
- package/{dist/es → dist-es}/protocols/Aws_restJson1.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -2
- package/{dist/types → dist-types}/CodestarNotifications.d.ts +1 -1
- package/{dist/types → dist-types}/CodestarNotificationsClient.d.ts +8 -8
- package/{dist/types → dist-types}/commands/CreateNotificationRuleCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DeleteNotificationRuleCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DeleteTargetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DescribeNotificationRuleCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListEventTypesCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListNotificationRulesCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListTargetsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/SubscribeCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/TagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UnsubscribeCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UntagResourceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UpdateNotificationRuleCommand.d.ts +2 -2
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/{index.ts → dist-types/index.d.ts} +0 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
- package/{dist/types → dist-types}/pagination/ListEventTypesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/pagination/ListNotificationRulesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/pagination/ListTargetsPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/CodestarNotifications.d.ts +15 -138
- package/dist-types/ts3.4/CodestarNotificationsClient.d.ts +80 -0
- package/dist-types/ts3.4/commands/CreateNotificationRuleCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/commands/DeleteNotificationRuleCommand.d.ts +4 -22
- package/dist-types/ts3.4/commands/DeleteTargetCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/commands/DescribeNotificationRuleCommand.d.ts +4 -22
- package/dist-types/ts3.4/commands/ListEventTypesCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/commands/ListNotificationRulesCommand.d.ts +4 -22
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListTargetsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/SubscribeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UnsubscribeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateNotificationRuleCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/dist-types/ts3.4/models/models_0.d.ts +480 -0
- package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/pagination/ListEventTypesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/pagination/ListNotificationRulesPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/pagination/ListTargetsPaginator.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +45 -42
- package/CodestarNotifications.ts +0 -540
- package/CodestarNotificationsClient.ts +0 -375
- package/commands/CreateNotificationRuleCommand.ts +0 -100
- package/commands/DeleteNotificationRuleCommand.ts +0 -98
- package/commands/DeleteTargetCommand.ts +0 -98
- package/commands/DescribeNotificationRuleCommand.ts +0 -98
- package/commands/ListEventTypesCommand.ts +0 -98
- package/commands/ListNotificationRulesCommand.ts +0 -98
- package/commands/ListTagsForResourceCommand.ts +0 -98
- package/commands/ListTargetsCommand.ts +0 -98
- package/commands/SubscribeCommand.ts +0 -100
- package/commands/TagResourceCommand.ts +0 -98
- package/commands/UnsubscribeCommand.ts +0 -100
- package/commands/UntagResourceCommand.ts +0 -99
- package/commands/UpdateNotificationRuleCommand.ts +0 -103
- package/dist/cjs/CodestarNotifications.js.map +0 -1
- package/dist/cjs/CodestarNotificationsClient.js +0 -127
- package/dist/cjs/CodestarNotificationsClient.js.map +0 -1
- package/dist/cjs/commands/CreateNotificationRuleCommand.js.map +0 -1
- package/dist/cjs/commands/DeleteNotificationRuleCommand.js.map +0 -1
- package/dist/cjs/commands/DeleteTargetCommand.js.map +0 -1
- package/dist/cjs/commands/DescribeNotificationRuleCommand.js.map +0 -1
- package/dist/cjs/commands/ListEventTypesCommand.js.map +0 -1
- package/dist/cjs/commands/ListNotificationRulesCommand.js.map +0 -1
- package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist/cjs/commands/ListTargetsCommand.js.map +0 -1
- package/dist/cjs/commands/SubscribeCommand.js.map +0 -1
- package/dist/cjs/commands/TagResourceCommand.js.map +0 -1
- package/dist/cjs/commands/UnsubscribeCommand.js.map +0 -1
- package/dist/cjs/commands/UntagResourceCommand.js.map +0 -1
- package/dist/cjs/commands/UpdateNotificationRuleCommand.js.map +0 -1
- package/dist/cjs/endpoints.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/models_0.js.map +0 -1
- package/dist/cjs/package.json +0 -93
- package/dist/cjs/pagination/Interfaces.js.map +0 -1
- package/dist/cjs/pagination/ListEventTypesPaginator.js.map +0 -1
- package/dist/cjs/pagination/ListNotificationRulesPaginator.js.map +0 -1
- package/dist/cjs/pagination/ListTargetsPaginator.js.map +0 -1
- package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist/cjs/runtimeConfig.browser.js.map +0 -1
- package/dist/cjs/runtimeConfig.js.map +0 -1
- package/dist/cjs/runtimeConfig.native.js.map +0 -1
- package/dist/cjs/runtimeConfig.shared.js.map +0 -1
- package/dist/es/CodestarNotifications.js.map +0 -1
- package/dist/es/CodestarNotificationsClient.js.map +0 -1
- package/dist/es/commands/CreateNotificationRuleCommand.js.map +0 -1
- package/dist/es/commands/DeleteNotificationRuleCommand.js.map +0 -1
- package/dist/es/commands/DeleteTargetCommand.js.map +0 -1
- package/dist/es/commands/DescribeNotificationRuleCommand.js.map +0 -1
- package/dist/es/commands/ListEventTypesCommand.js.map +0 -1
- package/dist/es/commands/ListNotificationRulesCommand.js.map +0 -1
- package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist/es/commands/ListTargetsCommand.js.map +0 -1
- package/dist/es/commands/SubscribeCommand.js.map +0 -1
- package/dist/es/commands/TagResourceCommand.js.map +0 -1
- package/dist/es/commands/UnsubscribeCommand.js.map +0 -1
- package/dist/es/commands/UntagResourceCommand.js.map +0 -1
- package/dist/es/commands/UpdateNotificationRuleCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -21
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -93
- package/dist/es/pagination/Interfaces.js +0 -2
- package/dist/es/pagination/Interfaces.js.map +0 -1
- package/dist/es/pagination/ListEventTypesPaginator.js.map +0 -1
- package/dist/es/pagination/ListNotificationRulesPaginator.js.map +0 -1
- package/dist/es/pagination/ListTargetsPaginator.js.map +0 -1
- package/dist/es/protocols/Aws_restJson1.js.map +0 -1
- package/dist/es/runtimeConfig.browser.js.map +0 -1
- package/dist/es/runtimeConfig.js.map +0 -1
- package/dist/es/runtimeConfig.native.js.map +0 -1
- package/dist/es/runtimeConfig.shared.js.map +0 -1
- package/dist/types/ts3.4/CodestarNotificationsClient.d.ts +0 -228
- package/dist/types/ts3.4/commands/CreateNotificationRuleCommand.d.ts +0 -37
- package/dist/types/ts3.4/commands/DeleteTargetCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/ListEventTypesCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/ListTagsForResourceCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/ListTargetsCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/SubscribeCommand.d.ts +0 -37
- package/dist/types/ts3.4/commands/TagResourceCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/UnsubscribeCommand.d.ts +0 -37
- package/dist/types/ts3.4/commands/UntagResourceCommand.d.ts +0 -36
- package/dist/types/ts3.4/commands/UpdateNotificationRuleCommand.d.ts +0 -40
- package/dist/types/ts3.4/models/models_0.d.ts +0 -804
- package/endpoints.ts +0 -57
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -1021
- package/pagination/Interfaces.ts +0 -7
- package/pagination/ListEventTypesPaginator.ts +0 -58
- package/pagination/ListNotificationRulesPaginator.ts +0 -58
- package/pagination/ListTargetsPaginator.ts +0 -54
- package/protocols/Aws_restJson1.ts +0 -1703
- package/runtimeConfig.browser.ts +0 -40
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -45
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -31
- package/tsconfig.types.json +0 -8
package/pagination/Interfaces.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CodestarNotifications } from "../CodestarNotifications";
|
|
2
|
-
import { CodestarNotificationsClient } from "../CodestarNotificationsClient";
|
|
3
|
-
import { PaginationConfiguration } from "@aws-sdk/types";
|
|
4
|
-
|
|
5
|
-
export interface CodestarNotificationsPaginationConfiguration extends PaginationConfiguration {
|
|
6
|
-
client: CodestarNotifications | CodestarNotificationsClient;
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { CodestarNotifications } from "../CodestarNotifications";
|
|
2
|
-
import { CodestarNotificationsClient } from "../CodestarNotificationsClient";
|
|
3
|
-
import {
|
|
4
|
-
ListEventTypesCommand,
|
|
5
|
-
ListEventTypesCommandInput,
|
|
6
|
-
ListEventTypesCommandOutput,
|
|
7
|
-
} from "../commands/ListEventTypesCommand";
|
|
8
|
-
import { CodestarNotificationsPaginationConfiguration } from "./Interfaces";
|
|
9
|
-
import { Paginator } from "@aws-sdk/types";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
const makePagedClientRequest = async (
|
|
15
|
-
client: CodestarNotificationsClient,
|
|
16
|
-
input: ListEventTypesCommandInput,
|
|
17
|
-
...args: any
|
|
18
|
-
): Promise<ListEventTypesCommandOutput> => {
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
return await client.send(new ListEventTypesCommand(input), ...args);
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
const makePagedRequest = async (
|
|
26
|
-
client: CodestarNotifications,
|
|
27
|
-
input: ListEventTypesCommandInput,
|
|
28
|
-
...args: any
|
|
29
|
-
): Promise<ListEventTypesCommandOutput> => {
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
return await client.listEventTypes(input, ...args);
|
|
32
|
-
};
|
|
33
|
-
export async function* paginateListEventTypes(
|
|
34
|
-
config: CodestarNotificationsPaginationConfiguration,
|
|
35
|
-
input: ListEventTypesCommandInput,
|
|
36
|
-
...additionalArguments: any
|
|
37
|
-
): Paginator<ListEventTypesCommandOutput> {
|
|
38
|
-
// ToDo: replace with actual type instead of typeof input.NextToken
|
|
39
|
-
let token: typeof input.NextToken | undefined = config.startingToken || undefined;
|
|
40
|
-
let hasNext = true;
|
|
41
|
-
let page: ListEventTypesCommandOutput;
|
|
42
|
-
while (hasNext) {
|
|
43
|
-
input.NextToken = token;
|
|
44
|
-
input["MaxResults"] = config.pageSize;
|
|
45
|
-
if (config.client instanceof CodestarNotifications) {
|
|
46
|
-
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
47
|
-
} else if (config.client instanceof CodestarNotificationsClient) {
|
|
48
|
-
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
49
|
-
} else {
|
|
50
|
-
throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient");
|
|
51
|
-
}
|
|
52
|
-
yield page;
|
|
53
|
-
token = page.NextToken;
|
|
54
|
-
hasNext = !!token;
|
|
55
|
-
}
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { CodestarNotifications } from "../CodestarNotifications";
|
|
2
|
-
import { CodestarNotificationsClient } from "../CodestarNotificationsClient";
|
|
3
|
-
import {
|
|
4
|
-
ListNotificationRulesCommand,
|
|
5
|
-
ListNotificationRulesCommandInput,
|
|
6
|
-
ListNotificationRulesCommandOutput,
|
|
7
|
-
} from "../commands/ListNotificationRulesCommand";
|
|
8
|
-
import { CodestarNotificationsPaginationConfiguration } from "./Interfaces";
|
|
9
|
-
import { Paginator } from "@aws-sdk/types";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
const makePagedClientRequest = async (
|
|
15
|
-
client: CodestarNotificationsClient,
|
|
16
|
-
input: ListNotificationRulesCommandInput,
|
|
17
|
-
...args: any
|
|
18
|
-
): Promise<ListNotificationRulesCommandOutput> => {
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
return await client.send(new ListNotificationRulesCommand(input), ...args);
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
const makePagedRequest = async (
|
|
26
|
-
client: CodestarNotifications,
|
|
27
|
-
input: ListNotificationRulesCommandInput,
|
|
28
|
-
...args: any
|
|
29
|
-
): Promise<ListNotificationRulesCommandOutput> => {
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
return await client.listNotificationRules(input, ...args);
|
|
32
|
-
};
|
|
33
|
-
export async function* paginateListNotificationRules(
|
|
34
|
-
config: CodestarNotificationsPaginationConfiguration,
|
|
35
|
-
input: ListNotificationRulesCommandInput,
|
|
36
|
-
...additionalArguments: any
|
|
37
|
-
): Paginator<ListNotificationRulesCommandOutput> {
|
|
38
|
-
// ToDo: replace with actual type instead of typeof input.NextToken
|
|
39
|
-
let token: typeof input.NextToken | undefined = config.startingToken || undefined;
|
|
40
|
-
let hasNext = true;
|
|
41
|
-
let page: ListNotificationRulesCommandOutput;
|
|
42
|
-
while (hasNext) {
|
|
43
|
-
input.NextToken = token;
|
|
44
|
-
input["MaxResults"] = config.pageSize;
|
|
45
|
-
if (config.client instanceof CodestarNotifications) {
|
|
46
|
-
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
47
|
-
} else if (config.client instanceof CodestarNotificationsClient) {
|
|
48
|
-
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
49
|
-
} else {
|
|
50
|
-
throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient");
|
|
51
|
-
}
|
|
52
|
-
yield page;
|
|
53
|
-
token = page.NextToken;
|
|
54
|
-
hasNext = !!token;
|
|
55
|
-
}
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CodestarNotifications } from "../CodestarNotifications";
|
|
2
|
-
import { CodestarNotificationsClient } from "../CodestarNotificationsClient";
|
|
3
|
-
import { ListTargetsCommand, ListTargetsCommandInput, ListTargetsCommandOutput } from "../commands/ListTargetsCommand";
|
|
4
|
-
import { CodestarNotificationsPaginationConfiguration } from "./Interfaces";
|
|
5
|
-
import { Paginator } from "@aws-sdk/types";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
*/
|
|
10
|
-
const makePagedClientRequest = async (
|
|
11
|
-
client: CodestarNotificationsClient,
|
|
12
|
-
input: ListTargetsCommandInput,
|
|
13
|
-
...args: any
|
|
14
|
-
): Promise<ListTargetsCommandOutput> => {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
return await client.send(new ListTargetsCommand(input), ...args);
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
const makePagedRequest = async (
|
|
22
|
-
client: CodestarNotifications,
|
|
23
|
-
input: ListTargetsCommandInput,
|
|
24
|
-
...args: any
|
|
25
|
-
): Promise<ListTargetsCommandOutput> => {
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
return await client.listTargets(input, ...args);
|
|
28
|
-
};
|
|
29
|
-
export async function* paginateListTargets(
|
|
30
|
-
config: CodestarNotificationsPaginationConfiguration,
|
|
31
|
-
input: ListTargetsCommandInput,
|
|
32
|
-
...additionalArguments: any
|
|
33
|
-
): Paginator<ListTargetsCommandOutput> {
|
|
34
|
-
// ToDo: replace with actual type instead of typeof input.NextToken
|
|
35
|
-
let token: typeof input.NextToken | undefined = config.startingToken || undefined;
|
|
36
|
-
let hasNext = true;
|
|
37
|
-
let page: ListTargetsCommandOutput;
|
|
38
|
-
while (hasNext) {
|
|
39
|
-
input.NextToken = token;
|
|
40
|
-
input["MaxResults"] = config.pageSize;
|
|
41
|
-
if (config.client instanceof CodestarNotifications) {
|
|
42
|
-
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
43
|
-
} else if (config.client instanceof CodestarNotificationsClient) {
|
|
44
|
-
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
45
|
-
} else {
|
|
46
|
-
throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient");
|
|
47
|
-
}
|
|
48
|
-
yield page;
|
|
49
|
-
token = page.NextToken;
|
|
50
|
-
hasNext = !!token;
|
|
51
|
-
}
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|