"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 NexthopType.
 * @enum {string}
 * @readonly
 */
var NexthopType = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * Next hop is an IP address.
   * @const
   */
  IP_ADDRESS: "IP_ADDRESS",
  /** 
   * Next hop is a direct connect VIF.
   * @const
   */
  DIRECT_CONNECT_VIF: "DIRECT_CONNECT_VIF",
  /** 
   * Next hop is an internal subnet.
   * @const
   */
  LOCAL_SUBNET: "LOCAL_SUBNET",
  /** 
   * Next hop is an external subnet.
   * @const
   */
  EXTERNAL_SUBNET: "EXTERNAL_SUBNET",
  /** 
   * Next hop is a VPN connection.
   * @const
   */
  VPN_CONNECTION: "VPN_CONNECTION"
};

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

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