"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 RoutingPolicyActionType.
 * @enum {string}
 * @readonly
 */
var RoutingPolicyActionType = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * Routing policy action type is permit/allow
   * @const
   */
  PERMIT: "PERMIT",
  /** 
   * Routing policy action type is deny/drop
   * @const
   */
  DENY: "DENY",
  /** 
   * Routing policy action type is reroute and need to specify service IP to which traffic is rerouted
   * @const
   */
  REROUTE: "REROUTE",
  /** 
   * Routing policy action type is forward
   * @const
   */
  FORWARD: "FORWARD"
};

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

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