mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
87 lines
2.9 KiB
Go
87 lines
2.9 KiB
Go
|
// Code generated by "enumer -type OIDCResponseMode -transform snake -trimprefix OIDCResponseMode"; DO NOT EDIT.
|
||
|
|
||
|
package domain
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
const _OIDCResponseModeName = "unspecifiedqueryfragmentform_post"
|
||
|
|
||
|
var _OIDCResponseModeIndex = [...]uint8{0, 11, 16, 24, 33}
|
||
|
|
||
|
const _OIDCResponseModeLowerName = "unspecifiedqueryfragmentform_post"
|
||
|
|
||
|
func (i OIDCResponseMode) String() string {
|
||
|
if i < 0 || i >= OIDCResponseMode(len(_OIDCResponseModeIndex)-1) {
|
||
|
return fmt.Sprintf("OIDCResponseMode(%d)", i)
|
||
|
}
|
||
|
return _OIDCResponseModeName[_OIDCResponseModeIndex[i]:_OIDCResponseModeIndex[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 _OIDCResponseModeNoOp() {
|
||
|
var x [1]struct{}
|
||
|
_ = x[OIDCResponseModeUnspecified-(0)]
|
||
|
_ = x[OIDCResponseModeQuery-(1)]
|
||
|
_ = x[OIDCResponseModeFragment-(2)]
|
||
|
_ = x[OIDCResponseModeFormPost-(3)]
|
||
|
}
|
||
|
|
||
|
var _OIDCResponseModeValues = []OIDCResponseMode{OIDCResponseModeUnspecified, OIDCResponseModeQuery, OIDCResponseModeFragment, OIDCResponseModeFormPost}
|
||
|
|
||
|
var _OIDCResponseModeNameToValueMap = map[string]OIDCResponseMode{
|
||
|
_OIDCResponseModeName[0:11]: OIDCResponseModeUnspecified,
|
||
|
_OIDCResponseModeLowerName[0:11]: OIDCResponseModeUnspecified,
|
||
|
_OIDCResponseModeName[11:16]: OIDCResponseModeQuery,
|
||
|
_OIDCResponseModeLowerName[11:16]: OIDCResponseModeQuery,
|
||
|
_OIDCResponseModeName[16:24]: OIDCResponseModeFragment,
|
||
|
_OIDCResponseModeLowerName[16:24]: OIDCResponseModeFragment,
|
||
|
_OIDCResponseModeName[24:33]: OIDCResponseModeFormPost,
|
||
|
_OIDCResponseModeLowerName[24:33]: OIDCResponseModeFormPost,
|
||
|
}
|
||
|
|
||
|
var _OIDCResponseModeNames = []string{
|
||
|
_OIDCResponseModeName[0:11],
|
||
|
_OIDCResponseModeName[11:16],
|
||
|
_OIDCResponseModeName[16:24],
|
||
|
_OIDCResponseModeName[24:33],
|
||
|
}
|
||
|
|
||
|
// OIDCResponseModeString retrieves an enum value from the enum constants string name.
|
||
|
// Throws an error if the param is not part of the enum.
|
||
|
func OIDCResponseModeString(s string) (OIDCResponseMode, error) {
|
||
|
if val, ok := _OIDCResponseModeNameToValueMap[s]; ok {
|
||
|
return val, nil
|
||
|
}
|
||
|
|
||
|
if val, ok := _OIDCResponseModeNameToValueMap[strings.ToLower(s)]; ok {
|
||
|
return val, nil
|
||
|
}
|
||
|
return 0, fmt.Errorf("%s does not belong to OIDCResponseMode values", s)
|
||
|
}
|
||
|
|
||
|
// OIDCResponseModeValues returns all values of the enum
|
||
|
func OIDCResponseModeValues() []OIDCResponseMode {
|
||
|
return _OIDCResponseModeValues
|
||
|
}
|
||
|
|
||
|
// OIDCResponseModeStrings returns a slice of all String values of the enum
|
||
|
func OIDCResponseModeStrings() []string {
|
||
|
strs := make([]string, len(_OIDCResponseModeNames))
|
||
|
copy(strs, _OIDCResponseModeNames)
|
||
|
return strs
|
||
|
}
|
||
|
|
||
|
// IsAOIDCResponseMode returns "true" if the value is listed in the enum definition. "false" otherwise
|
||
|
func (i OIDCResponseMode) IsAOIDCResponseMode() bool {
|
||
|
for _, v := range _OIDCResponseModeValues {
|
||
|
if i == v {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|