@aws-sdk/client-mq 3.476.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.
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListBrokers = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const ListBrokersCommand_1 = require("../commands/ListBrokersCommand");
5
6
  const MqClient_1 = require("../MqClient");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListBrokersCommand_1.ListBrokersCommand(input), ...args);
8
- };
9
- async function* paginateListBrokers(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 MqClient_1.MqClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected Mq | MqClient");
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.paginateListBrokers = paginateListBrokers;
7
+ exports.paginateListBrokers = (0, core_1.createPaginator)(MqClient_1.MqClient, ListBrokersCommand_1.ListBrokersCommand, "NextToken", "NextToken", "MaxResults");