"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 DownSamplingOperator.
 * @enum {string}
 * @readonly
 */
var DownSamplingOperator = {
  /** 
   * Unknown value.
    * @const
   */
  $UNKNOWN: "$UNKNOWN",
  /** 
   * Redacted value.
    * @const
   */
  $REDACTED: "$REDACTED",
  /** 
   * Aggregation with sum of all values.
    * @const
   */
  SUM: "SUM",
  /** 
   * Aggregation containing lowest of all values.
    * @const
   */
  MIN: "MIN",
  /** 
   * Aggregation containing highest of all values.
    * @const
   */
  MAX: "MAX",
  /** 
   * Aggregation indicating mean or average of all values.
    * @const
   */
  AVG: "AVG",
  /** 
   * Aggregation containing total count of values.
    * @const
   */
  COUNT: "COUNT",
  /** 
   * Aggregation containing only the last recorded value.
    * @const
   */
  LAST: "LAST"
};

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

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