// Code generated by "enumer -type=MachineStage -type=KernelModuleState -type=KernelModuleType -type=FIPSState -type=SELinuxState -type=UnattendedInstallPhase -linecomment -text"; DO NOT EDIT.

package runtime

import (
	"fmt"
	"strings"
)

const _UnattendedInstallPhaseName = "pendinginstallinginstalledwaiting-for-rebootfailed"

var _UnattendedInstallPhaseIndex = [...]uint8{0, 7, 17, 26, 44, 50}

const _UnattendedInstallPhaseLowerName = "pendinginstallinginstalledwaiting-for-rebootfailed"

func (i UnattendedInstallPhase) String() string {
	if i < 0 || i >= UnattendedInstallPhase(len(_UnattendedInstallPhaseIndex)-1) {
		return fmt.Sprintf("UnattendedInstallPhase(%d)", i)
	}
	return _UnattendedInstallPhaseName[_UnattendedInstallPhaseIndex[i]:_UnattendedInstallPhaseIndex[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 _UnattendedInstallPhaseNoOp() {
	var x [1]struct{}
	_ = x[UnattendedInstallPhasePending-(0)]
	_ = x[UnattendedInstallPhaseInstalling-(1)]
	_ = x[UnattendedInstallPhaseInstalled-(2)]
	_ = x[UnattendedInstallPhaseWaitingForReboot-(3)]
	_ = x[UnattendedInstallPhaseFailed-(4)]
}

var _UnattendedInstallPhaseValues = []UnattendedInstallPhase{UnattendedInstallPhasePending, UnattendedInstallPhaseInstalling, UnattendedInstallPhaseInstalled, UnattendedInstallPhaseWaitingForReboot, UnattendedInstallPhaseFailed}

var _UnattendedInstallPhaseNameToValueMap = map[string]UnattendedInstallPhase{
	_UnattendedInstallPhaseName[0:7]:        UnattendedInstallPhasePending,
	_UnattendedInstallPhaseLowerName[0:7]:   UnattendedInstallPhasePending,
	_UnattendedInstallPhaseName[7:17]:       UnattendedInstallPhaseInstalling,
	_UnattendedInstallPhaseLowerName[7:17]:  UnattendedInstallPhaseInstalling,
	_UnattendedInstallPhaseName[17:26]:      UnattendedInstallPhaseInstalled,
	_UnattendedInstallPhaseLowerName[17:26]: UnattendedInstallPhaseInstalled,
	_UnattendedInstallPhaseName[26:44]:      UnattendedInstallPhaseWaitingForReboot,
	_UnattendedInstallPhaseLowerName[26:44]: UnattendedInstallPhaseWaitingForReboot,
	_UnattendedInstallPhaseName[44:50]:      UnattendedInstallPhaseFailed,
	_UnattendedInstallPhaseLowerName[44:50]: UnattendedInstallPhaseFailed,
}

var _UnattendedInstallPhaseNames = []string{
	_UnattendedInstallPhaseName[0:7],
	_UnattendedInstallPhaseName[7:17],
	_UnattendedInstallPhaseName[17:26],
	_UnattendedInstallPhaseName[26:44],
	_UnattendedInstallPhaseName[44:50],
}

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

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

// UnattendedInstallPhaseValues returns all values of the enum
func UnattendedInstallPhaseValues() []UnattendedInstallPhase {
	return _UnattendedInstallPhaseValues
}

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

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

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

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