text: "use strict";
  var __extends = (this && this.__extends) || (function () {
      var extendStatics = function (d, b) {
          extendStatics = Object.setPrototypeOf ||
              ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
              function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
          return extendStatics(d, b);
      }
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  Object.defineProperty(exports, "__esModule", { value: true });
  /** @module errors */
  var ErrorCategory_1 = require("./ErrorCategory");
  var ApplicationException_1 = require("./ApplicationException");
  /**
   * Access errors caused by missing user identity (authentication error) or incorrect security permissions (authorization error).
   */
  var UnauthorizedException = /** @class */ (function (_super) {
      __extends(UnauthorizedException, _super);
      /**
       * Creates an error instance and assigns its values.
       *
       * @param correlation_id    (optional) a unique transaction id to trace execution through call chain.
       * @param code              (optional) a unique error code. Default: "UNKNOWN"
       * @param message           (optional) a human-readable description of the error.
       *
       * @see [[ErrorCategory]]
       */
      function UnauthorizedException(correlation_id, code, message) {
          if (correlation_id === void 0) { correlation_id = null; }
          if (code === void 0) { code = null; }
          if (message === void 0) { message = null; }
          var _this = _super.call(this, ErrorCategory_1.ErrorCategory.Unauthorized, correlation_id, code, message) || this;
          // Set the prototype explicitly.
          // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
          _this.__proto__ = UnauthorizedException.prototype;
          _this.status = 401;
          return _this;
      }
      return UnauthorizedException;
  }(ApplicationException_1.ApplicationException));
  exports.UnauthorizedException = UnauthorizedException;
  //# sourceMappingURL=UnauthorizedException.js.map