"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 State.
 * @enum {string}
 * @readonly
 */
var State = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * Component is up and running.
   * @const
   */
  UP: "UP",
  /** 
   * Component is not functional and down.
   * @const
   */
  DOWN: "DOWN"
};

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

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