// Code generated by "enumer -type Stage -trimprefix Stage -output stage_enum.go"; DO NOT EDIT.

package proto

import (
	"fmt"
	"strings"
)

const _StageName = "FetchColumnsWithMergeableStateComplete"

var _StageIndex = [...]uint8{0, 12, 30, 38}

const _StageLowerName = "fetchcolumnswithmergeablestatecomplete"

func (i Stage) String() string {
	if i >= Stage(len(_StageIndex)-1) {
		return fmt.Sprintf("Stage(%d)", i)
	}
	return _StageName[_StageIndex[i]:_StageIndex[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 _StageNoOp() {
	var x [1]struct{}
	_ = x[StageFetchColumns-(0)]
	_ = x[StageWithMergeableState-(1)]
	_ = x[StageComplete-(2)]
}

var _StageValues = []Stage{StageFetchColumns, StageWithMergeableState, StageComplete}

var _StageNameToValueMap = map[string]Stage{
	_StageName[0:12]:       StageFetchColumns,
	_StageLowerName[0:12]:  StageFetchColumns,
	_StageName[12:30]:      StageWithMergeableState,
	_StageLowerName[12:30]: StageWithMergeableState,
	_StageName[30:38]:      StageComplete,
	_StageLowerName[30:38]: StageComplete,
}

var _StageNames = []string{
	_StageName[0:12],
	_StageName[12:30],
	_StageName[30:38],
}

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

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

// StageValues returns all values of the enum
func StageValues() []Stage {
	return _StageValues
}

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

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