@aws-sdk/client-codecommit 3.186.0 → 3.188.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 (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/CodeCommit.js +310 -317
  3. package/dist-es/CodeCommitClient.js +22 -28
  4. package/dist-es/commands/AssociateApprovalRuleTemplateWithRepositoryCommand.js +22 -29
  5. package/dist-es/commands/BatchAssociateApprovalRuleTemplateWithRepositoriesCommand.js +21 -28
  6. package/dist-es/commands/BatchDescribeMergeConflictsCommand.js +21 -28
  7. package/dist-es/commands/BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand.js +21 -28
  8. package/dist-es/commands/BatchGetCommitsCommand.js +21 -28
  9. package/dist-es/commands/BatchGetRepositoriesCommand.js +21 -28
  10. package/dist-es/commands/CreateApprovalRuleTemplateCommand.js +21 -28
  11. package/dist-es/commands/CreateBranchCommand.js +22 -29
  12. package/dist-es/commands/CreateCommitCommand.js +21 -28
  13. package/dist-es/commands/CreatePullRequestApprovalRuleCommand.js +21 -28
  14. package/dist-es/commands/CreatePullRequestCommand.js +21 -28
  15. package/dist-es/commands/CreateRepositoryCommand.js +21 -28
  16. package/dist-es/commands/CreateUnreferencedMergeCommitCommand.js +21 -28
  17. package/dist-es/commands/DeleteApprovalRuleTemplateCommand.js +21 -28
  18. package/dist-es/commands/DeleteBranchCommand.js +21 -28
  19. package/dist-es/commands/DeleteCommentContentCommand.js +21 -28
  20. package/dist-es/commands/DeleteFileCommand.js +21 -28
  21. package/dist-es/commands/DeletePullRequestApprovalRuleCommand.js +21 -28
  22. package/dist-es/commands/DeleteRepositoryCommand.js +21 -28
  23. package/dist-es/commands/DescribeMergeConflictsCommand.js +21 -28
  24. package/dist-es/commands/DescribePullRequestEventsCommand.js +21 -28
  25. package/dist-es/commands/DisassociateApprovalRuleTemplateFromRepositoryCommand.js +22 -29
  26. package/dist-es/commands/EvaluatePullRequestApprovalRulesCommand.js +21 -28
  27. package/dist-es/commands/GetApprovalRuleTemplateCommand.js +21 -28
  28. package/dist-es/commands/GetBlobCommand.js +21 -28
  29. package/dist-es/commands/GetBranchCommand.js +21 -28
  30. package/dist-es/commands/GetCommentCommand.js +21 -28
  31. package/dist-es/commands/GetCommentReactionsCommand.js +21 -28
  32. package/dist-es/commands/GetCommentsForComparedCommitCommand.js +21 -28
  33. package/dist-es/commands/GetCommentsForPullRequestCommand.js +21 -28
  34. package/dist-es/commands/GetCommitCommand.js +21 -28
  35. package/dist-es/commands/GetDifferencesCommand.js +21 -28
  36. package/dist-es/commands/GetFileCommand.js +21 -28
  37. package/dist-es/commands/GetFolderCommand.js +21 -28
  38. package/dist-es/commands/GetMergeCommitCommand.js +21 -28
  39. package/dist-es/commands/GetMergeConflictsCommand.js +21 -28
  40. package/dist-es/commands/GetMergeOptionsCommand.js +21 -28
  41. package/dist-es/commands/GetPullRequestApprovalStatesCommand.js +21 -28
  42. package/dist-es/commands/GetPullRequestCommand.js +21 -28
  43. package/dist-es/commands/GetPullRequestOverrideStateCommand.js +21 -28
  44. package/dist-es/commands/GetRepositoryCommand.js +21 -28
  45. package/dist-es/commands/GetRepositoryTriggersCommand.js +21 -28
  46. package/dist-es/commands/ListApprovalRuleTemplatesCommand.js +21 -28
  47. package/dist-es/commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand.js +21 -28
  48. package/dist-es/commands/ListBranchesCommand.js +21 -28
  49. package/dist-es/commands/ListPullRequestsCommand.js +21 -28
  50. package/dist-es/commands/ListRepositoriesCommand.js +21 -28
  51. package/dist-es/commands/ListRepositoriesForApprovalRuleTemplateCommand.js +21 -28
  52. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  53. package/dist-es/commands/MergeBranchesByFastForwardCommand.js +21 -28
  54. package/dist-es/commands/MergeBranchesBySquashCommand.js +21 -28
  55. package/dist-es/commands/MergeBranchesByThreeWayCommand.js +21 -28
  56. package/dist-es/commands/MergePullRequestByFastForwardCommand.js +21 -28
  57. package/dist-es/commands/MergePullRequestBySquashCommand.js +21 -28
  58. package/dist-es/commands/MergePullRequestByThreeWayCommand.js +21 -28
  59. package/dist-es/commands/OverridePullRequestApprovalRulesCommand.js +22 -29
  60. package/dist-es/commands/PostCommentForComparedCommitCommand.js +21 -28
  61. package/dist-es/commands/PostCommentForPullRequestCommand.js +21 -28
  62. package/dist-es/commands/PostCommentReplyCommand.js +21 -28
  63. package/dist-es/commands/PutCommentReactionCommand.js +22 -29
  64. package/dist-es/commands/PutFileCommand.js +21 -28
  65. package/dist-es/commands/PutRepositoryTriggersCommand.js +21 -28
  66. package/dist-es/commands/TagResourceCommand.js +22 -29
  67. package/dist-es/commands/TestRepositoryTriggersCommand.js +21 -28
  68. package/dist-es/commands/UntagResourceCommand.js +22 -29
  69. package/dist-es/commands/UpdateApprovalRuleTemplateContentCommand.js +21 -28
  70. package/dist-es/commands/UpdateApprovalRuleTemplateDescriptionCommand.js +21 -28
  71. package/dist-es/commands/UpdateApprovalRuleTemplateNameCommand.js +21 -28
  72. package/dist-es/commands/UpdateCommentCommand.js +21 -28
  73. package/dist-es/commands/UpdateDefaultBranchCommand.js +22 -29
  74. package/dist-es/commands/UpdatePullRequestApprovalRuleContentCommand.js +21 -28
  75. package/dist-es/commands/UpdatePullRequestApprovalStateCommand.js +22 -29
  76. package/dist-es/commands/UpdatePullRequestDescriptionCommand.js +21 -28
  77. package/dist-es/commands/UpdatePullRequestStatusCommand.js +21 -28
  78. package/dist-es/commands/UpdatePullRequestTitleCommand.js +21 -28
  79. package/dist-es/commands/UpdateRepositoryDescriptionCommand.js +22 -29
  80. package/dist-es/commands/UpdateRepositoryNameCommand.js +22 -29
  81. package/dist-es/endpoints.js +8 -8
  82. package/dist-es/models/CodeCommitServiceException.js +5 -10
  83. package/dist-es/models/models_0.js +2157 -1872
  84. package/dist-es/models/models_1.js +660 -549
  85. package/dist-es/pagination/DescribeMergeConflictsPaginator.js +25 -68
  86. package/dist-es/pagination/DescribePullRequestEventsPaginator.js +25 -68
  87. package/dist-es/pagination/GetCommentReactionsPaginator.js +25 -68
  88. package/dist-es/pagination/GetCommentsForComparedCommitPaginator.js +25 -68
  89. package/dist-es/pagination/GetCommentsForPullRequestPaginator.js +25 -68
  90. package/dist-es/pagination/GetDifferencesPaginator.js +25 -68
  91. package/dist-es/pagination/GetMergeConflictsPaginator.js +25 -68
  92. package/dist-es/pagination/ListApprovalRuleTemplatesPaginator.js +25 -68
  93. package/dist-es/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.js +25 -68
  94. package/dist-es/pagination/ListBranchesPaginator.js +24 -67
  95. package/dist-es/pagination/ListPullRequestsPaginator.js +25 -68
  96. package/dist-es/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.js +25 -68
  97. package/dist-es/pagination/ListRepositoriesPaginator.js +24 -67
  98. package/dist-es/protocols/Aws_json1_1.js +9002 -11195
  99. package/dist-es/runtimeConfig.browser.js +26 -12
  100. package/dist-es/runtimeConfig.js +30 -12
  101. package/dist-es/runtimeConfig.native.js +8 -5
  102. package/dist-es/runtimeConfig.shared.js +8 -11
  103. package/package.json +33 -33
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { GetMergeConflictsCommand, } from "../commands/GetMergeConflictsCommand";
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 GetMergeConflictsCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new GetMergeConflictsCommand(input), ...args);
18
6
  };
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.getMergeConflicts.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.getMergeConflicts(input, ...args);
32
9
  };
33
- export function paginateGetMergeConflicts(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateGetMergeConflicts(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxConflictFiles"] = config.pageSize;
17
+ if (config.client instanceof CodeCommit) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof CodeCommitClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateGetMergeConflicts_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["maxConflictFiles"] = config.pageSize;
50
- if (!(config.client instanceof CodeCommit)) 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 CodeCommitClient)) 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 CodeCommit | CodeCommitClient");
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
- });
31
+ return undefined;
75
32
  }
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { ListApprovalRuleTemplatesCommand, } from "../commands/ListApprovalRuleTemplatesCommand";
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 ListApprovalRuleTemplatesCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListApprovalRuleTemplatesCommand(input), ...args);
18
6
  };
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.listApprovalRuleTemplates.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listApprovalRuleTemplates(input, ...args);
32
9
  };
33
- export function paginateListApprovalRuleTemplates(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListApprovalRuleTemplates(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof CodeCommit) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof CodeCommitClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListApprovalRuleTemplates_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 CodeCommit)) 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 CodeCommitClient)) 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 CodeCommit | CodeCommitClient");
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
- });
31
+ return undefined;
75
32
  }
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { ListAssociatedApprovalRuleTemplatesForRepositoryCommand, } from "../commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand";
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 ListAssociatedApprovalRuleTemplatesForRepositoryCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListAssociatedApprovalRuleTemplatesForRepositoryCommand(input), ...args);
18
6
  };
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.listAssociatedApprovalRuleTemplatesForRepository.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listAssociatedApprovalRuleTemplatesForRepository(input, ...args);
32
9
  };
33
- export function paginateListAssociatedApprovalRuleTemplatesForRepository(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListAssociatedApprovalRuleTemplatesForRepository(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof CodeCommit) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof CodeCommitClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListAssociatedApprovalRuleTemplatesForRepository_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 CodeCommit)) 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 CodeCommitClient)) 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 CodeCommit | CodeCommitClient");
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
- });
31
+ return undefined;
75
32
  }
@@ -1,74 +1,31 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { ListBranchesCommand, } from "../commands/ListBranchesCommand";
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 ListBranchesCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListBranchesCommand(input), ...args);
18
6
  };
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.listBranches.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listBranches(input, ...args);
32
9
  };
33
- export function paginateListBranches(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListBranches(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ if (config.client instanceof CodeCommit) {
17
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
18
+ }
19
+ else if (config.client instanceof CodeCommitClient) {
20
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
21
+ }
22
+ else {
23
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
24
+ }
25
+ yield page;
26
+ const prevToken = token;
27
+ token = page.nextToken;
28
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
29
  }
38
- return __asyncGenerator(this, arguments, function paginateListBranches_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
- if (!(config.client instanceof CodeCommit)) return [3, 3];
50
- return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
51
- case 2:
52
- page = _a.sent();
53
- return [3, 6];
54
- case 3:
55
- if (!(config.client instanceof CodeCommitClient)) return [3, 5];
56
- return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
57
- case 4:
58
- page = _a.sent();
59
- return [3, 6];
60
- case 5: throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
61
- case 6: return [4, __await(page)];
62
- case 7: return [4, _a.sent()];
63
- case 8:
64
- _a.sent();
65
- prevToken = token;
66
- token = page.nextToken;
67
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
68
- return [3, 1];
69
- case 9: return [4, __await(undefined)];
70
- case 10: return [2, _a.sent()];
71
- }
72
- });
73
- });
30
+ return undefined;
74
31
  }
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { ListPullRequestsCommand, } from "../commands/ListPullRequestsCommand";
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 ListPullRequestsCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListPullRequestsCommand(input), ...args);
18
6
  };
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.listPullRequests.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listPullRequests(input, ...args);
32
9
  };
33
- export function paginateListPullRequests(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListPullRequests(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof CodeCommit) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof CodeCommitClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListPullRequests_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 CodeCommit)) 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 CodeCommitClient)) 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 CodeCommit | CodeCommitClient");
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
- });
31
+ return undefined;
75
32
  }
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { CodeCommit } from "../CodeCommit";
3
2
  import { CodeCommitClient } from "../CodeCommitClient";
4
3
  import { ListRepositoriesForApprovalRuleTemplateCommand, } from "../commands/ListRepositoriesForApprovalRuleTemplateCommand";
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 ListRepositoriesForApprovalRuleTemplateCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListRepositoriesForApprovalRuleTemplateCommand(input), ...args);
18
6
  };
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.listRepositoriesForApprovalRuleTemplate.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listRepositoriesForApprovalRuleTemplate(input, ...args);
32
9
  };
33
- export function paginateListRepositoriesForApprovalRuleTemplate(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListRepositoriesForApprovalRuleTemplate(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof CodeCommit) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof CodeCommitClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected CodeCommit | CodeCommitClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListRepositoriesForApprovalRuleTemplate_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 CodeCommit)) 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 CodeCommitClient)) 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 CodeCommit | CodeCommitClient");
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
- });
31
+ return undefined;
75
32
  }