mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:47:32 +00:00
83 lines
2.8 KiB
Go
83 lines
2.8 KiB
Go
// Code generated by "enumer -type IDPAutoLinkingOption -transform lower -trimprefix IDPAutoLinkingOption"; DO NOT EDIT.
|
|
|
|
package domain
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
const _IDPAutoLinkingOptionName = "unspecifiedusernameemail"
|
|
|
|
var _IDPAutoLinkingOptionIndex = [...]uint8{0, 11, 19, 24}
|
|
|
|
const _IDPAutoLinkingOptionLowerName = "unspecifiedusernameemail"
|
|
|
|
func (i IDPAutoLinkingOption) String() string {
|
|
if i >= IDPAutoLinkingOption(len(_IDPAutoLinkingOptionIndex)-1) {
|
|
return fmt.Sprintf("IDPAutoLinkingOption(%d)", i)
|
|
}
|
|
return _IDPAutoLinkingOptionName[_IDPAutoLinkingOptionIndex[i]:_IDPAutoLinkingOptionIndex[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 _IDPAutoLinkingOptionNoOp() {
|
|
var x [1]struct{}
|
|
_ = x[IDPAutoLinkingOptionUnspecified-(0)]
|
|
_ = x[IDPAutoLinkingOptionUserName-(1)]
|
|
_ = x[IDPAutoLinkingOptionEmail-(2)]
|
|
}
|
|
|
|
var _IDPAutoLinkingOptionValues = []IDPAutoLinkingOption{IDPAutoLinkingOptionUnspecified, IDPAutoLinkingOptionUserName, IDPAutoLinkingOptionEmail}
|
|
|
|
var _IDPAutoLinkingOptionNameToValueMap = map[string]IDPAutoLinkingOption{
|
|
_IDPAutoLinkingOptionName[0:11]: IDPAutoLinkingOptionUnspecified,
|
|
_IDPAutoLinkingOptionLowerName[0:11]: IDPAutoLinkingOptionUnspecified,
|
|
_IDPAutoLinkingOptionName[11:19]: IDPAutoLinkingOptionUserName,
|
|
_IDPAutoLinkingOptionLowerName[11:19]: IDPAutoLinkingOptionUserName,
|
|
_IDPAutoLinkingOptionName[19:24]: IDPAutoLinkingOptionEmail,
|
|
_IDPAutoLinkingOptionLowerName[19:24]: IDPAutoLinkingOptionEmail,
|
|
}
|
|
|
|
var _IDPAutoLinkingOptionNames = []string{
|
|
_IDPAutoLinkingOptionName[0:11],
|
|
_IDPAutoLinkingOptionName[11:19],
|
|
_IDPAutoLinkingOptionName[19:24],
|
|
}
|
|
|
|
// IDPAutoLinkingOptionString retrieves an enum value from the enum constants string name.
|
|
// Throws an error if the param is not part of the enum.
|
|
func IDPAutoLinkingOptionString(s string) (IDPAutoLinkingOption, error) {
|
|
if val, ok := _IDPAutoLinkingOptionNameToValueMap[s]; ok {
|
|
return val, nil
|
|
}
|
|
|
|
if val, ok := _IDPAutoLinkingOptionNameToValueMap[strings.ToLower(s)]; ok {
|
|
return val, nil
|
|
}
|
|
return 0, fmt.Errorf("%s does not belong to IDPAutoLinkingOption values", s)
|
|
}
|
|
|
|
// IDPAutoLinkingOptionValues returns all values of the enum
|
|
func IDPAutoLinkingOptionValues() []IDPAutoLinkingOption {
|
|
return _IDPAutoLinkingOptionValues
|
|
}
|
|
|
|
// IDPAutoLinkingOptionStrings returns a slice of all String values of the enum
|
|
func IDPAutoLinkingOptionStrings() []string {
|
|
strs := make([]string, len(_IDPAutoLinkingOptionNames))
|
|
copy(strs, _IDPAutoLinkingOptionNames)
|
|
return strs
|
|
}
|
|
|
|
// IsAIDPAutoLinkingOption returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
func (i IDPAutoLinkingOption) IsAIDPAutoLinkingOption() bool {
|
|
for _, v := range _IDPAutoLinkingOptionValues {
|
|
if i == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|