text: "use strict";
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
      function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
      return new (P || (P = Promise))(function (resolve, reject) {
          function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
          function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
          function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
          step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.RequestDisassembler = void 0;
  /**
   * @module botframework-streaming
   */
  /**
   * Copyright (c) Microsoft Corporation. All rights reserved.
   * Licensed under the MIT License.
   */
  const payloadTypes_1 = require("../payloads/payloadTypes");
  const payloadDisassembler_1 = require("./payloadDisassembler");
  /**
   * Streaming request disassembler.
   */
  class RequestDisassembler extends payloadDisassembler_1.PayloadDisassembler {
      /**
       * Initializes a new instance of the [RequestDisassembler](xref:botframework-streaming.RequestDisassembler) class.
       * @param sender The [PayloadSender](xref:botframework-streaming.PayloadSender) to send the disassembled data to.
       * @param id The ID of this disassembler.
       * @param request The request to be disassembled.
       */
      constructor(sender, id, request) {
          super(sender, id);
          this.payloadType = payloadTypes_1.PayloadTypes.request;
          this.request = request;
      }
      /**
       * Gets the stream this disassembler is operating on.
       * @returns An [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) with a Subscribable Stream.
       */
      getStream() {
          return __awaiter(this, void 0, void 0, function* () {
              const payload = { verb: this.request.verb, path: this.request.path, streams: [] };
              if (this.request.streams) {
                  this.request.streams.forEach(function (stream) {
                      payload.streams.push(stream.description);
                  });
              }
              return payloadDisassembler_1.PayloadDisassembler.serialize(payload);
          });
      }
  }
  exports.RequestDisassembler = RequestDisassembler;
  //# sourceMappingURL=requestDisassembler.js.map