// Code generated by "enumer -type=FailOpenMode -trimprefix=FailOpen"; DO NOT EDIT.

package ocsp

import (
	"fmt"
)

const _FailOpenModeName = "ocspFailOpenNotSetTrueFalse"

var _FailOpenModeIndex = [...]uint8{0, 18, 22, 27}

func (i FailOpenMode) String() string {
	if i >= FailOpenMode(len(_FailOpenModeIndex)-1) {
		return fmt.Sprintf("FailOpenMode(%d)", i)
	}
	return _FailOpenModeName[_FailOpenModeIndex[i]:_FailOpenModeIndex[i+1]]
}

var _FailOpenModeValues = []FailOpenMode{0, 1, 2}

var _FailOpenModeNameToValueMap = map[string]FailOpenMode{
	_FailOpenModeName[0:18]:  0,
	_FailOpenModeName[18:22]: 1,
	_FailOpenModeName[22:27]: 2,
}

// FailOpenModeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func FailOpenModeString(s string) (FailOpenMode, error) {
	if val, ok := _FailOpenModeNameToValueMap[s]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to FailOpenMode values", s)
}

// FailOpenModeValues returns all values of the enum
func FailOpenModeValues() []FailOpenMode {
	return _FailOpenModeValues
}

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