"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 ReserveType.
 * @enum {string}
 * @readonly
 */
var ReserveType = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * Reserve IP address based on the number of IPs specified.
   * @const
   */
  IP_ADDRESS_COUNT: "IP_ADDRESS_COUNT",
  /** 
   * Reserve IP address based on the given IP range.
   * @const
   */
  IP_ADDRESS_RANGE: "IP_ADDRESS_RANGE",
  /** 
   * Reserve IP address based on the given IP address list.
   * @const
   */
  IP_ADDRESS_LIST: "IP_ADDRESS_LIST"
};

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

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