// Code generated by "enumer -type=LVMLogicalVolumeType,MDLevel,MDMetadata,MDArrayPhase -linecomment -text"; DO NOT EDIT.

package storage

import (
	"fmt"
	"strings"
)

const _LVMLogicalVolumeTypeName = "linearraid1raid0raid10"

var _LVMLogicalVolumeTypeIndex = [...]uint8{0, 6, 11, 16, 22}

const _LVMLogicalVolumeTypeLowerName = "linearraid1raid0raid10"

func (i LVMLogicalVolumeType) String() string {
	if i < 0 || i >= LVMLogicalVolumeType(len(_LVMLogicalVolumeTypeIndex)-1) {
		return fmt.Sprintf("LVMLogicalVolumeType(%d)", i)
	}
	return _LVMLogicalVolumeTypeName[_LVMLogicalVolumeTypeIndex[i]:_LVMLogicalVolumeTypeIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _LVMLogicalVolumeTypeNoOp() {
	var x [1]struct{}
	_ = x[LVMLogicalVolumeTypeLinear-(0)]
	_ = x[LVMLogicalVolumeTypeRAID1-(1)]
	_ = x[LVMLogicalVolumeTypeRAID0-(2)]
	_ = x[LVMLogicalVolumeTypeRAID10-(3)]
}

var _LVMLogicalVolumeTypeValues = []LVMLogicalVolumeType{LVMLogicalVolumeTypeLinear, LVMLogicalVolumeTypeRAID1, LVMLogicalVolumeTypeRAID0, LVMLogicalVolumeTypeRAID10}

var _LVMLogicalVolumeTypeNameToValueMap = map[string]LVMLogicalVolumeType{
	_LVMLogicalVolumeTypeName[0:6]:        LVMLogicalVolumeTypeLinear,
	_LVMLogicalVolumeTypeLowerName[0:6]:   LVMLogicalVolumeTypeLinear,
	_LVMLogicalVolumeTypeName[6:11]:       LVMLogicalVolumeTypeRAID1,
	_LVMLogicalVolumeTypeLowerName[6:11]:  LVMLogicalVolumeTypeRAID1,
	_LVMLogicalVolumeTypeName[11:16]:      LVMLogicalVolumeTypeRAID0,
	_LVMLogicalVolumeTypeLowerName[11:16]: LVMLogicalVolumeTypeRAID0,
	_LVMLogicalVolumeTypeName[16:22]:      LVMLogicalVolumeTypeRAID10,
	_LVMLogicalVolumeTypeLowerName[16:22]: LVMLogicalVolumeTypeRAID10,
}

var _LVMLogicalVolumeTypeNames = []string{
	_LVMLogicalVolumeTypeName[0:6],
	_LVMLogicalVolumeTypeName[6:11],
	_LVMLogicalVolumeTypeName[11:16],
	_LVMLogicalVolumeTypeName[16:22],
}

// LVMLogicalVolumeTypeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func LVMLogicalVolumeTypeString(s string) (LVMLogicalVolumeType, error) {
	if val, ok := _LVMLogicalVolumeTypeNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _LVMLogicalVolumeTypeNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to LVMLogicalVolumeType values", s)
}

// LVMLogicalVolumeTypeValues returns all values of the enum
func LVMLogicalVolumeTypeValues() []LVMLogicalVolumeType {
	return _LVMLogicalVolumeTypeValues
}

// LVMLogicalVolumeTypeStrings returns a slice of all String values of the enum
func LVMLogicalVolumeTypeStrings() []string {
	strs := make([]string, len(_LVMLogicalVolumeTypeNames))
	copy(strs, _LVMLogicalVolumeTypeNames)
	return strs
}

// IsALVMLogicalVolumeType returns "true" if the value is listed in the enum definition. "false" otherwise
func (i LVMLogicalVolumeType) IsALVMLogicalVolumeType() bool {
	for _, v := range _LVMLogicalVolumeTypeValues {
		if i == v {
			return true
		}
	}
	return false
}

// MarshalText implements the encoding.TextMarshaler interface for LVMLogicalVolumeType
func (i LVMLogicalVolumeType) MarshalText() ([]byte, error) {
	return []byte(i.String()), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface for LVMLogicalVolumeType
func (i *LVMLogicalVolumeType) UnmarshalText(text []byte) error {
	var err error
	*i, err = LVMLogicalVolumeTypeString(string(text))
	return err
}

const _MDLevelName = "raid1"

var _MDLevelIndex = [...]uint8{0, 5}

const _MDLevelLowerName = "raid1"

func (i MDLevel) String() string {
	if i < 0 || i >= MDLevel(len(_MDLevelIndex)-1) {
		return fmt.Sprintf("MDLevel(%d)", i)
	}
	return _MDLevelName[_MDLevelIndex[i]:_MDLevelIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _MDLevelNoOp() {
	var x [1]struct{}
	_ = x[MDLevelRAID1-(0)]
}

var _MDLevelValues = []MDLevel{MDLevelRAID1}

var _MDLevelNameToValueMap = map[string]MDLevel{
	_MDLevelName[0:5]:      MDLevelRAID1,
	_MDLevelLowerName[0:5]: MDLevelRAID1,
}

var _MDLevelNames = []string{
	_MDLevelName[0:5],
}

// MDLevelString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func MDLevelString(s string) (MDLevel, error) {
	if val, ok := _MDLevelNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _MDLevelNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to MDLevel values", s)
}

// MDLevelValues returns all values of the enum
func MDLevelValues() []MDLevel {
	return _MDLevelValues
}

// MDLevelStrings returns a slice of all String values of the enum
func MDLevelStrings() []string {
	strs := make([]string, len(_MDLevelNames))
	copy(strs, _MDLevelNames)
	return strs
}

// IsAMDLevel returns "true" if the value is listed in the enum definition. "false" otherwise
func (i MDLevel) IsAMDLevel() bool {
	for _, v := range _MDLevelValues {
		if i == v {
			return true
		}
	}
	return false
}

// MarshalText implements the encoding.TextMarshaler interface for MDLevel
func (i MDLevel) MarshalText() ([]byte, error) {
	return []byte(i.String()), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface for MDLevel
func (i *MDLevel) UnmarshalText(text []byte) error {
	var err error
	*i, err = MDLevelString(string(text))
	return err
}

const _MDMetadataName = "1.01.2"

var _MDMetadataIndex = [...]uint8{0, 3, 6}

const _MDMetadataLowerName = "1.01.2"

func (i MDMetadata) String() string {
	if i < 0 || i >= MDMetadata(len(_MDMetadataIndex)-1) {
		return fmt.Sprintf("MDMetadata(%d)", i)
	}
	return _MDMetadataName[_MDMetadataIndex[i]:_MDMetadataIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _MDMetadataNoOp() {
	var x [1]struct{}
	_ = x[MDMetadata10-(0)]
	_ = x[MDMetadata12-(1)]
}

var _MDMetadataValues = []MDMetadata{MDMetadata10, MDMetadata12}

var _MDMetadataNameToValueMap = map[string]MDMetadata{
	_MDMetadataName[0:3]:      MDMetadata10,
	_MDMetadataLowerName[0:3]: MDMetadata10,
	_MDMetadataName[3:6]:      MDMetadata12,
	_MDMetadataLowerName[3:6]: MDMetadata12,
}

var _MDMetadataNames = []string{
	_MDMetadataName[0:3],
	_MDMetadataName[3:6],
}

// MDMetadataString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func MDMetadataString(s string) (MDMetadata, error) {
	if val, ok := _MDMetadataNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _MDMetadataNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to MDMetadata values", s)
}

// MDMetadataValues returns all values of the enum
func MDMetadataValues() []MDMetadata {
	return _MDMetadataValues
}

// MDMetadataStrings returns a slice of all String values of the enum
func MDMetadataStrings() []string {
	strs := make([]string, len(_MDMetadataNames))
	copy(strs, _MDMetadataNames)
	return strs
}

// IsAMDMetadata returns "true" if the value is listed in the enum definition. "false" otherwise
func (i MDMetadata) IsAMDMetadata() bool {
	for _, v := range _MDMetadataValues {
		if i == v {
			return true
		}
	}
	return false
}

// MarshalText implements the encoding.TextMarshaler interface for MDMetadata
func (i MDMetadata) MarshalText() ([]byte, error) {
	return []byte(i.String()), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface for MDMetadata
func (i *MDMetadata) UnmarshalText(text []byte) error {
	var err error
	*i, err = MDMetadataString(string(text))
	return err
}

const _MDArrayPhaseName = "unknownwaitingrebuildingreadyerror"

var _MDArrayPhaseIndex = [...]uint8{0, 7, 14, 24, 29, 34}

const _MDArrayPhaseLowerName = "unknownwaitingrebuildingreadyerror"

func (i MDArrayPhase) String() string {
	if i < 0 || i >= MDArrayPhase(len(_MDArrayPhaseIndex)-1) {
		return fmt.Sprintf("MDArrayPhase(%d)", i)
	}
	return _MDArrayPhaseName[_MDArrayPhaseIndex[i]:_MDArrayPhaseIndex[i+1]]
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _MDArrayPhaseNoOp() {
	var x [1]struct{}
	_ = x[MDArrayPhaseUnknown-(0)]
	_ = x[MDArrayPhaseWaiting-(1)]
	_ = x[MDArrayPhaseRebuilding-(2)]
	_ = x[MDArrayPhaseReady-(3)]
	_ = x[MDArrayPhaseError-(4)]
}

var _MDArrayPhaseValues = []MDArrayPhase{MDArrayPhaseUnknown, MDArrayPhaseWaiting, MDArrayPhaseRebuilding, MDArrayPhaseReady, MDArrayPhaseError}

var _MDArrayPhaseNameToValueMap = map[string]MDArrayPhase{
	_MDArrayPhaseName[0:7]:        MDArrayPhaseUnknown,
	_MDArrayPhaseLowerName[0:7]:   MDArrayPhaseUnknown,
	_MDArrayPhaseName[7:14]:       MDArrayPhaseWaiting,
	_MDArrayPhaseLowerName[7:14]:  MDArrayPhaseWaiting,
	_MDArrayPhaseName[14:24]:      MDArrayPhaseRebuilding,
	_MDArrayPhaseLowerName[14:24]: MDArrayPhaseRebuilding,
	_MDArrayPhaseName[24:29]:      MDArrayPhaseReady,
	_MDArrayPhaseLowerName[24:29]: MDArrayPhaseReady,
	_MDArrayPhaseName[29:34]:      MDArrayPhaseError,
	_MDArrayPhaseLowerName[29:34]: MDArrayPhaseError,
}

var _MDArrayPhaseNames = []string{
	_MDArrayPhaseName[0:7],
	_MDArrayPhaseName[7:14],
	_MDArrayPhaseName[14:24],
	_MDArrayPhaseName[24:29],
	_MDArrayPhaseName[29:34],
}

// MDArrayPhaseString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func MDArrayPhaseString(s string) (MDArrayPhase, error) {
	if val, ok := _MDArrayPhaseNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _MDArrayPhaseNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to MDArrayPhase values", s)
}

// MDArrayPhaseValues returns all values of the enum
func MDArrayPhaseValues() []MDArrayPhase {
	return _MDArrayPhaseValues
}

// MDArrayPhaseStrings returns a slice of all String values of the enum
func MDArrayPhaseStrings() []string {
	strs := make([]string, len(_MDArrayPhaseNames))
	copy(strs, _MDArrayPhaseNames)
	return strs
}

// IsAMDArrayPhase returns "true" if the value is listed in the enum definition. "false" otherwise
func (i MDArrayPhase) IsAMDArrayPhase() bool {
	for _, v := range _MDArrayPhaseValues {
		if i == v {
			return true
		}
	}
	return false
}

// MarshalText implements the encoding.TextMarshaler interface for MDArrayPhase
func (i MDArrayPhase) MarshalText() ([]byte, error) {
	return []byte(i.String()), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface for MDArrayPhase
func (i *MDArrayPhase) UnmarshalText(text []byte) error {
	var err error
	*i, err = MDArrayPhaseString(string(text))
	return err
}
