text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.listStreamConsumersPaginate = void 0;
  const Kinesis_1 = require("../Kinesis");
  const KinesisClient_1 = require("../KinesisClient");
  const ListStreamConsumersCommand_1 = require("../commands/ListStreamConsumersCommand");
  const makePagedClientRequest = async (client, input, ...args) => {
      // @ts-ignore
      return await client.send(new ListStreamConsumersCommand_1.ListStreamConsumersCommand(input, ...args));
  };
  const makePagedRequest = async (client, input, ...args) => {
      // @ts-ignore
      return await client.listStreamConsumers(input, ...args);
  };
  async function* listStreamConsumersPaginate(config, input, ...additionalArguments) {
      let token = config.startingToken || undefined;
      let hasNext = true;
      let page;
      while (hasNext) {
          input.NextToken = token;
          input["MaxResults"] = config.pageSize;
          if (config.client instanceof Kinesis_1.Kinesis) {
              page = await makePagedRequest(config.client, input, ...additionalArguments);
          }
          else if (config.client instanceof KinesisClient_1.KinesisClient) {
              page = await makePagedClientRequest(config.client, input, ...additionalArguments);
          }
          else {
              throw new Error("Invalid client, expected Kinesis | KinesisClient");
          }
          yield page;
          token = page.NextToken;
          hasNext = !!token;
      }
      // @ts-ignore
      return undefined;
  }
  exports.listStreamConsumersPaginate = listStreamConsumersPaginate;
  //# sourceMappingURL=ListStreamConsumersPaginator.js.map