mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:27:42 +00:00
79 lines
2.0 KiB
Go
79 lines
2.0 KiB
Go
![]() |
// Code generated by "enumer -type OrgState -transform lower -trimprefix OrgState"; DO NOT EDIT.
|
||
|
|
||
|
package domain
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
const _OrgStateName = "activeinactive"
|
||
|
|
||
|
var _OrgStateIndex = [...]uint8{0, 6, 14}
|
||
|
|
||
|
const _OrgStateLowerName = "activeinactive"
|
||
|
|
||
|
func (i OrgState) String() string {
|
||
|
if i < 0 || i >= OrgState(len(_OrgStateIndex)-1) {
|
||
|
return fmt.Sprintf("OrgState(%d)", i)
|
||
|
}
|
||
|
return _OrgStateName[_OrgStateIndex[i]:_OrgStateIndex[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 _OrgStateNoOp() {
|
||
|
var x [1]struct{}
|
||
|
_ = x[OrgStateActive-(0)]
|
||
|
_ = x[OrgStateInactive-(1)]
|
||
|
}
|
||
|
|
||
|
var _OrgStateValues = []OrgState{OrgStateActive, OrgStateInactive}
|
||
|
|
||
|
var _OrgStateNameToValueMap = map[string]OrgState{
|
||
|
_OrgStateName[0:6]: OrgStateActive,
|
||
|
_OrgStateLowerName[0:6]: OrgStateActive,
|
||
|
_OrgStateName[6:14]: OrgStateInactive,
|
||
|
_OrgStateLowerName[6:14]: OrgStateInactive,
|
||
|
}
|
||
|
|
||
|
var _OrgStateNames = []string{
|
||
|
_OrgStateName[0:6],
|
||
|
_OrgStateName[6:14],
|
||
|
}
|
||
|
|
||
|
// OrgStateString retrieves an enum value from the enum constants string name.
|
||
|
// Throws an error if the param is not part of the enum.
|
||
|
func OrgStateString(s string) (OrgState, error) {
|
||
|
if val, ok := _OrgStateNameToValueMap[s]; ok {
|
||
|
return val, nil
|
||
|
}
|
||
|
|
||
|
if val, ok := _OrgStateNameToValueMap[strings.ToLower(s)]; ok {
|
||
|
return val, nil
|
||
|
}
|
||
|
return 0, fmt.Errorf("%s does not belong to OrgState values", s)
|
||
|
}
|
||
|
|
||
|
// OrgStateValues returns all values of the enum
|
||
|
func OrgStateValues() []OrgState {
|
||
|
return _OrgStateValues
|
||
|
}
|
||
|
|
||
|
// OrgStateStrings returns a slice of all String values of the enum
|
||
|
func OrgStateStrings() []string {
|
||
|
strs := make([]string, len(_OrgStateNames))
|
||
|
copy(strs, _OrgStateNames)
|
||
|
return strs
|
||
|
}
|
||
|
|
||
|
// IsAOrgState returns "true" if the value is listed in the enum definition. "false" otherwise
|
||
|
func (i OrgState) IsAOrgState() bool {
|
||
|
for _, v := range _OrgStateValues {
|
||
|
if i == v {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|