Skip to content

Commit 7782707

Browse files
committed
regen part two electric boogaloo
1 parent 12a8c2b commit 7782707

File tree

1 file changed

+30
-38
lines changed

1 file changed

+30
-38
lines changed

internal/services/maps/sdk/2021-02-01/accounts/constants.go

+30-38
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,26 @@ const (
1313

1414
func PossibleValuesForCreatedByType() []string {
1515
return []string{
16-
"Application",
17-
"Key",
18-
"ManagedIdentity",
19-
"User",
16+
string(CreatedByTypeApplication),
17+
string(CreatedByTypeKey),
18+
string(CreatedByTypeManagedIdentity),
19+
string(CreatedByTypeUser),
2020
}
2121
}
2222

2323
func parseCreatedByType(input string) (*CreatedByType, error) {
2424
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,
2929
}
3030
if v, ok := vals[strings.ToLower(input)]; ok {
3131
return &v, nil
3232
}
3333

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)
3836
return &out, nil
3937
}
4038

@@ -47,24 +45,22 @@ const (
4745

4846
func PossibleValuesForKeyType() []string {
4947
return []string{
50-
"primary",
51-
"secondary",
48+
string(KeyTypePrimary),
49+
string(KeyTypeSecondary),
5250
}
5351
}
5452

5553
func parseKeyType(input string) (*KeyType, error) {
5654
vals := map[string]KeyType{
57-
"primary": "primary",
58-
"secondary": "secondary",
55+
"primary": KeyTypePrimary,
56+
"secondary": KeyTypeSecondary,
5957
}
6058
if v, ok := vals[strings.ToLower(input)]; ok {
6159
return &v, nil
6260
}
6361

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)
6864
return &out, nil
6965
}
7066

@@ -77,24 +73,22 @@ const (
7773

7874
func PossibleValuesForKind() []string {
7975
return []string{
80-
"Gen1",
81-
"Gen2",
76+
string(KindGenOne),
77+
string(KindGenTwo),
8278
}
8379
}
8480

8581
func parseKind(input string) (*Kind, error) {
8682
vals := map[string]Kind{
87-
"genone": "Gen1",
88-
"gentwo": "Gen2",
83+
"gen1": KindGenOne,
84+
"gen2": KindGenTwo,
8985
}
9086
if v, ok := vals[strings.ToLower(input)]; ok {
9187
return &v, nil
9288
}
9389

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)
9892
return &out, nil
9993
}
10094

@@ -108,25 +102,23 @@ const (
108102

109103
func PossibleValuesForName() []string {
110104
return []string{
111-
"G2",
112-
"S1",
113-
"S0",
105+
string(NameGTwo),
106+
string(NameSOne),
107+
string(NameSZero),
114108
}
115109
}
116110

117111
func parseName(input string) (*Name, error) {
118112
vals := map[string]Name{
119-
"gtwo": "G2",
120-
"sone": "S1",
121-
"szero": "S0",
113+
"g2": NameGTwo,
114+
"s1": NameSOne,
115+
"s0": NameSZero,
122116
}
123117
if v, ok := vals[strings.ToLower(input)]; ok {
124118
return &v, nil
125119
}
126120

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)
131123
return &out, nil
132124
}

0 commit comments

Comments
 (0)