-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathaccess_package_catalog_state.go
36 lines (34 loc) · 1.1 KB
/
access_package_catalog_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
package models
type AccessPackageCatalogState int
const (
UNPUBLISHED_ACCESSPACKAGECATALOGSTATE AccessPackageCatalogState = iota
PUBLISHED_ACCESSPACKAGECATALOGSTATE
UNKNOWNFUTUREVALUE_ACCESSPACKAGECATALOGSTATE
)
func (i AccessPackageCatalogState) String() string {
return []string{"unpublished", "published", "unknownFutureValue"}[i]
}
func ParseAccessPackageCatalogState(v string) (any, error) {
result := UNPUBLISHED_ACCESSPACKAGECATALOGSTATE
switch v {
case "unpublished":
result = UNPUBLISHED_ACCESSPACKAGECATALOGSTATE
case "published":
result = PUBLISHED_ACCESSPACKAGECATALOGSTATE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_ACCESSPACKAGECATALOGSTATE
default:
return nil, nil
}
return &result, nil
}
func SerializeAccessPackageCatalogState(values []AccessPackageCatalogState) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AccessPackageCatalogState) isMultiValue() bool {
return false
}