// Code generated by "enumer -type Key -transform snake -trimprefix Key"; DO NOT EDIT. package feature import ( "fmt" "strings" ) const ( _KeyName_0 = "unspecifiedlogin_default_org" _KeyLowerName_0 = "unspecifiedlogin_default_org" _KeyName_1 = "user_schema" _KeyLowerName_1 = "user_schema" _KeyName_2 = "improved_performance" _KeyLowerName_2 = "improved_performance" _KeyName_3 = "debug_oidc_parent_erroroidc_single_v1_session_termination" _KeyLowerName_3 = "debug_oidc_parent_erroroidc_single_v1_session_termination" _KeyName_4 = "login_v2permission_check_v2console_use_v2_user_apienable_relational_tables" _KeyLowerName_4 = "login_v2permission_check_v2console_use_v2_user_apienable_relational_tables" ) var ( _KeyIndex_0 = [...]uint8{0, 11, 28} _KeyIndex_1 = [...]uint8{0, 11} _KeyIndex_2 = [...]uint8{0, 20} _KeyIndex_3 = [...]uint8{0, 23, 57} _KeyIndex_4 = [...]uint8{0, 8, 27, 50, 74} ) func (i Key) String() string { switch { case 0 <= i && i <= 1: return _KeyName_0[_KeyIndex_0[i]:_KeyIndex_0[i+1]] case i == 4: return _KeyName_1 case i == 7: return _KeyName_2 case 9 <= i && i <= 10: i -= 9 return _KeyName_3[_KeyIndex_3[i]:_KeyIndex_3[i+1]] case 13 <= i && i <= 16: i -= 13 return _KeyName_4[_KeyIndex_4[i]:_KeyIndex_4[i+1]] default: return fmt.Sprintf("Key(%d)", i) } } // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. func _KeyNoOp() { var x [1]struct{} _ = x[KeyUnspecified-(0)] _ = x[KeyLoginDefaultOrg-(1)] _ = x[KeyUserSchema-(4)] _ = x[KeyImprovedPerformance-(7)] _ = x[KeyDebugOIDCParentError-(9)] _ = x[KeyOIDCSingleV1SessionTermination-(10)] _ = x[KeyLoginV2-(13)] _ = x[KeyPermissionCheckV2-(14)] _ = x[KeyConsoleUseV2UserApi-(15)] _ = x[KeyEnableRelationalTables-(16)] } var _KeyValues = []Key{KeyUnspecified, KeyLoginDefaultOrg, KeyUserSchema, KeyImprovedPerformance, KeyDebugOIDCParentError, KeyOIDCSingleV1SessionTermination, KeyLoginV2, KeyPermissionCheckV2, KeyConsoleUseV2UserApi, KeyEnableRelationalTables} var _KeyNameToValueMap = map[string]Key{ _KeyName_0[0:11]: KeyUnspecified, _KeyLowerName_0[0:11]: KeyUnspecified, _KeyName_0[11:28]: KeyLoginDefaultOrg, _KeyLowerName_0[11:28]: KeyLoginDefaultOrg, _KeyName_1[0:11]: KeyUserSchema, _KeyLowerName_1[0:11]: KeyUserSchema, _KeyName_2[0:20]: KeyImprovedPerformance, _KeyLowerName_2[0:20]: KeyImprovedPerformance, _KeyName_3[0:23]: KeyDebugOIDCParentError, _KeyLowerName_3[0:23]: KeyDebugOIDCParentError, _KeyName_3[23:57]: KeyOIDCSingleV1SessionTermination, _KeyLowerName_3[23:57]: KeyOIDCSingleV1SessionTermination, _KeyName_4[0:8]: KeyLoginV2, _KeyLowerName_4[0:8]: KeyLoginV2, _KeyName_4[8:27]: KeyPermissionCheckV2, _KeyLowerName_4[8:27]: KeyPermissionCheckV2, _KeyName_4[27:50]: KeyConsoleUseV2UserApi, _KeyLowerName_4[27:50]: KeyConsoleUseV2UserApi, _KeyName_4[50:74]: KeyEnableRelationalTables, _KeyLowerName_4[50:74]: KeyEnableRelationalTables, } var _KeyNames = []string{ _KeyName_0[0:11], _KeyName_0[11:28], _KeyName_1[0:11], _KeyName_2[0:20], _KeyName_3[0:23], _KeyName_3[23:57], _KeyName_4[0:8], _KeyName_4[8:27], _KeyName_4[27:50], _KeyName_4[50:74], } // KeyString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func KeyString(s string) (Key, error) { if val, ok := _KeyNameToValueMap[s]; ok { return val, nil } if val, ok := _KeyNameToValueMap[strings.ToLower(s)]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to Key values", s) } // KeyValues returns all values of the enum func KeyValues() []Key { return _KeyValues } // KeyStrings returns a slice of all String values of the enum func KeyStrings() []string { strs := make([]string, len(_KeyNames)) copy(strs, _KeyNames) return strs } // IsAKey returns "true" if the value is listed in the enum definition. "false" otherwise func (i Key) IsAKey() bool { for _, v := range _KeyValues { if i == v { return true } } return false }