-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathauthentication_method_sign_in_state.go
48 lines (46 loc) · 1.84 KB
/
authentication_method_sign_in_state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package models
type AuthenticationMethodSignInState int
const (
NOTSUPPORTED_AUTHENTICATIONMETHODSIGNINSTATE AuthenticationMethodSignInState = iota
NOTALLOWEDBYPOLICY_AUTHENTICATIONMETHODSIGNINSTATE
NOTENABLED_AUTHENTICATIONMETHODSIGNINSTATE
PHONENUMBERNOTUNIQUE_AUTHENTICATIONMETHODSIGNINSTATE
READY_AUTHENTICATIONMETHODSIGNINSTATE
NOTCONFIGURED_AUTHENTICATIONMETHODSIGNINSTATE
UNKNOWNFUTUREVALUE_AUTHENTICATIONMETHODSIGNINSTATE
)
func (i AuthenticationMethodSignInState) String() string {
return []string{"notSupported", "notAllowedByPolicy", "notEnabled", "phoneNumberNotUnique", "ready", "notConfigured", "unknownFutureValue"}[i]
}
func ParseAuthenticationMethodSignInState(v string) (any, error) {
result := NOTSUPPORTED_AUTHENTICATIONMETHODSIGNINSTATE
switch v {
case "notSupported":
result = NOTSUPPORTED_AUTHENTICATIONMETHODSIGNINSTATE
case "notAllowedByPolicy":
result = NOTALLOWEDBYPOLICY_AUTHENTICATIONMETHODSIGNINSTATE
case "notEnabled":
result = NOTENABLED_AUTHENTICATIONMETHODSIGNINSTATE
case "phoneNumberNotUnique":
result = PHONENUMBERNOTUNIQUE_AUTHENTICATIONMETHODSIGNINSTATE
case "ready":
result = READY_AUTHENTICATIONMETHODSIGNINSTATE
case "notConfigured":
result = NOTCONFIGURED_AUTHENTICATIONMETHODSIGNINSTATE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_AUTHENTICATIONMETHODSIGNINSTATE
default:
return nil, nil
}
return &result, nil
}
func SerializeAuthenticationMethodSignInState(values []AuthenticationMethodSignInState) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AuthenticationMethodSignInState) isMultiValue() bool {
return false
}