// Code generated by "enumer -type IDPState -transform lower -trimprefix IDPState"; DO NOT EDIT. package domain import ( "fmt" "strings" ) const _IDPStateName = "activeinactive" var _IDPStateIndex = [...]uint8{0, 6, 14} const _IDPStateLowerName = "activeinactive" func (i IDPState) String() string { if i >= IDPState(len(_IDPStateIndex)-1) { return fmt.Sprintf("IDPState(%d)", i) } return _IDPStateName[_IDPStateIndex[i]:_IDPStateIndex[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 _IDPStateNoOp() { var x [1]struct{} _ = x[IDPStateActive-(0)] _ = x[IDPStateInactive-(1)] } var _IDPStateValues = []IDPState{IDPStateActive, IDPStateInactive} var _IDPStateNameToValueMap = map[string]IDPState{ _IDPStateName[0:6]: IDPStateActive, _IDPStateLowerName[0:6]: IDPStateActive, _IDPStateName[6:14]: IDPStateInactive, _IDPStateLowerName[6:14]: IDPStateInactive, } var _IDPStateNames = []string{ _IDPStateName[0:6], _IDPStateName[6:14], } // IDPStateString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func IDPStateString(s string) (IDPState, error) { if val, ok := _IDPStateNameToValueMap[s]; ok { return val, nil } if val, ok := _IDPStateNameToValueMap[strings.ToLower(s)]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to IDPState values", s) } // IDPStateValues returns all values of the enum func IDPStateValues() []IDPState { return _IDPStateValues } // IDPStateStrings returns a slice of all String values of the enum func IDPStateStrings() []string { strs := make([]string, len(_IDPStateNames)) copy(strs, _IDPStateNames) return strs } // IsAIDPState returns "true" if the value is listed in the enum definition. "false" otherwise func (i IDPState) IsAIDPState() bool { for _, v := range _IDPStateValues { if i == v { return true } } return false }