"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/*
 * Nutanix Networking APIs
 *
 * OpenAPI spec version: 4.0.1
 *
 * NOTE: This class is auto generated by the Open API Dev Platform.
 *
 * Open API Dev Platform Codegen version: 16.9.0.8546-RELEASE
 *
 * Do not edit the class manually.
 *
 */

/**
 * Enum class RerouteFallbackAction.
 * @enum {string}
 * @readonly
 */
var RerouteFallbackAction = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * When service vm is down, reroute fallback action is "allowed".
   * @const
   */
  ALLOW: "ALLOW",
  /** 
   * When service vm is down, reroute fallback action is "drop".
   * @const
   */
  DROP: "DROP",
  /** 
   * When service vm is down, reroute fallback action is "passthrough". Next higher priority matching rule is applied.
   * @const
   */
  PASSTHROUGH: "PASSTHROUGH",
  /** 
   * When service vm is down and reroute fallback action is "NO_ACTION". No action is taken and traffic is black-holed.
   * @const
   */
  NO_ACTION: "NO_ACTION"
};

/**
* Returns a <code>RerouteFallbackAction</code> enum value from a JavaScript object name.
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
* @return {RerouteFallbackAction} The enum <code>RerouteFallbackAction</code> value.
*/
RerouteFallbackAction.constructFromObject = function (obj) {
  if (typeof obj === 'string' || obj instanceof String) {
    var enumVal = Object.keys(RerouteFallbackAction).find(function (key) {
      return RerouteFallbackAction[key] === obj;
    });
    return enumVal === undefined || enumVal === null ? RerouteFallbackAction.$UNKNOWN : RerouteFallbackAction[enumVal];
  } else {
    throw new Error("Received object name is not an instance of String");
  }
};

/**
* Validates <code>RerouteFallbackAction</code> enum value.
* @param {Object} obj The plain JavaScript object containing the name of the enum value.
* @return {null} Throws error for invalid value.
*/
RerouteFallbackAction.validate = function (obj) {
  switch (obj) {
    case RerouteFallbackAction.$UNKNOWN:
    case RerouteFallbackAction.$REDACTED:
    case RerouteFallbackAction.ALLOW:
    case RerouteFallbackAction.DROP:
    case RerouteFallbackAction.PASSTHROUGH:
    case RerouteFallbackAction.NO_ACTION:
      return;
    default:
      throw new Error("Invalid : must be RerouteFallbackAction.{ $UNKNOWN|$REDACTED|ALLOW|DROP|PASSTHROUGH|NO_ACTION }");
  }
};
Object.freeze(RerouteFallbackAction);
var _default = exports["default"] = RerouteFallbackAction;