@@ -13,28 +13,26 @@ const (
13
13
14
14
func PossibleValuesForCreatedByType () []string {
15
15
return []string {
16
- "Application" ,
17
- "Key" ,
18
- "ManagedIdentity" ,
19
- "User" ,
16
+ string ( CreatedByTypeApplication ) ,
17
+ string ( CreatedByTypeKey ) ,
18
+ string ( CreatedByTypeManagedIdentity ) ,
19
+ string ( CreatedByTypeUser ) ,
20
20
}
21
21
}
22
22
23
23
func parseCreatedByType (input string ) (* CreatedByType , error ) {
24
24
vals := map [string ]CreatedByType {
25
- "application" : "Application" ,
26
- "key" : "Key" ,
27
- "managedidentity" : "ManagedIdentity" ,
28
- "user" : "User" ,
25
+ "application" : CreatedByTypeApplication ,
26
+ "key" : CreatedByTypeKey ,
27
+ "managedidentity" : CreatedByTypeManagedIdentity ,
28
+ "user" : CreatedByTypeUser ,
29
29
}
30
30
if v , ok := vals [strings .ToLower (input )]; ok {
31
31
return & v , nil
32
32
}
33
33
34
- // it could be a new value - best effort convert this
35
- v := input
36
-
37
- out := CreatedByType (v )
34
+ // otherwise presume it's an undefined value and best-effort it
35
+ out := CreatedByType (input )
38
36
return & out , nil
39
37
}
40
38
@@ -47,24 +45,22 @@ const (
47
45
48
46
func PossibleValuesForKeyType () []string {
49
47
return []string {
50
- "primary" ,
51
- "secondary" ,
48
+ string ( KeyTypePrimary ) ,
49
+ string ( KeyTypeSecondary ) ,
52
50
}
53
51
}
54
52
55
53
func parseKeyType (input string ) (* KeyType , error ) {
56
54
vals := map [string ]KeyType {
57
- "primary" : "primary" ,
58
- "secondary" : "secondary" ,
55
+ "primary" : KeyTypePrimary ,
56
+ "secondary" : KeyTypeSecondary ,
59
57
}
60
58
if v , ok := vals [strings .ToLower (input )]; ok {
61
59
return & v , nil
62
60
}
63
61
64
- // it could be a new value - best effort convert this
65
- v := input
66
-
67
- out := KeyType (v )
62
+ // otherwise presume it's an undefined value and best-effort it
63
+ out := KeyType (input )
68
64
return & out , nil
69
65
}
70
66
@@ -77,24 +73,22 @@ const (
77
73
78
74
func PossibleValuesForKind () []string {
79
75
return []string {
80
- "Gen1" ,
81
- "Gen2" ,
76
+ string ( KindGenOne ) ,
77
+ string ( KindGenTwo ) ,
82
78
}
83
79
}
84
80
85
81
func parseKind (input string ) (* Kind , error ) {
86
82
vals := map [string ]Kind {
87
- "genone " : "Gen1" ,
88
- "gentwo " : "Gen2" ,
83
+ "gen1 " : KindGenOne ,
84
+ "gen2 " : KindGenTwo ,
89
85
}
90
86
if v , ok := vals [strings .ToLower (input )]; ok {
91
87
return & v , nil
92
88
}
93
89
94
- // it could be a new value - best effort convert this
95
- v := input
96
-
97
- out := Kind (v )
90
+ // otherwise presume it's an undefined value and best-effort it
91
+ out := Kind (input )
98
92
return & out , nil
99
93
}
100
94
@@ -108,25 +102,23 @@ const (
108
102
109
103
func PossibleValuesForName () []string {
110
104
return []string {
111
- "G2" ,
112
- "S1" ,
113
- "S0" ,
105
+ string ( NameGTwo ) ,
106
+ string ( NameSOne ) ,
107
+ string ( NameSZero ) ,
114
108
}
115
109
}
116
110
117
111
func parseName (input string ) (* Name , error ) {
118
112
vals := map [string ]Name {
119
- "gtwo " : "G2" ,
120
- "sone " : "S1" ,
121
- "szero " : "S0" ,
113
+ "g2 " : NameGTwo ,
114
+ "s1 " : NameSOne ,
115
+ "s0 " : NameSZero ,
122
116
}
123
117
if v , ok := vals [strings .ToLower (input )]; ok {
124
118
return & v , nil
125
119
}
126
120
127
- // it could be a new value - best effort convert this
128
- v := input
129
-
130
- out := Name (v )
121
+ // otherwise presume it's an undefined value and best-effort it
122
+ out := Name (input )
131
123
return & out , nil
132
124
}
0 commit comments