-
Notifications
You must be signed in to change notification settings - Fork 5
/
AuthenticationTypeUserEnum.go
88 lines (78 loc) · 2.49 KB
/
AuthenticationTypeUserEnum.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for AuthenticationTypeUserEnum enum
*/
type AuthenticationTypeUserEnum int
/**
* Value collection for AuthenticationTypeUserEnum enum
*/
const (
AuthenticationTypeUser_KAUTHLOCAL AuthenticationTypeUserEnum = 1 + iota
AuthenticationTypeUser_KAUTHAD
AuthenticationTypeUser_KAUTHSALESFORCE
AuthenticationTypeUser_KAUTHGOOGLE
AuthenticationTypeUser_KAUTHSSO
)
func (r AuthenticationTypeUserEnum) MarshalJSON() ([]byte, error) {
s := AuthenticationTypeUserEnumToValue(r)
return json.Marshal(s)
}
func (r *AuthenticationTypeUserEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := AuthenticationTypeUserEnumFromValue(s)
*r = v
return nil
}
/**
* Converts AuthenticationTypeUserEnum to its string representation
*/
func AuthenticationTypeUserEnumToValue(authenticationTypeUserEnum AuthenticationTypeUserEnum) string {
switch authenticationTypeUserEnum {
case AuthenticationTypeUser_KAUTHLOCAL:
return "kAuthLocal"
case AuthenticationTypeUser_KAUTHAD:
return "kAuthAd"
case AuthenticationTypeUser_KAUTHSALESFORCE:
return "kAuthSalesforce"
case AuthenticationTypeUser_KAUTHGOOGLE:
return "kAuthGoogle"
case AuthenticationTypeUser_KAUTHSSO:
return "kAuthSso"
default:
return "kAuthLocal"
}
}
/**
* Converts AuthenticationTypeUserEnum Array to its string Array representation
*/
func AuthenticationTypeUserEnumArrayToValue(authenticationTypeUserEnum []AuthenticationTypeUserEnum) []string {
convArray := make([]string,len( authenticationTypeUserEnum))
for i:=0; i<len(authenticationTypeUserEnum);i++ {
convArray[i] = AuthenticationTypeUserEnumToValue(authenticationTypeUserEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func AuthenticationTypeUserEnumFromValue(value string) AuthenticationTypeUserEnum {
switch value {
case "kAuthLocal":
return AuthenticationTypeUser_KAUTHLOCAL
case "kAuthAd":
return AuthenticationTypeUser_KAUTHAD
case "kAuthSalesforce":
return AuthenticationTypeUser_KAUTHSALESFORCE
case "kAuthGoogle":
return AuthenticationTypeUser_KAUTHGOOGLE
case "kAuthSso":
return AuthenticationTypeUser_KAUTHSSO
default:
return AuthenticationTypeUser_KAUTHLOCAL
}
}