"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 MacType.
 * @enum {string}
 * @readonly
 */
var MacType = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * A MAC address that was learned (i.e. through a Layer2 Stretch).
   * @const
   */
  LEARNED: "LEARNED",
  /** 
   * A MAC address that was automatically assigned.
   * @const
   */
  AUTO_ASSIGNED: "AUTO_ASSIGNED",
  /** 
   * A MAC address that was user assigned.
   * @const
   */
  USER_ASSIGNED: "USER_ASSIGNED"
};

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

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