Files
zitadel/backend/v3/domain/idpautolinkingfield_enumer.go
T

80 lines
2.5 KiB
Go

// Code generated by "enumer -type IDPAutoLinkingField -transform lower -trimprefix IDPAutoLinkingField"; DO NOT EDIT.
package domain
import (
"fmt"
"strings"
)
const _IDPAutoLinkingFieldName = "usernameemail"
var _IDPAutoLinkingFieldIndex = [...]uint8{0, 8, 13}
const _IDPAutoLinkingFieldLowerName = "usernameemail"
func (i IDPAutoLinkingField) String() string {
i -= 1
if i >= IDPAutoLinkingField(len(_IDPAutoLinkingFieldIndex)-1) {
return fmt.Sprintf("IDPAutoLinkingField(%d)", i+1)
}
return _IDPAutoLinkingFieldName[_IDPAutoLinkingFieldIndex[i]:_IDPAutoLinkingFieldIndex[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 _IDPAutoLinkingFieldNoOp() {
var x [1]struct{}
_ = x[IDPAutoLinkingFieldUsername-(1)]
_ = x[IDPAutoLinkingFieldEmail-(2)]
}
var _IDPAutoLinkingFieldValues = []IDPAutoLinkingField{IDPAutoLinkingFieldUsername, IDPAutoLinkingFieldEmail}
var _IDPAutoLinkingFieldNameToValueMap = map[string]IDPAutoLinkingField{
_IDPAutoLinkingFieldName[0:8]: IDPAutoLinkingFieldUsername,
_IDPAutoLinkingFieldLowerName[0:8]: IDPAutoLinkingFieldUsername,
_IDPAutoLinkingFieldName[8:13]: IDPAutoLinkingFieldEmail,
_IDPAutoLinkingFieldLowerName[8:13]: IDPAutoLinkingFieldEmail,
}
var _IDPAutoLinkingFieldNames = []string{
_IDPAutoLinkingFieldName[0:8],
_IDPAutoLinkingFieldName[8:13],
}
// IDPAutoLinkingFieldString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func IDPAutoLinkingFieldString(s string) (IDPAutoLinkingField, error) {
if val, ok := _IDPAutoLinkingFieldNameToValueMap[s]; ok {
return val, nil
}
if val, ok := _IDPAutoLinkingFieldNameToValueMap[strings.ToLower(s)]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to IDPAutoLinkingField values", s)
}
// IDPAutoLinkingFieldValues returns all values of the enum
func IDPAutoLinkingFieldValues() []IDPAutoLinkingField {
return _IDPAutoLinkingFieldValues
}
// IDPAutoLinkingFieldStrings returns a slice of all String values of the enum
func IDPAutoLinkingFieldStrings() []string {
strs := make([]string, len(_IDPAutoLinkingFieldNames))
copy(strs, _IDPAutoLinkingFieldNames)
return strs
}
// IsAIDPAutoLinkingField returns "true" if the value is listed in the enum definition. "false" otherwise
func (i IDPAutoLinkingField) IsAIDPAutoLinkingField() bool {
for _, v := range _IDPAutoLinkingFieldValues {
if i == v {
return true
}
}
return false
}