function MetadataEnum(options) {
  options = options ?? Frozen.EMPTY_OBJECT;
  const id = options.id;
  const values = options.values;

  //>>includeStart('debug', pragmas.debug);
  Check.typeOf.string("options.id", id);
  Check.defined("options.values", values);
  //>>includeEnd('debug');

  const namesByValue = {};
  const valuesByName = {};

  const valuesLength = values.length;
  for (let i = 0; i < valuesLength; ++i) {
    const value = values[i];
    namesByValue[value.value] = value.name;
    valuesByName[value.name] = value.value;
  }

  const valueType = options.valueType ?? MetadataComponentType.UINT16;

  this._values = values;
  this._namesByValue = namesByValue;
  this._valuesByName = valuesByName;
  this._valueType = valueType;
  this._id = id;
  this._name = options.name;
  this._description = options.description;
  this._extras = clone(options.extras, true);
  this._extensions = clone(options.extensions, true);
}
A metadata enum.
<p>
See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata|3D Metadata Specification} for 3D Tiles
</p>

@param {object} options Object with the following properties:
@param {string} options.id The ID of the enum.
@param {MetadataEnumValue[]} options.values The enum values.
@param {MetadataComponentType} [options.valueType=MetadataComponentType.UINT16] The enum value type.
@param {string} [options.name] The name of the enum.
@param {string} [options.description] The description of the enum.
@param {*} [options.extras] Extra user-defined properties.
@param {object} [options.extensions] An object containing extensions.

@alias MetadataEnum
@constructor
@experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.