text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.PubSubBitsBadgeUnlockMessage = void 0;
  var tslib_1 = require("tslib");
  var shared_utils_1 = require("@d-fischer/shared-utils");
  var twitch_common_1 = require("twitch-common");
  /**
   * A message that informs about a user unlocking a new bits badge.
   */
  var PubSubBitsBadgeUnlockMessage = /** @class */ (function () {
      /** @private */
      function PubSubBitsBadgeUnlockMessage(data, apiClient) {
          this._data = data;
          this._apiClient = apiClient;
      }
      Object.defineProperty(PubSubBitsBadgeUnlockMessage.prototype, "userId", {
          /**
           * The ID of the user that unlocked the badge.
           */
          get: function () {
              return this._data.data.user_id;
          },
          enumerable: false,
          configurable: true
      });
      Object.defineProperty(PubSubBitsBadgeUnlockMessage.prototype, "userName", {
          /**
           * The name of the user that unlocked the badge.
           */
          get: function () {
              return this._data.data.user_name;
          },
          enumerable: false,
          configurable: true
      });
      /**
       * Retrieves more information about the user.
       *
       * @deprecated Use {@HelixUserApi#getUserById} instead.
       */
      PubSubBitsBadgeUnlockMessage.prototype.getUser = function () {
          return tslib_1.__awaiter(this, void 0, void 0, function () {
              return tslib_1.__generator(this, function (_a) {
                  return [2 /*return*/, this._data.data.user_id ? this._apiClient.helix.users.getUserById(this._data.data.user_id) : null];
              });
          });
      };
      Object.defineProperty(PubSubBitsBadgeUnlockMessage.prototype, "message", {
          /**
           * The full message that was sent with the notification.
           */
          get: function () {
              return this._data.data.chat_message;
          },
          enumerable: false,
          configurable: true
      });
      Object.defineProperty(PubSubBitsBadgeUnlockMessage.prototype, "badgeTier", {
          /**
           * The new badge tier.
           */
          get: function () {
              return this._data.data.badge_tier;
          },
          enumerable: false,
          configurable: true
      });
      tslib_1.__decorate([
          shared_utils_1.Enumerable(false)
      ], PubSubBitsBadgeUnlockMessage.prototype, "_apiClient", void 0);
      tslib_1.__decorate([
          shared_utils_1.Enumerable(false)
      ], PubSubBitsBadgeUnlockMessage.prototype, "_data", void 0);
      PubSubBitsBadgeUnlockMessage = tslib_1.__decorate([
          twitch_common_1.rtfm('twitch-pubsub-client', 'PubSubBitsBadgeUnlockMessage', 'userId')
      ], PubSubBitsBadgeUnlockMessage);
      return PubSubBitsBadgeUnlockMessage;
  }());
  exports.PubSubBitsBadgeUnlockMessage = PubSubBitsBadgeUnlockMessage;
  