"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 BgpRouteType.
 * @enum {string}
 * @readonly
 */
var BgpRouteType = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * BGP route is an advertised route.
   * @const
   */
  ADVERTISED: "ADVERTISED",
  /** 
   * BGP route is a received route.
   * @const
   */
  RECEIVED: "RECEIVED",
  /** 
   * BGP route is received but has not been programmed in the route table.
   * @const
   */
  RECEIVED_AND_IGNORED: "RECEIVED_AND_IGNORED"
};

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

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